結果

問題 No.26 シャッフルゲーム
ユーザー Onju
提出日時 2015-02-14 05:45:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 58,472 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 20:03:21
合計ジャッジ時間 1,351 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <cstring>
#include <climits>
using namespace std;

int main()
{
	int N, M, P, Q;
	cin >> N >> M;

	int temp[4] = { 0, 0, 0, 0 };
	temp[N] = 1;
	for (int i = 0; i < M; ++i)
	{
		cin >> P >> Q;
		swap(temp[P], temp[Q]);
	}
	
	for (int i = 1; i <= 3;++i)
		if (temp[i])
			cout << i << endl;

	return 0;
}
0