답안 #210322

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
210322 2020-03-17T04:01:19 Z Segtree Vision Program (IOI19_vision) C++14
12 / 100
37 ms 1272 KB
#include "vision.h"
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<cassert>
#include<stack>
#include<fstream>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

void construct_network(int H, int W, int K) {
	vector<int> Ns;
	int T=H+W-1;
	for(int s=0;s<T;s++){
		Ns.clear();
		rep(i,H)rep(j,W)if(i+j==s)Ns.push_back(i*W+j);
		add_or(Ns);
	}
	for(int s=0;s<T;s++){
		Ns.clear();
		rep(i,H)rep(j,W)if(i-j+W-1==s)Ns.push_back(i*W+j);
		add_or(Ns);
	}
	for(int s=0;s+K<T;s++){
		Ns.clear();
		Ns={H*W+s,H*W+s+K};
		add_and(Ns);
	}
	int qid;
	for(int s=0;s+K<T;s++){
		Ns.clear();
		Ns={H*W+T+s,H*W+T+s+K};
		qid=add_and(Ns);
	}
	Ns.clear();
	for(int s=H*W+2*T;s<=qid;s++)Ns.push_back(s);
	add_or(Ns);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:45:21: warning: 'qid' may be used uninitialized in this function [-Wmaybe-uninitialized]
  for(int s=H*W+2*T;s<=qid;s++)Ns.push_back(s);
                    ~^~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Incorrect 5 ms 256 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Incorrect 5 ms 256 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Incorrect 5 ms 256 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Incorrect 5 ms 256 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 6 ms 492 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 376 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 376 KB Output is correct
12 Correct 5 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 376 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 376 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 376 KB Output is correct
19 Correct 5 ms 380 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 256 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 368 KB Output is correct
3 Correct 7 ms 376 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
5 Correct 6 ms 376 KB Output is correct
6 Correct 6 ms 376 KB Output is correct
7 Correct 6 ms 376 KB Output is correct
8 Correct 8 ms 504 KB Output is correct
9 Correct 8 ms 504 KB Output is correct
10 Correct 8 ms 508 KB Output is correct
11 Correct 8 ms 504 KB Output is correct
12 Correct 8 ms 504 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 364 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 376 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 5 ms 380 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 20 ms 760 KB Output is correct
21 Incorrect 20 ms 760 KB on inputs (0, 0), (199, 99), expected 0, but computed 1
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 37 ms 1272 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Incorrect 5 ms 256 KB on inputs (0, 2), (1, 0), expected 0, but computed 1
8 Halted 0 ms 0 KB -