結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-21 17:46:44 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 398µs | |
| コード長 | 592 bytes |
| 記録 | |
| コンパイル時間 | 415 ms |
| コンパイル使用メモリ | 88,240 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-31 19:01:29 |
| 合計ジャッジ時間 | 1,437 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max,count
#include <string> //string,getline, to_string
#include <cstdlib> //abs(int)
#include <utility> //swap, pair
#include <deque> //deque
#include <climits> //INT_MAX
#include <bitset> //bitset
using namespace std;
int main() {
vector<int> A(4);
int N;
cin >> N;
A[N]++;
int M;
cin >> M;
for (int i = 0; i < M; i++) {
int p, q;
cin >> p >> q;
swap(A[p], A[q]);
}
for (int i = 1; i < 4; i++) {
if (A[i] == 1) {
cout << i << endl;
break;
}
}
return 0;
}