제출 #334520

#제출 시각아이디문제언어결과실행 시간메모리
334520rocks03Finding Routers (IOI20_routers)C++14
0 / 100
2 ms364 KiB
#pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int use_detector(int x); vector<int> find_routers(int l, int n, int q){ vector<int> ans(n), mx(n + 1, 0), mn(n + 1, l); ans[0] = 0, mx[0] = 1; for(int i = 1; i < n; i++){ int ql = mx[i - 1] + 1, qr = mn[i + 1]; while(qr - ql > 1){ int qm = (ql + qr) / 2; int id = use_detector(qm); if(id >= i){ qr = qm; } else{ ql = qm; } mn[id] = min(mn[id], qm); mx[id] = max(mx[id], qm); } --ql; ans[i] = 2*(ql - ans[i-1]) + ans[i-1]; mx[i] = max(mx[i], ans[i] + 1); } return ans; }

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

routers.cpp:2: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    2 | #pragma GCC optimization("O3")
      | 
routers.cpp:3: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    3 | #pragma GCC optimization("unroll-loops")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...