Submission #1028199

#TimeUsernameProblemLanguageResultExecution timeMemory
1028199TobMemory (IOI10_memory)C++14
100 / 100
1 ms596 KiB
#include <bits/stdc++.h> #include "grader.h" #include "memory.h" #define F first #define S second #define all(x) x.begin(), x.end() #define pb push_back #define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) using namespace std; typedef long long ll; typedef pair <ll, ll> pii; /* static char card[51]; static int up[2], is_up[51], candy[25], candies, moves; char faceup(int C){ int c0, c1; if (C < 1 || C > 50 || is_up[C]) { exit(92); } is_up[C] = 1; up[moves%2] = C; moves++; if (moves%2 == 0) { c0 = card[ up[0] ] - 'A'; c1 = card[ up[1] ] - 'A'; if (c0==c1 && !candy[c0]) { candy[c0] = 1; ++candies; } is_up[ up[0] ] = is_up[ up[1] ] = 0; } return card[C]; }*/ //---------- void play() { vector <int> v[25]; for (int i = 0; i < 50; i++) v[faceup(i+1)-'A'].pb(i); for (int i = 0; i < 25; i++) for (int j = 0; j < 2; j++) faceup(v[i][j]+1); } //---------- /* void playgame(){ int i; for (i=1;i<=50;i++) { card[i] = getchar(); } moves = candies = 0; play(); if (candies != 25) { exit(91); } } int main(){ playgame(); printf("OK %d\n",moves); return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...