제출 #1257081

#제출 시각아이디문제언어결과실행 시간메모리
1257081Nika533Hack (APIO25_hack)C++20
0 / 100
4 ms852 KiB
#pragma GCC diagnostic warning "-std=c++11" #include "hack.h" #include <bits/stdc++.h> #define pb push_back #define f first #define s second #define MOD 1000000007 #define flush fflush(stdout) #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(), (x).rend() #define pii pair<int,int> using namespace std; int m,T,k; vector<long long> solve(int mid) { long long sq=sqrt(mid); vector<long long> x; if (mid==0) { x.pb(1); return x; } if (mid==1) { x.pb(1); x.pb(2); return x; } if (mid==2) { x.pb(1); x.pb(2); x.pb(3); return x; } if (mid==3) { x.pb(1); x.pb(2); x.pb(3); x.pb(4); return x; } for (long long j=0; j<=mid/sq-1; j++) { x.pb(j*sq+1); } int last=mid/sq-1; last*=sq; last++; vector<long long> y=solve(mid+1-last); for (auto A:y) { if (A==y[0]) continue; x.pb(A-y[0]+last); } return x; } int hack() { long long l=2,r=1e9,ans=0; while (l<=r) { long long mid=(l+r)/2; vector<long long> x=solve(mid); if (mid<=55) { cout<<"MIDD "<<mid<<endl; for (auto A:x) cout<<A<<" "; cout<<endl; } long long res=collisions(x); if (res) { r=mid-1; ans=mid; } else { l=mid+1; } } return ans; }

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

hack.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    1 | #pragma GCC diagnostic warning "-std=c++11"
      |                                ^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...