답안 #516627

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
516627 2022-01-21T16:40:33 Z DanerZein Vision Program (IOI19_vision) C++14
14 / 100
8 ms 1268 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
int pos[210][210];
void construct_network(int H, int W, int K) {
  int id=0;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      pos[i][j]=id++;
    }
  }
  vector<int> qu; 
  int a;
  for(int i=0;i<H;i++){
    qu.clear();
    for(int j=0;j<W;j++){
      qu.push_back(pos[i][j]);
    }
    a=add_or(qu);
  }
  int b;
  for(int i=0;i<W;i++){
    qu.clear();
    for(int j=0;j<H;j++){
      qu.push_back(pos[j][i]);
    }
    b=add_or(qu);
  }
  int q;
  vector<int> imp;
  qu.clear();
  for(int i=H*W;i<=a;i++){
    qu.push_back(i);
  }
  q=add_xor(qu);
  qu.clear();
  for(int i=a+1;i<=b;i++){
    qu.push_back(i);
  }
  q=add_xor(qu);
  qu.clear(); qu={q,q-1};
  imp.push_back(add_or(qu));
  int r;
  int l=H*W;
  for(int i=0;i<H-1;i++){
    qu.clear(); qu={l,l+1};
    r=add_and(qu);
    l++;
  }
  l=a+1;
  for(int j=0;j<W-1;j++){
    qu.clear(); qu={l,l+1};
    r=add_and(qu);
    l++;
  }
  qu.clear();
  for(int i=q+2;i<=r;i++){
    qu.push_back(i);
  }
  imp.push_back(add_or(qu));
  q=add_and(imp);
  return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:13:7: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |   int a;
      |       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Incorrect 1 ms 276 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 352 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 1268 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 1 ms 460 KB Output is correct
4 Correct 2 ms 432 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 1 ms 436 KB Output is correct
7 Correct 5 ms 844 KB Output is correct
8 Correct 5 ms 720 KB Output is correct
9 Correct 8 ms 1264 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -