Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (0.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: dchang0524
  • License: mit
  • Language: C++
  • Default Branch: main
  • Size: 5.55 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

ICPC Practice

This is where I will submit problems I solve to prepare for ICPC, starting from 9/26/2024.

Owner

  • Login: dchang0524
  • Kind: user

Citation (Citation.cpp)

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int last_true(int lo, int hi, function<bool(int)> f) {
    // if none of the values in the range work, return lo - 1
    lo--;
    while (lo < hi) {
        // find the middle of the current range (rounding up)
        int mid = lo + (hi - lo + 1) / 2;
        if (f(mid)) {
            // if mid works, then all numbers smaller than mid also work
            lo = mid;
        } else {
            // if mid does not work, greater values would not work either
            hi = mid - 1;
        }
    }
    return lo;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int N; cin >> N;
    vector<ll> nums(N);
    for (int i = 0; i < N; i++) {
        cin >> nums[i];
    }

    function<bool(ll)> check = [&] (ll x) {
        int cnt = 0;
        for (int i = 0; i < N; i++) {
            if (nums[i] >= x) cnt++;
        }
        return cnt >= x;
    };
    cout << last_true(0, 1e9, check) << endl;
}

GitHub Events

Total
  • Push event: 14
Last Year
  • Push event: 14