Submission #1031590

#TimeUsernameProblemLanguageResultExecution timeMemory
1031590Marco_EscandonVision Program (IOI19_vision)C++17
26 / 100
7 ms2260 KiB
#include<bits/stdc++.h> #include "vision.h" using namespace std; typedef int ll; void construct_network(int H, int W, int K) { vector<vector<ll>> ia(H+W-1), da(H+W-1); vector<ll>iaor,daor; for(int i=0; i<H; i++){ for(int j=0; j<W; j++){ ia[i+j].push_back(i*W+j); da[i-j+W-1].push_back(i*W+j); } } for(auto i:ia) if(i.size()>0) iaor.push_back(add_or(i)); for(auto i:da) if(i.size()>0) daor.push_back(add_or(i)); vector<ll> asd1; for(int i=0; i<iaor.size()-K; i++) { vector<int> sub_vector(iaor.begin() + i, iaor.begin() + i+K+1); ll a=add_xor(sub_vector); ll b=add_not(a); ll c=add_or(sub_vector); asd1.push_back(add_and({b,c})); } vector<ll> asd2; for(int i=0; i<daor.size()-K; i++) { vector<int> sub_vector(daor.begin() + i, daor.begin() + i+K+1); ll a=add_xor(sub_vector); ll b=add_not(a); ll c=add_or(sub_vector); asd2.push_back(add_and({b,c})); } ll bsk_1=add_and({add_or(asd1),add_or(asd2)}); asd1.clear(); for(int i=0; i<iaor.size()-K+1; i++) { vector<int> sub_vector(iaor.begin() + i, iaor.begin() + i+K); ll a=add_xor(sub_vector); ll b=add_not(a); ll c=add_or(sub_vector); asd1.push_back(add_and({b,c})); } asd2.clear(); for(int i=0; i<daor.size()-K+1; i++) { vector<int> sub_vector(daor.begin() + i, daor.begin() + i+K); ll a=add_xor(sub_vector); ll b=add_not(a); ll c=add_or(sub_vector); asd2.push_back(add_and({b,c})); } ll bsk_2=add_and({add_or(asd1),add_or(asd2)}); ll ans=add_and({bsk_1,add_not(bsk_2)}); }

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(int i=0; i<iaor.size()-K; i++)
      |               ~^~~~~~~~~~~~~~
vision.cpp:26:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |  for(int i=0; i<daor.size()-K; i++)
      |               ~^~~~~~~~~~~~~~
vision.cpp:36:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |  for(int i=0; i<iaor.size()-K+1; i++)
      |               ~^~~~~~~~~~~~~~~~
vision.cpp:45:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |  for(int i=0; i<daor.size()-K+1; i++)
      |               ~^~~~~~~~~~~~~~~~
vision.cpp:54:5: warning: unused variable 'ans' [-Wunused-variable]
   54 |  ll ans=add_and({bsk_1,add_not(bsk_2)});
      |     ^~~
#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...