結果
| 問題 |
No.241 出席番号(1)
|
| ユーザー |
vjudge1
|
| 提出日時 | 2024-12-09 00:34:28 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 832 bytes |
| コンパイル時間 | 3,653 ms |
| コンパイル使用メモリ | 279,916 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-12-09 00:34:35 |
| 合計ジャッジ時間 | 5,605 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 1 |
ソースコード
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<> dis(0, 1e9);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> vec(n), arr(n);
for (int &i : arr)
cin >> i;
for (int i = 0; i < n; i++)
vec[i] = i;
for (int k = 0; k < 100; k++) {
shuffle(all(vec), mt);
bool cc = true;
for (int i = 0; i < n; i++) {
if (arr[i] == vec[i])
cc = false;
}
if (cc) {
for (int i = 0; i < n; i++)
cout << vec[i] << '\n';
cout << '\n';
return 0;
}
}
cout << "-1\n";
return 0;
}
vjudge1