結果

問題 No.241 出席番号(1)
ユーザー vjudge1vjudge1
提出日時 2023-12-08 21:39:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 1,595 ms
コンパイル使用メモリ 172,012 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-08 21:39:43
合計ジャッジ時間 3,450 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 1 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 2 ms
6,676 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
static inline void solve(){
	int n;cin>>n;
	vector<int> v(n),v1(n);
	for(int i=0;i<n;i++){
		v1[i]=i;
	}
	for(int i=0,k;i<n;i++){
		cin>>k;v[i]=k;
	}
	bool f1=0;
	for(int i=0;i<10;i++){
		shuffle(v1.begin(),v1.end(),mt);
		bool f=0;
		for(int i=0;i<n;i++){
			if(v[i]==v1[i])
				f=1;
		}
		if(!f)
			{f1=1;break;}
	}
	if(!f1){
		cout<<-1<<endl;
		}
	else{	
	for(auto i:v1)
		cout<<i<<endl;
	}
}
signed main(){
	solve();
}//:huh:
0