結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
|
提出日時 | 2019-09-12 09:56:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 931 ms |
コンパイル使用メモリ | 57,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 17:00:31 |
合計ジャッジ時間 | 980 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main() { int n, m; vector<int> v; cin >> n >> m; int curr = n; for (int i = 0; i < m; i++) { int ex1, ex2; cin >> ex1 >> std::ws >> ex2; //cout << ex1 << endl << ex2 << endl; if (curr == ex1) { curr = ex2; } else if (curr == ex2) { curr = ex1; } } cout << curr << endl; return 0; }