Submission #1031599

#TimeUsernameProblemLanguageResultExecution timeMemory
1031599Marco_EscandonVision Program (IOI19_vision)C++17
26 / 100
10 ms2264 KiB
#include<bits/stdc++.h> #include "vision.h" using namespace std; typedef int ll; ll sol(ll k, vector<ll> a, vector<ll> b) { vector<ll> temp1, temp2; for(int i=0; i<=a.size()-k; i++) { vector<ll> sub_vectora(a.begin() + i, a.begin() + i+k); vector<ll> sub_vectorb(b.begin() + i, b.begin() + i+k); temp1.push_back(add_and({add_not(add_xor(sub_vectora)),add_or(sub_vectora)})); temp2.push_back(add_and({add_not(add_xor(sub_vectorb)),add_or(sub_vectorb)})); } return add_and({add_or(temp1),add_or(temp2)}); } 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)); ll ans=add_and({sol(K+1,iaor,daor),add_not(sol(K,iaor,daor))}); }

Compilation message (stderr)

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