結果
問題 | No.241 出席番号(1) |
ユーザー | naimonon77 |
提出日時 | 2016-05-03 22:57:21 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,592 bytes |
コンパイル時間 | 1,299 ms |
コンパイル使用メモリ | 170,684 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-05 06:04:13 |
合計ジャッジ時間 | 3,012 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | WA | - |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 1 ms
6,820 KB |
testcase_10 | AC | 1 ms
6,820 KB |
testcase_11 | AC | 2 ms
6,816 KB |
testcase_12 | AC | 2 ms
6,816 KB |
testcase_13 | AC | 2 ms
6,816 KB |
testcase_14 | AC | 2 ms
6,816 KB |
testcase_15 | AC | 2 ms
6,820 KB |
testcase_16 | AC | 1 ms
6,820 KB |
testcase_17 | WA | - |
testcase_18 | AC | 2 ms
6,820 KB |
testcase_19 | AC | 1 ms
6,820 KB |
testcase_20 | AC | 1 ms
6,816 KB |
testcase_21 | AC | 1 ms
6,816 KB |
testcase_22 | AC | 1 ms
6,816 KB |
testcase_23 | AC | 2 ms
6,820 KB |
testcase_24 | AC | 1 ms
6,816 KB |
testcase_25 | AC | 3 ms
6,820 KB |
testcase_26 | AC | 1 ms
6,820 KB |
testcase_27 | AC | 2 ms
6,816 KB |
testcase_28 | AC | 2 ms
6,820 KB |
testcase_29 | AC | 2 ms
6,820 KB |
testcase_30 | AC | 1 ms
6,820 KB |
testcase_31 | AC | 2 ms
6,820 KB |
コンパイルメッセージ
main.cpp: In function ‘void reader(char&)’: main.cpp:21:31: warning: format ‘%c’ expects argument of type ‘char*’, but argument 2 has type ‘int’ [-Wformat=] 21 | void reader(char &a){scanf(" %c",a);} | ~^ ~ | | | | | int | char* main.cpp: In function ‘void reader(int&)’: main.cpp:18:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | void reader(int &a){scanf("%d",&a);} | ~~~~~^~~~~~~~~ main.cpp: In function ‘void reader(double&)’: main.cpp:19:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | void reader(double &a){scanf("%lf",&a);} | ~~~~~^~~~~~~~~~ main.cpp: In function ‘void reader(char*)’: main.cpp:20:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | void reader(char a[]){scanf("%s",a);} | ~~~~~^~~~~~~~ main.cpp: In function ‘void reader(char&)’: main.cpp:21:27: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | void reader(char &a){scanf(" %c",a);} | ~~~~~^~~~~~~~~ main.cpp: In function ‘void reader(long long int&)’: main.cpp:22:25: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 22 | void reader(ll &a){scanf("%lld",&a);} | ~~~~~^~~~~~~~~~~ main.cpp: In function ‘void reader(long long unsigned int&)’: main.cpp:23:26: warning: ignoring return value of ‘int scanf(const char*, ...)�
ソースコード
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(i=a;i<b;++i) #define rep(i,n) REP(i,0,n) #define ll long long #define ull unsigned ll typedef long double ld; #define SQR(X) ( (X)*(X) ) #define CUBE(X) ( (X)*(X)*(X) ) #define ALL(a) (a).begin(),(a).end() #define ifnot(a) if(not a) #define dump(x) cerr << #x << " = " << (x) << endl using namespace std; void reader(int &a){scanf("%d",&a);} void reader(double &a){scanf("%lf",&a);} void reader(char a[]){scanf("%s",a);} void reader(char &a){scanf(" %c",a);} void reader(ll &a){scanf("%lld",&a);} void reader(ull &a){scanf("%llu",&a);} // void reader(string& a){cin >> a;}; template<class T,class U> void reader(T& t,U& u){reader(t); reader(u);} template<class T,class U,class V> void reader(T& t,U& u,V& v){reader(t); reader(u); reader(v);} void writer(int a,char c) {printf("%d",a); putchar(c);} void writer(ll a,char c) {printf("%lld",a); putchar(c);} void writer(ull a,char c) {printf("%llu",a); putchar(c);} void writer(double a,char c) {printf("%.20lf",a); putchar(c);} void writer(char a[]) {printf("%s",a);}; void writer(char a[],char c) {printf("%s",a);putchar(c);}; void writer(char a,char c) {putchar(a); putchar(c);}; template<class T>void writerLn(T t){writer(t,'\n');} template<class T,class U>void writerLn(T t,U u){writer(t,' ');writer(u,'\n');} template<class T,class U,class V> void writerLn(T t,U u,V v){writer(t,' ');writer(u,' ');writer(v,'\n');} template<class T> void writerArr(T x[], int n){int i;if(!n){putchar('\n');return;}rep(i,n-1) writer(x[i],' ');writer(x[n-1],'\n');} template<class T> void writerVec(vector<T> x){int n=x.size();int i;if(!n){putchar('\n');return;}rep(i,n-1) writer(x[i],' ');writer(x[n-1],'\n');} vector<string> split(const string &str, char sep){vector<string> v;stringstream ss(str);string buffer;while(getline(ss,buffer,sep)){v.push_back(buffer);}return v;} // #define int ll bool test = 1; int dx[] = {0,0,1,-1}; int dy[] = {1,-1,0,0}; #define MAX 300000 //..................... ll mod = (int)1e9+7; int A[50]; signed main() { int i,j,k; int N; set<int> s; cin >> N; rep(i,N) { reader(A[i]); s.insert(A[i]); } if(s.size() == 1) { puts("-1"); return 0; } set<int> s2; vector<int> v(N); rep(i,N) { rep(j,500) { int a = rand()%N; if(a == A[i]) continue; if(s2.find(a) != s2.end()) continue; s2.insert(a); v[i] = a; break; } if(j==500) { i = -1; s2.clear(); } } rep(i,v.size()) { printf("%d\n",v[i]); } return 0; }