Submission #1121688

#TimeUsernameProblemLanguageResultExecution timeMemory
1121688OmarAlimammadzadeCalvinball championship (CEOI15_teams)C++14
0 / 100
1070 ms336 KiB
// author - alimammadzade #include <bits/stdc++.h> using namespace std; signed main() { cin.tie(nullptr)->sync_with_stdio(false); // system("cls"), freopen("in.txt", "r", stdin); int n, res = 0; cin >> n; vector<int> a(n); for (int& i : a) { cin >> i; i--; } vector<int> last(n); while (true) { res++; // for (int i : last) cout << i << ' '; // cout << '\n'; if (last == a) break; for (int i = n - 1; i >= 0; i--) if (last[i] < n - 1) { last[i]++; break; } else { last[i] = 0; } } cout << res - 1; }
#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...