| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1366937 | Cebrayil09 | Hack (APIO25_hack) | C++20 | 2250 ms | 69344 KiB |
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int hack() {
ll cur = 1;
ll l = 1;
vector<ll> v;
while(1) {
map<ll,int> m;
ll c = 0;
while(c <= 1000000) {
v.push_back(cur);
if(cur%l != 0) m[cur%l]++;
c += m[cur%l];
m[cur%l]++;
cur++;
}
v.pop_back();
v.pop_back();
cur -= 2;
int res = collisions(v);
if(!res) {
l = v.back();
continue;
}
ll r = v.back() - 1;
while(l <= r) {
ll mid = l + (r-l)/2;
vector<int> cnt(mid);
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;
}
exit(0);
}
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
