# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
111965 | 2019-05-17T02:23:24 Z | mechfrog88 | None (JOI16_memory2) | C++14 | 2 ms | 404 KB |
#include "Memory2_lib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; struct s{ ll num; ll times; bool operator <(const s& rhs) const { return times < rhs.times; } }; void Solve(int T, int N){ vector <ll> num(N,0); for (int x=0;x<N;x++){ for (int z=0;z<N;z++){ num[Flip(z,z+1)]++; } } vector <s> arr(N); for (int z=0;z<N;z++){ arr[z].num = z; arr[z].times = num[z]; } sort(arr.begin(),arr.end()); vector <ll> visited(N,false); for (int z=0;z<arr.size();z++){ for (int x=0;x<N;x++){ ll next = x+1; while (visited[next]){ next++; } if (Flip(x,next) == arr[z].num){ Answer(x,next,arr[z].num); visited[x] = true; visited[next] = true; } } } return; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Wrong Answer[3] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Wrong Answer[2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 404 KB | Wrong Answer[2] |
2 | Halted | 0 ms | 0 KB | - |