結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
|
提出日時 | 2024-10-15 00:18:17 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 486 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 29,568 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 00:18:19 |
合計ジャッジ時間 | 836 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
//No.26 シャッフルゲーム #include <stdio.h> int main() { int N, M; int c[3] = {0, 0, 0}; scanf("%d", &N); scanf("%d", &M); c[N-1] = 1; int P[M], Q[M]; for(int i=0; i<M; i++){ scanf("%d %d", &P[i], &Q[i]); int tmp = c[P[i]-1]; c[P[i]-1] = c[Q[i]-1]; c[Q[i]-1] = tmp; } for(int i=0; i<3; i++){ if(c[i] == 1){ printf("%d\n", i+1); break; } } return 0; }