제출 #782245

#제출 시각아이디문제언어결과실행 시간메모리
782245Minindu206동굴 (IOI13_cave)C++14
33 / 100
43 ms408 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int n) { int sw[n], st[n], temp[n]; for(int i=0;i<n;i++) st[i] = 0, sw[i] = -1; int cc = tryCombination(st); for(int i=0;i<n;i++) { int cmb = tryCombination(st), swt = 1; if(cmb == -1) cmb = n; if(cmb > i || cmb == -1) swt = 0; // st[i] = swt; memset(temp, 1 - swt, sizeof(temp)); for(int j=0;j<n;j++) { if(sw[j] != -1) temp[j] = st[j]; } for(int j=0;j<n;j++) { if(sw[j] != -1) continue; temp[j] = swt; cmb = tryCombination(temp); if(cmb > i || cmb == -1) { sw[j] = i; st[j] = swt; break; } temp[j] = 1 - temp[j]; } // for(int j=0;j<n;j++) // cout << st[i] << " "; // cout << '\n'; // for(int j=0;j<n;j++) // cout << sw[i] << " "; // cout << '\n'; } answer(st, sw); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:9: warning: unused variable 'cc' [-Wunused-variable]
    8 |     int cc = tryCombination(st);
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...