제출 #1366949

#제출 시각아이디문제언어결과실행 시간메모리
1366949Cebrayil09Hack (APIO25_hack)C++20
25 / 100
1291 ms16472 KiB
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int hack() {
    vector<ll> v;
    for(ll i = 1;i <= 1'000'000;i++) v.push_back(i);

    ll res = collisions(v);

    ll l = 1, r = v.back();
    while(l <= r) {
        ll mid = l + (r-l)/2;

        vector<int> cnt(mid);

        ll c = 0;
        for(ll &i : v) {
            c += cnt[i%mid];
            cnt[i%mid]++;
        }

        if(c == res) return mid;

        if(c > res) l = mid+1;
        else r = mid-1;
    }
}

컴파일 시 표준 에러 (stderr) 메시지

hack.cpp: In function 'int hack()':
hack.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…