제출 #334544

#제출 시각아이디문제언어결과실행 시간메모리
334544rocks03Finding Routers (IOI20_routers)C++14
40.39 / 100
2 ms492 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){ if(use_detector(l - 1) == ql - 1){ 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){ compute(m + 1, r, idx, qr, ans); } else{ compute(m + 1, r, idx + 1, 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...