結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー 👑 testestesttestestest
提出日時 2020-12-01 11:41:51
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 818 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 29,952 KB
実行使用メモリ 10,248 KB
最終ジャッジ日時 2024-06-12 09:56:05
合計ジャッジ時間 22,947 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,812 KB
testcase_01 AC 11 ms
6,940 KB
testcase_02 AC 234 ms
6,940 KB
testcase_03 AC 782 ms
6,940 KB
testcase_04 AC 818 ms
9,084 KB
testcase_05 AC 291 ms
8,576 KB
testcase_06 AC 789 ms
6,944 KB
testcase_07 AC 368 ms
8,696 KB
testcase_08 AC 136 ms
9,856 KB
testcase_09 AC 434 ms
8,700 KB
testcase_10 AC 53 ms
8,692 KB
testcase_11 AC 179 ms
8,828 KB
testcase_12 AC 466 ms
8,692 KB
testcase_13 AC 127 ms
8,332 KB
testcase_14 AC 485 ms
10,100 KB
testcase_15 AC 108 ms
8,440 KB
testcase_16 AC 564 ms
8,448 KB
testcase_17 AC 627 ms
10,100 KB
testcase_18 AC 408 ms
8,572 KB
testcase_19 AC 205 ms
8,184 KB
testcase_20 AC 59 ms
8,048 KB
testcase_21 AC 122 ms
10,116 KB
testcase_22 AC 642 ms
8,708 KB
testcase_23 AC 671 ms
8,828 KB
testcase_24 AC 337 ms
8,964 KB
testcase_25 AC 283 ms
6,944 KB
testcase_26 AC 52 ms
9,484 KB
testcase_27 AC 378 ms
10,232 KB
testcase_28 AC 135 ms
10,248 KB
testcase_29 AC 431 ms
9,100 KB
testcase_30 AC 52 ms
6,944 KB
testcase_31 AC 173 ms
6,944 KB
testcase_32 AC 482 ms
10,000 KB
testcase_33 AC 126 ms
8,080 KB
testcase_34 AC 485 ms
10,104 KB
testcase_35 AC 28 ms
8,072 KB
testcase_36 AC 137 ms
7,952 KB
testcase_37 AC 529 ms
7,948 KB
testcase_38 AC 380 ms
6,940 KB
testcase_39 AC 94 ms
6,944 KB
testcase_40 AC 662 ms
8,208 KB
testcase_41 AC 784 ms
6,940 KB
testcase_42 AC 456 ms
8,324 KB
testcase_43 AC 553 ms
8,068 KB
testcase_44 AC 493 ms
8,084 KB
04_evil_A_01 RE -
04_evil_A_02 RE -
04_evil_A_03 RE -
04_evil_A_04 RE -
04_evil_A_05 RE -
04_evil_A_06 RE -
04_evil_A_07 RE -
04_evil_A_08 RE -
04_evil_A_09 RE -
04_evil_A_10 RE -
05_evil_B_01 RE -
05_evil_B_02 RE -
05_evil_B_03 RE -
05_evil_B_04 RE -
05_evil_B_05 RE -
05_evil_B_06 RE -
05_evil_B_07 RE -
05_evil_B_08 RE -
05_evil_B_09 RE -
05_evil_B_10 RE -
06_evil_C_01 RE -
06_evil_C_02 RE -
06_evil_C_03 RE -
06_evil_C_04 RE -
06_evil_C_05 RE -
06_evil_C_06 RE -
06_evil_C_07 RE -
06_evil_C_08 RE -
06_evil_C_09 RE -
06_evil_C_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:10:1: warning: return type defaults to 'int' [-Wimplicit-int]
   10 | main(){
      | ^~~~
main.c: In function 'main':
main.c:11:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |         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:11:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |

ソースコード

diff #

long dp[1024][1024],sum[1024],ans;
a[200010];
n,k,x,y;
i,j,q;
f(m,x,p){
    int flag[1024]={};
    if(m==n/2)dp[x][p]++;
	else for(int i=0;i<k;i++)if(p!=a[i]&!flag[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);
}
0