結果

問題 No.26 シャッフルゲーム
ユーザー Maeda
提出日時 2025-03-07 15:08:54
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 24,704 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-07 15:08:56
合計ジャッジ時間 1,092 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

void main(void){
	int target = 0;
	int input = scanf("%d\n",&target);
	int shuffle = 0;
	int shuffleList[2];
	input = scanf("%d\n",&shuffle);
	for(int i = 0 ; i < shuffle ; i++){
		input = scanf("%d %d\n",&shuffleList[0],&shuffleList[1]);
		if(shuffleList[0] == target){
			target = shuffleList[1];
		}else if(shuffleList[1] == target){
			target = shuffleList[0];
		}
	}
	printf("%d",target);
}
0