제출 #112042

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1120422019-05-17 07:04:31TexTangMemory 2 (JOI16_memory2)C++14
100 / 100
17 ms404 KiB
#include "Memory2_lib.h"
#include <iostream>
#include <vector>
#include <list>
using namespace std;
void Solve(int T, int N){
vector <int> res[N];
srand (time(NULL));
list <int> qe;
for(int i = 0;i < 2*N;i++) qe.push_back(i);
int index = 0, q[3], flipped[2*N][2*N], a = 0, b = 0, c = 0;
for(int i = 0;i < 2*N;i++) for(int j = 0;j < 2*N;j++) flipped[i][j] = 0;
for(int i = 0;i < 3 && i < 2*N;i++){
q[i] = qe.front();
qe.pop_front();
}
while(!qe.empty()){
if(!(a == b && b == c)){
qe.pop_front();
}
if(flipped[q[0]][q[1]]) a = flipped[q[0]][q[1]];
else a = flipped[q[0]][q[1]] = Flip(q[0],q[1]);
if(flipped[q[1]][q[2]]) b = flipped[q[1]][q[2]];
else b = flipped[q[1]][q[2]] = Flip(q[1],q[2]);
if(flipped[q[0]][q[2]]) c = flipped[q[0]][q[2]];
else c = flipped[q[0]][q[2]] = Flip(q[0],q[2]);
if(a == b && b == c){
int o = rand() % 3;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

memory2.cpp: In function 'void Solve(int, int)':
memory2.cpp:13:6: warning: unused variable 'index' [-Wunused-variable]
  int index = 0, q[3], flipped[2*N][2*N], a = 0, b = 0, c = 0;
      ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...