답안 #147466

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
147466 2019-08-29T15:34:49 Z Nucleist Vision Program (IOI19_vision) C++14
14 / 100
11 ms 1656 KB
#include <bits/stdc++.h> 
#include "vision.h"
using namespace std; 
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define pb push_back
struct greateri
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};
map<pair<int,int>,int>gg;
void construct_network(int H,int W,int K)
{
  //flash;
  vector<int>cols[W];
  vector<int>rows[H];
  for (int i = 0; i < H; ++i)
  {
     for (int j = 0; j < W; ++j)
     {
       int cell=i*W+j;
       cols[j].pb(cell);
       rows[i].pb(cell);
     }
  } 
  int lasto,lasto1;
  bool ka=false,ka1=false;
  vector<int>indexcol;
  for (int i = 0; i < W; ++i)
  {
  	int last = add_xor(cols[i]);
  	indexcol.pb(last);
  }
  vector<int>indexrow;
  for (int i = 0; i < H; ++i)
  {
  	int last = add_xor(rows[i]);
  	indexrow.pb(last);
  }
  vector<int>lasti;
  if(indexcol.size()>=2)
  {
  	ka=true;
  	for (int i = 1; i < indexcol.size(); ++i)
  {
  	vector<int>now;
  	now.pb(indexcol[i]);
  	now.pb(indexcol[i-1]);
  	int yo = add_and(now);
  	lasti.pb(yo);
  }
  int doi = add_or(lasti);
  int kol = add_or(indexrow);
  int zol = add_not(doi);
  vector<int>hey;
  hey.pb(zol),hey.pb(kol);
  int fo = add_or(hey);
  lasto = add_not(fo);}
  if(indexrow.size()>=2)
  {
  	ka1=true;
  	vector<int>lasti1;
  for (int i = 1; i < indexrow.size(); ++i)
  {
  	vector<int>now;
  	now.pb(indexrow[i]);
  	now.pb(indexrow[i-1]);
  	int yo = add_and(now);
  	lasti1.pb(yo);
  }
  int doi1 = add_or(lasti1);
  int kol1 = add_or(indexcol);
  int zol1 = add_not(doi1);
  vector<int>hey1;
  hey1.pb(zol1),hey1.pb(kol1);
  int fo1 = add_or(hey1);
  lasto1 = add_not(fo1);}
  vector<int>result;
  if(ka)
  result.pb(lasto);
  if(ka1)
  result.pb(lasto1);
  int rep = add_or(result);
    //int xo = add_not(doi);
  return;
}
//code the AC sol !
// BS/queue/map

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:50:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int i = 1; i < indexcol.size(); ++i)
                    ~~^~~~~~~~~~~~~~~~~
vision.cpp:69:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 1; i < indexrow.size(); ++i)
                   ~~^~~~~~~~~~~~~~~~~
vision.cpp:89:7: warning: unused variable 'rep' [-Wunused-variable]
   int rep = add_or(result);
       ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 252 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 252 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 252 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 252 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 1656 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 504 KB Output is correct
4 Correct 4 ms 528 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 404 KB Output is correct
7 Correct 7 ms 1016 KB Output is correct
8 Correct 7 ms 888 KB Output is correct
9 Correct 11 ms 1528 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 252 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -