結果
| 問題 |
No.1024 Children in a Row
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2020-03-05 18:20:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 584 bytes |
| コンパイル時間 | 636 ms |
| コンパイル使用メモリ | 77,200 KB |
| 実行使用メモリ | 14,008 KB |
| 最終ジャッジ日時 | 2024-09-14 06:46:09 |
| 合計ジャッジ時間 | 8,608 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 TLE * 1 -- * 19 |
ソースコード
#include <cstdio>
#include <vector>
#include <algorithm>
#include <random>
using namespace std;
int n, m;
int a[200020], b[200020], k[200020];
int main()
{
scanf("%d %d", &n, &m);
for(int i=0; i<m; i++) scanf("%d %d %d", &a[i], &b[i], &k[i]);
for(int l=0; l<m; l++){
vector<int> v(n);
iota(v.begin(), v.end(), 1);
for(int i=0; i<m; i++){
if(l==i) continue;
vector<int> tmp;
for(int j=0; j<n; j++){
if(v[j]==a[i]) continue;
tmp.push_back(v[j]);
if(v[j]==b[i]) tmp.push_back(a[i]);
}
swap(v, tmp);
}
printf("%d\n", v[k[l]-1]);
}
return 0;
}
chocorusk