Submission #975482

# Submission time Handle Problem Language Result Execution time Memory
975482 2024-05-05T09:40:22 Z NemanjaSo2005 Vision Program (IOI19_vision) C++17
0 / 100
9 ms 1496 KB
#include "vision.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int N,M,K;
vector<int> bigor;
int getbit(int x,int y){
   return (x-1)*M+(y-1);
}
vector<int> getd(int x,int y,int dx,int dy){
   vector<int> V;
   while(x<=N and y<=M and x>=1 and y>=1){
     // cout<<x<<" "<<y<<endl;
      V.push_back(getbit(x,y));
      x+=dx;
      y+=dy;
   }
   return V;
}
int dva1(vector<int> V){
   int x=add_xor(V);
   int orr=add_or(V);
   int nx=add_not(x);
   return add_and({orr,nx});
}
void construct_network(int h, int w, int k){
	N=h;
	M=w;
	K=k;
	vector<int> D1,D2;
	for(int j=1;j<=M;j++)
      D1.push_back(add_or(getd(1,j,1,-1)));
   for(int i=2;i<=N;i++)
      D1.push_back(add_or(getd(i,M,1,-1)));

   for(int i=N;i>=2;i--)
      D2.push_back(add_or(getd(i,1,1,1)));
   for(int j=1;j<=M;j++)
      D2.push_back(add_or(getd(1,j,1,1)));

   cout<<"OVDE"<<endl;

   vector<int> tk1,bk1;
   for(int i=0;i+K<D1.size();i++){
      tk1.push_back(add_and({D1[i],D1[i+K]}));
      vector<int> V;
      for(int j=i;j<=i+K;j++)
         V.push_back(D1[j]);
      bk1.push_back(dva1(V));
   }
   int xor1=add_xor(D1);
   bk1.push_back(xor1);
   int b1=add_or(bk1),t1=add_or(tk1);


   vector<int> tk2,bk2;
   for(int i=0;i+K<D2.size();i++){
      tk2.push_back(add_and({D2[i],D2[i+K]}));
      vector<int> V;
      for(int j=i;j<=i+K;j++)
         V.push_back(D2[j]);
      bk2.push_back(dva1(V));
   }
   int xor2=add_xor(D2);
   bk2.push_back(xor2);
   int b2=add_or(bk2),t2=add_or(tk2);

   int aaa=add_and({b1,b2});
   int bbb=add_or({t1,t2});
   add_and({aaa,bbb});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:44:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |    for(int i=0;i+K<D1.size();i++){
      |                ~~~^~~~~~~~~~
vision.cpp:57:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |    for(int i=0;i+K<D2.size();i++){
      |                ~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 604 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 1496 KB secret mismatch
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB secret mismatch
2 Halted 0 ms 0 KB -