제출 #334546

#제출 시각아이디문제언어결과실행 시간메모리
334546rocks03Finding Routers (IOI20_routers)C++14
54.47 / 100
2 ms384 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); void compute(int l, int r, int ql, int qr, vector<int>& ans){ if(l == r){ ans[ql] = 2 * (l - 1 - ans[ql - 1]) + ans[ql - 1]; return; } int m = (l + r) / 2; int idx = use_detector(m); if(idx < ql){ compute(m + 1, r, ql, qr, ans); } else if(ql <= idx){ compute(l, m, ql, idx, ans); if(ans[idx] != -1){ idx++; } compute(m + 1, r, idx, qr, ans); } } vector<int> find_routers(int l, int n, int q){ vector<int> ans(n, -1); ans[0] = 0; compute(1, l, 1, n-1, ans); 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...