제출 #1123066

#제출 시각아이디문제언어결과실행 시간메모리
1123066SulA곤돌라 (IOI14_gondola)C++20
10 / 100
8 ms1096 KiB
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #include "gondola.h" //#pragma GCC target("popcnt") using namespace __gnu_pbds; using namespace std; using ordered_set = tree<int, null_type, less_equal<>, rb_tree_tag, tree_order_statistics_node_update>; #define popcount __builtin_popcountll #define all(a) (a).begin(), (a).end() int valid(int n, int a[]) { deque<int> s; int val = -1; for (int i = 0; i < n; i++) { s.push_back(--a[i]); if (a[i] < n) val = a[i]; } if (val == -1) return true; while (s[val] != val) { s.push_front(s.back()); s.pop_back(); } for (int i = 0; i < n; i++) if (s[i] < n && s[i] != i) return 0; return 1; } int replacement(int n, int a[], int b[]) { return valid(n, a); } int countReplacement(int n, int a[]) { return 69; } //signed main() { // ios::sync_with_stdio(false); // cin.tie(nullptr); // cout.tie(nullptr); // // int n; cin >> n; // vector<int> a(n); // for (int& x : a) cin >> x; // cout << valid(n, a); //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...