Submission #112013

#TimeUsernameProblemLanguageResultExecution timeMemory
112013lauzm0Memory 2 (JOI16_memory2)C++14
10 / 100
2 ms384 KiB
#include "Memory2_lib.h" #include <iostream> #include<vector> #include<cmath> using namespace std; void Solve(int T, int n){ vector<int>a(2*n); for(int i = 0 ; i< 2*n ; i++){ vector<int>checkodd (n); for(int j = 0 ; j<2*n ; j++){ if(i!=j){ checkodd[Flip(i,j)]++; } } for(int j =0 ; j<n ; j++){ if(checkodd[j]%2==1){ a[i]=j; } } } for(int i = 0 ; i< n ; i++){ int firstpos=-1 ; int secondpos; for(int j = 0 ; j< 2*n ; j++){ if(a[j]==i &&firstpos==-1){ firstpos=j; } else if (a[j]==i){ secondpos=j; Answer(firstpos,secondpos,i); break; } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...