# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90875 | YottaByte | Crazy old lady (IZhO13_crazy) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |