# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90875 | 2018-12-25T05:01:17 Z | YottaByte | Crazy old lady (IZhO13_crazy) | C++14 | 2 ms | 376 KB |
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define pb push_back #define mk make_pair #define fr first #define sc second #define int long long main() { int t; cin >> t; while(t--) { int n, p, last; int ans = 0; cin >> n; for(int i = 1; i <= n; i++) { cin >> p; if(p == i) ans = last; last = p; } cout << ans << endl; } } /** 2 2 2 1 4 2 3 1 4 **/
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |