Submission #205390

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2053902020-02-28 18:41:22my99nVision Program (IOI19_vision)C++14
12 / 100
15 ms1272 KiB
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
int h, w;
int order (int x, int y) { return x*w+y; }
// void print (vector<int> v) { for (auto x : v) cerr << x << ' '; cerr << endl;}
void construct_network(int H, int W, int K) {
h=H; w=W;
vector<int> firstor, secondor, _and;
for (int i = 0; i < H+W-1; i++) {
vector<int> v1, v2;
for (int j = 0; j < min(i+1, W); j++) {
if (!(i-j >= H or j >= W)) v1.push_back(order(i-j, j));
if (!(i-j >= H or W-1-j >= W)) v2.push_back(order(i-j, W-1-j));
}
// cerr << "print1 "; print(v1);
// cerr << "print2 "; print(v2);
firstor.push_back(add_or(v1));
secondor.push_back(add_or(v2));
}
for (int i = 0; i < firstor.size(); i++) {
if (i+K >= firstor.size()) break;
_and.push_back(add_and({firstor[i], firstor[i+K]}));
_and.push_back(add_and({secondor[i], secondor[i+K]}));
}
int ans = add_or(_and);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:22:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < firstor.size(); i++) {
                  ~~^~~~~~~~~~~~~~~~
vision.cpp:23:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (i+K >= firstor.size()) break;
       ~~~~^~~~~~~~~~~~~~~~~
vision.cpp:27:6: warning: unused variable 'ans' [-Wunused-variable]
  int ans = add_or(_and);
      ^~~
#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...