Coder Social home page Coder Social logo

gdut-yy / leetcode-hub-java Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 3.0 30.93 MB

基于 java21 + maven3.9 + junit5 + jacoco 的 leetcode + codeforces + atcoder + nowcoder 练习仓库。

Home Page: https://gdut-yy.github.io/doc-gitblogs-hope/module_leetcode/leetcode_trick/

Java 99.78% Python 0.08% C++ 0.15%
algorithm algorithms atcoder codeforces jacoco java java17 java21 junit5 leetcode luogu nowcoder oj oj-solutions unit-test

leetcode-hub-java's Introduction

Hi there 👋

我的 GitHub 数据

leetcode-hub-java's People

Contributors

gdut-yy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

leetcode-hub-java's Issues

像你学习 , 作者能坚持这么多天

最近我也重写了题目仓库 我的题目 不知道我能坚持多久 哈哈哈

逛github看到的 要是之前能看到 作者的这个仓库,我也不弄了 但是也不想用maven,感觉太重了 ,于是用原生写了

CF1714D-cpp

#include <bits/stdc++.h>

#define len(s) (int)s.size()
#define forn(i, n) for (int i = 0; i < int(n); i++)

using namespace std;
int ans = 0;
bool ok = true;

void Find(int a, int b, string &t, vector<string> &str, vector<pair<int, int>> &match) {
    int Max = 0, id = -1, pos = -1;
    for (int i = a; i <= b; i++) {
        for (int j = 0; j < len(str); j++) {
            string s = str[j];
            if (i + len(s) > len(t) || i + len(s) <= b) continue;
            if (t.substr(i, len(s)) == s) {
                if (i + len(s) > Max) {
                    Max = i + len(s);
                    id = j;
                    pos = i;
                }
            }
        }
    }
    if (id == -1) {
        ok = false;
        return;
    } else {
        match.emplace_back(id, pos);
        ans++;
        if (Max == len(t)) return; else Find(max(pos + 1, b + 1), Max, t, str, match);
    }
}

void solve() {
    ans = 0;
    ok = true;

    string t;
    cin >> t;
    int n;
    cin >> n;

    vector<string> s(n);
    vector<pair<int, int>> match;

    forn(i, n) {
        cin >> s[i];
    }

    Find(0, 0, t, s, match);
    if (!ok) cout << "-1\n";
    else {
        cout << ans << endl;
        for (auto &p: match) cout << p.first + 1 << ' ' << p.second + 1 << endl;
    }
}

int main() {
    int q;
    cin >> q;
    while (q--) { solve(); }
    return 0;
}

org.jacoco:jacoco-maven-plugin:0.8.10:prepare-agent 库不能下载

  • maven有配置阿里云仓库

[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.10:prepare-agent (default) on project leetcode-hub-java: Execution default of goal org.jacoco:jacoco-maven-plugin:0.8.10:prepare-agent failed: A required class was missing while executing org.jacoco:jacoco-maven-plugin:0.8.10:prepare-agent: org/jacoco/core/runtime/AgentOptions
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jacoco:jacoco-maven-plugin:0.8.10
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/wangbowen/.m2/repository/org/jacoco/jacoco-maven-plugin/0.8.10/jacoco-maven-plugin-0.8.10.jar
[ERROR] urls[1] = file:/Users/wangbowen/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[2] = file:/Users/wangbowen/.m2/repository/org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.jar
[ERROR] urls[3] = file:/Users/wangbowen/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
[ERROR] urls[4] = file:/Users/wangbowen/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
[ERROR] urls[5] = file:/Users/wangbowen/.m2/repository/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar
[ERROR] urls[6] = file:/Users/wangbowen/.m2/repository/org/jacoco/org.jacoco.core/0.8.10/org.jacoco.core-0.8.10.jar
[ERROR] urls[7] = file:/Users/wangbowen/.m2/repository/org/jacoco/org.jacoco.report/0.8.10/org.jacoco.report-0.8.10.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.jacoco.core.runtime.AgentOptions
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.