제출 #1064908

#제출 시각아이디문제언어결과실행 시간메모리
1064908TAhmed33Vision Program (IOI19_vision)C++17
33 / 100
73 ms1240 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; //#include "grader.cpp" void construct_network(int H, int W, int K) { auto ind = [&] (int x, int y) -> int { return x * W + y; }; vector <int> z; int cnt = H * W - 1; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { for (int l = 0; l < H; l++) { for (int m = 0; m < W; m++) { if (abs(i - l) + abs(j - m) == K) { if (min(H, W) == 1) { assert(cnt + 1 <= H * W + 9999); } add_and({ind(i, j), ind(l, m)}); z.push_back(++cnt); } } } } } if (min(H, W) == 1) assert(z.size() <= 400); add_or({z[0], z[1]}); cnt++; for (int j = 1; j < z.size(); j++) { assert(cnt + 1 <= H * W + 9999); add_or({cnt++, z[j]}); } }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |  for (int j = 1; j < z.size(); j++) {
      |                  ~~^~~~~~~~~~
#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...