結果
| 問題 |
No.241 出席番号(1)
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-07-10 23:43:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 374 bytes |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 39,424 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-08 02:21:26 |
| 合計ジャッジ時間 | 4,617 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 4 WA * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | int n;scanf("%d",&n);long long b[101];
| ~~~~~^~~~~~~~~
main.cpp:10:41: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | for(int i=0;i<n;i++){int a;scanf("%d",&a);b[i]=~(1<<a);v&=b[i];}
| ~~~~~^~~~~~~~~
ソースコード
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int n;scanf("%d",&n);long long b[101];
int v=0;
for(int i=0;i<n;i++){int a;scanf("%d",&a);b[i]=~(1<<a);v&=b[i];}
for(int i=0;i<n;i++){
v^=b[i];
for(int j=0;j<n;j++){
if(v&(1<<j)){
printf("%d\n",j);
v^=(1<<j);
break;
}
}
}
return 0;
}
184