제출 #552536

#제출 시각아이디문제언어결과실행 시간메모리
552536PiejanVDCVision Program (IOI19_vision)C++17
8 / 100
1 ms320 KiB
#include<bits/stdc++.h> using namespace std; #include "vision.h" void construct_network(int H, int W, int K) { auto valid = [&] (int x, int y) -> bool { return x >= 0 && x < H && y >= 0 && y < W; }; int last = H * W; int ans = 0; set<pair<pair<int,int>,pair<int,int>>>s; for(int i = 0 ; i < H ; i++) { for(int j = 0 ; j < W ; j++) { int cnt = 0; for(int k = 0 ; k < H ; k++) { int idx = K - abs(i-k); if(idx < 0) continue; if(idx == 0) cnt++; if(cnt == 2) break; if(valid(k, j + idx)) { if(s.count({{i,j},{k, j+idx}}) || s.count({{k, j+idx}, {i,j}})) continue; s.insert({{i,j},{k, j+idx}}); add_and({(i)*W + j, (k)*W + j + idx}); last++; } } break; } break; } vector<int>R; for(int i = H*W ; i < last ; i++) R.push_back(i); add_or(R); }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:13:9: warning: unused variable 'ans' [-Wunused-variable]
   13 |     int ans = 0;
      |         ^~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...