結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
![]() |
提出日時 | 2015-04-25 01:23:20 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 413 bytes |
コンパイル時間 | 254 ms |
コンパイル使用メモリ | 23,424 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 01:51:00 |
合計ジャッジ時間 | 877 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
コンパイルメッセージ
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*2],i,j,ans; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(i=0;i<16384*2;i++){ P[i] = 0; } P[0] = 1; for(i=0;i<N;i++){ if(P[A[i]] == 0){ for(j=0;j<16384*2;j++){ if(P[j] == 1){ P[A[i]^j] =1; } } } } ans = 0; for(i=0;i<16384*2;i++){ if(P[i] == 1){ ans++; } } printf("%d\n",ans); }