結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
nablaenergy_21
|
| 提出日時 | 2015-04-25 01:20:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 672 ms |
| コンパイル使用メモリ | 23,168 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 01:37:38 |
| 合計ジャッジ時間 | 1,485 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 RE * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d",&N);
| ~~~~~^~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&A[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
int N;
int A[5000];
int P[16384],i,j,ans;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
for(i=0;i<16384;i++){
P[i] = 0;
}
P[0] = 1;
for(i=0;i<N;i++){
if(P[A[i]] == 0){
for(j=0;j<16384;j++){
if(P[j] == 1){
P[A[i]^j] =1;
}
}
}
}
ans = 0;
for(i=0;i<16384;i++){
if(P[i] == 1){
ans++;
}
}
printf("%d\n",ans);
}
nablaenergy_21