Submission #524312


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> X, Y;
bool f(int i) {
	if (i%2 == 0) return true;
	if (X[i-1] == X[i+1] || Y[i-1] == Y[i+1]) return true;
	if (X[0] == X[N-1] || Y[0] == Y[N-1]) return true;
	if (X[i-1] == X[N-1] || Y[i-1] == Y[N-1]) return true;
	if (X[i+1] == X[0] || Y[i+1] == Y[0]) return true;
	return false;
}
int main() {
	cin >> N;
	N = 2*N + 1;
	X.resize(N);
	Y.resize(N);
	for (int i = 0; i < N; ++ i) cin >> X[i] >> Y[i];
	for (int i = 0; i < N; ++ i) {
		if (f(i)) {
			cout << "OK" << endl;
		} else {
			cout << "NG" << endl;
		}
	}
}

Submission Info

Submission Time
Task D - みんな仲良し高橋君
User hasi
Language C++11 (GCC 4.9.2)
Score 0
Code Size 607 Byte
Status
Exec Time 837 ms
Memory 2460 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0.txt, example_1.txt, example_2.txt
Subtask1 0 / 30 bone_bubun_0.txt, bone_bubun_1.txt, bone_bubun_2.txt, komakai_bubun_0.txt, komakai_bubun_1.txt, komakai_bubun_2.txt, maxrand_bubun_0.txt, maxrand_bubun_1.txt, random_bubun_0.txt, random_bubun_1.txt, smallrand_bubun_0.txt, smallrand_bubun_1.txt, smallrand_bubun_2.txt, square_bubun_0.txt, square_bubun_1.txt
All 0 / 70 bone_0.txt, bone_1.txt, bone_2.txt, bone_bubun_0.txt, bone_bubun_1.txt, bone_bubun_2.txt, example_0.txt, example_1.txt, example_2.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, komakai_0.txt, komakai_1.txt, komakai_2.txt, komakai_bubun_0.txt, komakai_bubun_1.txt, komakai_bubun_2.txt, maxrand_0.txt, maxrand_1.txt, maxrand_bubun_0.txt, maxrand_bubun_1.txt, random_0.txt, random_1.txt, random_bubun_0.txt, random_bubun_1.txt, renket_0.txt, renket_1.txt, smallrand_0.txt, smallrand_1.txt, smallrand_bubun_0.txt, smallrand_bubun_1.txt, smallrand_bubun_2.txt, square_0.txt, square_1.txt, square_bubun_0.txt, square_bubun_1.txt, supersmall_0.txt, supersmall_1.txt, threeren_0.txt, threeren_1.txt, treebase_0.txt, treebase_1.txt, treebase_2.txt, example_0.txt, example_1.txt, example_2.txt
Case Name Status Exec Time Memory
bone_0.txt 657 ms 2332 KB
bone_1.txt 782 ms 2336 KB
bone_2.txt 647 ms 2456 KB
bone_bubun_0.txt 224 ms 1316 KB
bone_bubun_1.txt 42 ms 844 KB
bone_bubun_2.txt 293 ms 1428 KB
example_0.txt 26 ms 804 KB
example_1.txt 26 ms 808 KB
example_2.txt 26 ms 796 KB
handmade_0.txt 26 ms 808 KB
handmade_1.txt 24 ms 924 KB
handmade_2.txt 26 ms 800 KB
handmade_3.txt 26 ms 916 KB
komakai_0.txt 731 ms 2348 KB
komakai_1.txt 744 ms 2336 KB
komakai_2.txt 657 ms 2340 KB
komakai_bubun_0.txt 655 ms 2448 KB
komakai_bubun_1.txt 700 ms 2344 KB
komakai_bubun_2.txt 667 ms 2340 KB
maxrand_0.txt 682 ms 2332 KB
maxrand_1.txt 748 ms 2460 KB
maxrand_bubun_0.txt 837 ms 2344 KB
maxrand_bubun_1.txt 780 ms 2340 KB
random_0.txt 50 ms 808 KB
random_1.txt 461 ms 1700 KB
random_bubun_0.txt 50 ms 792 KB
random_bubun_1.txt 232 ms 1312 KB
renket_0.txt 734 ms 2456 KB
renket_1.txt 669 ms 2448 KB
smallrand_0.txt 25 ms 924 KB
smallrand_1.txt 29 ms 848 KB
smallrand_bubun_0.txt 25 ms 916 KB
smallrand_bubun_1.txt 25 ms 924 KB
smallrand_bubun_2.txt 25 ms 924 KB
square_0.txt 634 ms 2204 KB
square_1.txt 690 ms 2328 KB
square_bubun_0.txt 778 ms 2212 KB
square_bubun_1.txt 547 ms 1948 KB
supersmall_0.txt 26 ms 796 KB
supersmall_1.txt 26 ms 924 KB
threeren_0.txt 662 ms 2456 KB
threeren_1.txt 696 ms 2460 KB
treebase_0.txt 540 ms 1952 KB
treebase_1.txt 143 ms 1176 KB
treebase_2.txt 523 ms 1812 KB