제출 #1154477

#제출 시각아이디문제언어결과실행 시간메모리
1154477PacybwoahVision Program (IOI19_vision)C++20
0 / 100
78 ms66136 KiB
#include "vision.h" #include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<cassert> using namespace std; // i * W + j void construct_network(int h, int w, int k) { vector<int> ask; vector<pair<int, int>> poss; auto get = [&](int i, int j){ return i * w + j; }; for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ for(int r = 0; r < h; r++){ int left = k - abs(i - r); if(j - left >= 0){ int a = get(i, j), b = get(r, j - left); if(a < b) poss.emplace_back(a, b); } if(j + left < w){ int a = get(i, j), b = get(r, j + left); if(a < b) poss.emplace_back(a, b); } } } } int now; assert((int)poss.size() > 0); for(auto &[a, b]: poss){ ask = {a, b}; now = add_and(ask); } vector<int>().swap(ask); for(int i = h * w; i <= now; i++) ask.push_back(i); add_or(ask); return; } // g++ -std=c++17 -Wall -Wextra -Wshadow -fsanitize=undefined -fsanitize=address -o run grader.cpp vision.cpp
#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...