Submission #1161657

#TimeUsernameProblemLanguageResultExecution timeMemory
1161657mateuszwesMemory 2 (JOI16_memory2)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h> #include "Memory2_lib.h" using namespace std; #define ll long long #define ull unsigned ll #define pb push_back #define pii pair<int,int> #define pl pair<ll,ll> #define F first #define S second #define pq priority_queue #define all(x) x.begin(), x.end() #define deb(x) cout << #x << " = " << x << '\n'; #define deb2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << '\n'; constexpr int M = 1e9+7; constexpr int N = 107; constexpr bool debug = 0; int decided[107]; //int taken[107]; //to deduce last number? void Solve(int t, int n){ //repeats until only 2 cards int ob = 2; int A = 0, B = 1, C = 2; while(ob <= 2*n){ int x = Flip(A,B); int y = Flip(A,C); int z = Flip(B,C); if(x == y){ decided[A] = x+1; //taken[x+1]++; A = ++ob; } else if(y == z){ decided[C] = y+1; //taken[y+1]++; C = ++ob; } else{ decided[B] = z+1; //taken[z+1]++; B = ++ob; } } if(A == ob){ int x = Flip(B,C); decided[B] = decided[C] = x+1; } else if(B == ob){ int x = Flip(A,C); decided[A] = decided[C] = x+1; } else{ int x = Flip(A,B); decided[A] = decided[B] = x+1; } for(int i = 1; i <= n; i++){ pii ok = {-1,-1}; for(int j = 0; j < 2*n; j++){ if(decided[j] == i){ if(ok.F == 0) ok.F = j; else{ Answer(ok.F,j,i-1); break; } } } } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...