結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | 👑 testestest |
提出日時 | 2020-12-01 11:33:24 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 800 ms / 2,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 1,209 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 10,224 KB |
最終ジャッジ日時 | 2024-06-12 09:54:31 |
合計ジャッジ時間 | 34,399 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 44 MLE * 9 RE * 20 WA * 1 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | a[200010]; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | n,k,x,y; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:3:3: warning: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 3 | n,k,x,y; | ^ main.c:3:5: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] 3 | n,k,x,y; | ^ main.c:3:7: warning: type defaults to 'int' in declaration of 'y' [-Wimplicit-int] 3 | n,k,x,y; | ^ main.c:4:1: warning: data definition has no type or storage class 4 | i,j,q; | ^ main.c:4:1: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:4:3: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 4 | i,j,q; | ^ main.c:4:5: warning: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] 4 | i,j,q; | ^ main.c:5:1: warning: return type defaults to 'int' [-Wimplicit-int] 5 | f(m,x,p){ | ^ main.c: In function 'f': main.c:5:1: warning: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:5:1: warning: type of 'x' defaults to 'int' [-Wimplicit-int] main.c:5:1: warning: type of 'p' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:9:1: warning: return type defaults to 'int' [-Wimplicit-int] 9 | main(){ | ^~~~ main.c: In function 'main': main.c:10:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d%d%d%d",&n,&k,&x,&y); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | long dp[1024][1024],sum[1024],ans; main.c:10:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 |
ソースコード
long dp[1024][1024],sum[1024],ans; a[200010]; n,k,x,y; i,j,q; f(m,x,p){ if(m==n/2)dp[x][p]++; else for(int i=0;i<k;i++)if(p!=a[i])f(m+1,x^a[i],a[i]); } main(){ scanf("%d%d%d%d",&n,&k,&x,&y); for(i=0;i<k;i++)scanf("%d",a+i); f(0,0,-1); for(i=0;i<1024;i++)for(j=0;j<1024;j++)sum[i]=(sum[i]+dp[i][j])%998244353; for(i=0;i<1024;i++)for(j=0;j<1024;j++)if((i^j)>=x&(i^j)<=y){ ans=(ans+sum[i]*sum[j])%998244353; for(q=0;q<1024;q++)ans=(ans-dp[i][q]*dp[j][q]); } printf("%d",(ans%998244353+998244353)%998244353); }