Submission #1092052

#TimeUsernameProblemLanguageResultExecution timeMemory
1092052huyngoGondola (IOI14_gondola)C++17
25 / 100
36 ms4588 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using i64 = long long; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cerr << x; } void __print(double x) { cerr << x; } void __print(long double x) { cerr << x; } void __print(char x) { cerr << '\'' << x << '\''; } void __print(const char* x) { cerr << '"' << x << '"'; } void __print(const string& x) { cerr << '"' << x << '"'; } void __print(bool x) { cerr << (x ? "true" : "false"); } template<typename T, typename V> void __print(const pair<T, V>& x) { cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}'; } template<typename T> void __print(const T& x) { int f = 0; cerr << '{'; for (auto& i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}"; } void _print() { cerr << "]\n"; } template <typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); } #define dbg(x...) cerr << "[" << #x << "] = ["; _print(x) #define ln "\n" #define fastIO() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define all(x) (x).begin(), (x).end() #define rep(i,a,b) for(int i=a; i<=b; ++i) #define ar array int Bit(int mask, int b) { return (mask >> b) & 1; } const ll base = 311, MOD = 998244353, M = 1e9 + 7, INF = 1e18; int valid(int n, int inputSeq[]) { rep(i, 0, n - 1) inputSeq[i]--; int x = -1; rep(i, 0, n - 1) if (inputSeq[i] < n) { x = (inputSeq[i] - i + n) % n; break; } map<int, int> mp; rep(i, 0, n - 1) { mp[inputSeq[i]]++; if (mp[inputSeq[i]] > 1) return 0; } if (x == -1) return 1; rep(i, 0, n - 1) if (inputSeq[i] < n && x != (inputSeq[i] - i + n) % n) return 0; return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { vector<int> a(n); rep(i, 0, n - 1) a[i] = gondolaSeq[i]; a.push_back(0); sort(all(a)); int l = 0; rep(i, 0, n - 1) rep(j, a[i] + 1, a[i + 1] - 1) replacementSeq[l++] = j; return l; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
#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...