Submission #728734

# Submission time Handle Problem Language Result Execution time Memory
728734 2023-04-23T01:50:39 Z abcvuitunggio None (JOI16_memory2) C++17
100 / 100
1 ms 308 KB
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
int n;
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
void f(vector <int> v){
    int j=v[rd()%v.size()];
    vector <int> ve,a[51];
    for (int i:v)
        if (i!=j)
            a[Flip(i,j)].push_back(i);
    for (int i=0;i<n;i++){
        if (a[i].empty())
            continue;
        if (a[i].size()<3){
            if (a[i].size()==1)
                Answer(min(a[i][0],j),max(a[i][0],j),i);
            else
                Answer(a[i][0],a[i][1],i);
            continue;
        }
        a[i].push_back(j);
        f(a[i]);
    }
}
void Solve(int T, int N){
    vector <int> v;
    n=N;
    for (int i=0;i<n*2;i++)
        v.push_back(i);
    f(v);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 308 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct