結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
|
提出日時 | 2025-09-20 16:21:30 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 245 bytes |
コンパイル時間 | 2,763 ms |
コンパイル使用メモリ | 275,256 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-20 16:21:34 |
合計ジャッジ時間 | 3,356 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; int M; cin >> M; for(int i = 0; i < M; ++i) { int P, Q; cin >> P >> Q; if(N == P) N = Q; else if(N == Q) N = P; } cout << N << endl; return 0; }