제출 #1153158

#제출 시각아이디문제언어결과실행 시간메모리
1153158papannnMemory (IOI10_memory)C++20
0 / 100
0 ms408 KiB
#include "grader.h" #include "memory.h" #include <iostream> #include <string.h> using namespace std; void play() { int i; char a, b; int memo[25]; memset(memo, -1, sizeof(memo)); bool open = false; char prev; int move = 0; for (int i = 1; i <= 50; i+=2) { char c1 = faceup(i); // cout << endl; // cout << c1 << endl; // cout << i << endl; if (memo[c1 - 'A'] != -1) { // Check prev card // cout << "MEMO " << endl; faceup(memo[c1 - 'A']); i--; } else { memo[c1 - 'A'] = i; char c2 = faceup(i + 1); // cout << c2 << endl; // cout << i + 1 << endl; if (c1 != c2) { memo[c2 - 'A'] = i + 1; } else { } } } // for (int i = 1; i <= 50; i++) { // // open = !open; // move++; // char c = faceup(i); // cout << "JOKO" << endl; // cout << endl << endl; // for (int k = 0; k < 25; k++) { // if (memo[k] != -1) { // char t = k + 'A'; // cout << t; // } else { // cout << " "; // } // } // cout << endl; // cout << c << endl; // if (move % 2 == 1) { // prev = c; // cout << 1 << endl; // cout << "i: " << i << endl; // if (memo[c - 'A'] == -1) { // No Memory // cout << 1.1 << endl; // cout << "i: " << i << endl; // memo[c - 'A'] = i; // Save to memory for future use // } else { // cout << 1.2 << endl; // cout << "i: " << i << endl; // cout << memo[c - 'A'] << endl; // char c = faceup(memo[c - 'A']); // Use memory // move++; // cout << "JOKO" << endl; // cout << c << endl; // open = !open; // State to close // } // } else { // cout << 2 << endl; // if (prev == c) { // cout << 2.1 << endl; // cout << "i: " << i << endl; // continue; // Do nothing // } // if (memo[c - 'A'] == -1) { // No memory // cout << 2.2 << endl; // cout << "i: " << i << endl; // memo[c - 'A'] = i; // Save to memory for future use // } else { // cout << 2.3 << endl; // cout << "i: " << i << endl; // open = !open; // char c = faceup(i); // move++; // cout << "JOKO" << endl; // cout << c << endl; // open = !open; // c = faceup(memo[c - 'A']); // move++; // cout << "JOKO" << endl; // cout << c << endl; // } // } // } // for (int i = 1 ; i <= 50; i++) { // // cout << endl << endl; // // cout << i << endl; // char c = faceup(i); // // cout << c << endl; // open = !open; // // cout << "OPEN:" << open << endl; // if (!open) { // prev = c; // // cout << c << endl; // if (memo[c - 'A'] != -1) { // // cout << memo[c-'A'] << endl; // faceup(memo[c - 'A']); // open = !open; // } else { // memo[c - 'A'] = i; // } // } else { // // cout << c << endl; // if (prev == c) { // continue; // } else { // if (memo[c - 'A'] != -1) { // // cout << memo[c-'A'] << endl; // faceup(c - 'A'); // // cout << i << endl; // faceup(i); // } else { // memo[c - 'A'] = i; // } // } // } // } // for (int i = 0 ; i < 25; i++) { // char c = i + 'A'; // cout << c << ": " << memo[i] << endl; // } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...