| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1361768 | opeleklanos | Hack (APIO25_hack) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
using namespace std;
#include "hack.h"
// int secretNum = 938572;
// int collisions(vector<int> v){
// vector<int> newV(secretNum +1, 0);
// int ans = 0;
// for(auto i : v){
// ans += newV[i%secretNum];
// newV[i%secretNum] ++;
// }
// return ans;
// }
int hack(){
int l = 2, r = 1000000;
while(l!=r){
int mid = (l+r)/2;
vector<int> v = {1};
for(int i = l; i<=mid; i++) v.push_back(i);
if(collisions(v)) r = mid;
else l = mid+1;
}
return l-1;
}
// int main(void){
// cout<<hack();
// }
