Submission #728733

# Submission time Handle Problem Language Result Execution time Memory
728733 2023-04-23T01:48:46 Z abcvuitunggio None (JOI16_memory2) C++17
60 / 100
1 ms 340 KB
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
int n;
void f(vector <int> v){
    random_shuffle(v.begin(),v.end());
    int j=v[v.size()/2];
    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 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 340 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 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 216 KB Output is correct
3 Correct 1 ms 296 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 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Wrong Answer[2]
2 Halted 0 ms 0 KB -