結果

問題 No.3137 Non-Intersect Chord Triangle Game
ユーザー Cafe1942
提出日時 2025-05-01 20:30:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 66,532 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2025-05-01 20:30:55
合計ジャッジ時間 6,216 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int M;
	cin >> M;
	int count[1000001] = { 0 };
	int point[200001] = { 0 };
	int stackLevel = 0;
	for (int i = 1;i <= M;i++) {
		int P, Q;
		cin >> P >> Q;
		if (P > Q) {
			swap(P, Q);
		}
		point[P] = Q;
		point[Q] = P;
	}
	for (int i = 1;i <= N;i++) {
		if (point[i] == 0) {
			count[stackLevel]++;
			continue;
		}
		else if (i < point[i]) {
			stackLevel++;
		}
		else {
			stackLevel--;
		}
	}
	for (int i = 0;i <= M;i++) {
		if (count[i] % 4 == 2) {
			cout << "Akane\n";
			return 0;
		}
	}
	cout << "Aoi";
	return 0;
}
0