Submission #630571

#TimeUsernameProblemLanguageResultExecution timeMemory
630571lucriMemory (IOI10_memory)C++17
100 / 100
3 ms280 KiB
#include "memory.h" #include "grader.h" #include <stdio.h> #include <stdlib.h> /* 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]; } */ int poz[30][2]; void play() { for(int i=1;i<=50;++i) { int z=faceup(i); z-='A'; if(poz[z][0]) poz[z][1]=i; else poz[z][0]=i; } for(int i=0;i<25;++i) { faceup(poz[i][0]); faceup(poz[i][1]); } return; } /* 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...