Submission #1026750

#TimeUsernameProblemLanguageResultExecution timeMemory
1026750ZicrusVision Program (IOI19_vision)C++17
46 / 100
5 ms1240 KiB
#include <bits/stdc++.h> #include "vision.h" using namespace std; typedef long long ll; vector<int> distIdVec(vector<int> xId, int W, int K) { int sameX = add_xor(xId); vector<int> distXId; for (int xOffset = 0; xOffset <= K && xOffset < W; xOffset++) { vector<int> offsetId; for (int xPos = 0; xPos < W - xOffset; xPos++) { offsetId.push_back(add_and({xId[xPos], xOffset == 0 ? sameX : xId[xPos + xOffset]})); } distXId.push_back(add_or(offsetId)); } return distXId; } void construct_network(int H, int W, int K) { vector<int> yId(H); for (int i = 0; i < H; i++) { vector<int> r; for (int j = 0; j < W; j++) { r.push_back(W * i + j); } yId[i] = add_or(r); } vector<int> xId(W); for (int i = 0; i < W; i++) { vector<int> c; for (int j = 0; j < H; j++) { c.push_back(W * j + i); } xId[i] = add_or(c); } vector<int> distXId = distIdVec(xId, W, K); vector<int> distYId = distIdVec(yId, H, K); vector<int> kAtXPosId; for (int x = 0; x <= K && x < distXId.size(); x++) { if (K-x >= distYId.size()) continue; kAtXPosId.push_back(add_and({distXId[x], distYId[K-x]})); } add_or(kAtXPosId); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:40:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |     for (int x = 0; x <= K && x < distXId.size(); x++) {
      |                               ~~^~~~~~~~~~~~~~~~
vision.cpp:41:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |         if (K-x >= distYId.size()) continue;
      |             ~~~~^~~~~~~~~~~~~~~~~
#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...