結果

問題 No.855 ヘビの日光浴
ユーザー QCFium
提出日時 2020-04-16 17:02:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,139 bytes
コンパイル時間 1,415 ms
コンパイル使用メモリ 166,640 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-01 21:12:12
合計ジャッジ時間 3,924 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 92
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int read_int() {
	int c = getchar(), s = 0, res = 0;
	if (c == '-') s = 1, c = getchar();
	assert('0' <= c && c <= '9');
	if (s) assert(c != '0');
	res = c - '0';
	while (1) {
		c = getchar();
		if (c < '0' || c > '9') break;
		assert(res <= 200000000); // avoid overflow
		res = res * 10 + c - '0';
		assert(res); // no leading-zero
	}
	ungetc(c, stdin);
	return res;
}
void read_linebreak() {
	int c = getchar();
	if (c == '\r') c = getchar();
	assert(c == '\n');
}

int main() {
	int h = read_int();
	assert(getchar() == ' ');
	int w = read_int();
	assert(getchar() == ' ');
	int n = read_int();
	read_linebreak();
	
	assert(1 <= h && h <= 1000000000);
	assert(1 <= w && w <= 1000000000);
	assert(1 <= n && n <= 100000);
	for (int i = 0; i < n; i++) {
		int x = read_int();
		assert(getchar() == ' ');
		int y = read_int();
		assert(getchar() == ' ');
		int l = read_int();
		read_linebreak();
		
		assert(1 <= l && l <= 1000000000);
		if (x == 0 || x == w + 1) assert(1 <= y && y <= h);
		else if (y == 0 || y == h + 1) assert(1 <= x && x <= w);
		else assert(0);
	}
	assert(getchar() == EOF);
	return 0;
}


0