結果

問題 No.26 シャッフルゲーム
ユーザー piniky
提出日時 2015-09-03 00:35:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 65,236 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-18 21:49:53
合計ジャッジ時間 1,085 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#define REP(i,n) for (int i=0;i<(n);i++)

using namespace std;

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

	REP(i, M){
		cin >> P >> Q;
		if (N == P) N = Q;
	}

	cout << N << endl;
	return 0;
}
0