結果

問題 No.26 シャッフルゲーム
ユーザー tntan
提出日時 2015-12-15 07:05:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 69,456 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 13:01:52
合計ジャッジ時間 1,111 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<fstream>
#include<iomanip>
#include<vector>
#include<cctype>
#include<algorithm>
#include<sstream>
using namespace std;

int main()
{
	int f, n, a, b, t[3] = {};
	cin >> f;
	t[f - 1] = 1;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b;
		swap(t[a - 1], t[b - 1]);
	}
	for (int i = 0; i < 3; i++)
	{
		if (t[i])cout << i + 1 << endl;
	}
	return 0;
}
0