結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー 👑 testestesttestestest
提出日時 2020-12-01 12:30:51
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 881 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 30,720 KB
実行使用メモリ 10,096 KB
最終ジャッジ日時 2024-06-12 10:03:40
合計ジャッジ時間 23,428 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
6,812 KB
testcase_01 AC 7 ms
6,940 KB
testcase_02 AC 255 ms
6,940 KB
testcase_03 AC 861 ms
6,940 KB
testcase_04 AC 881 ms
8,980 KB
testcase_05 AC 309 ms
8,444 KB
testcase_06 AC 867 ms
6,940 KB
testcase_07 AC 396 ms
9,968 KB
testcase_08 AC 141 ms
9,728 KB
testcase_09 AC 458 ms
8,564 KB
testcase_10 AC 54 ms
8,568 KB
testcase_11 AC 189 ms
8,708 KB
testcase_12 AC 508 ms
8,696 KB
testcase_13 AC 131 ms
8,456 KB
testcase_14 AC 514 ms
10,096 KB
testcase_15 AC 112 ms
8,440 KB
testcase_16 AC 605 ms
8,564 KB
testcase_17 AC 662 ms
9,208 KB
testcase_18 AC 438 ms
8,444 KB
testcase_19 AC 219 ms
9,972 KB
testcase_20 AC 61 ms
8,052 KB
testcase_21 AC 127 ms
9,988 KB
testcase_22 AC 685 ms
8,584 KB
testcase_23 AC 724 ms
8,828 KB
testcase_24 AC 360 ms
8,832 KB
testcase_25 AC 309 ms
6,944 KB
testcase_26 AC 52 ms
9,724 KB
testcase_27 AC 402 ms
9,984 KB
testcase_28 AC 140 ms
9,092 KB
testcase_29 AC 459 ms
8,956 KB
testcase_30 AC 52 ms
6,940 KB
testcase_31 AC 186 ms
6,944 KB
testcase_32 AC 512 ms
9,984 KB
testcase_33 AC 133 ms
9,992 KB
testcase_34 AC 515 ms
9,980 KB
testcase_35 AC 25 ms
8,196 KB
testcase_36 AC 144 ms
7,960 KB
testcase_37 AC 568 ms
8,072 KB
testcase_38 AC 412 ms
6,940 KB
testcase_39 AC 98 ms
6,944 KB
testcase_40 AC 717 ms
8,084 KB
testcase_41 AC 851 ms
6,940 KB
testcase_42 AC 494 ms
8,200 KB
testcase_43 AC 604 ms
8,068 KB
testcase_44 AC 534 ms
7,956 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]+=dp[i][j];
	for(i=0;i<1024;i++)for(j=0;j<1024;j++)if((i^j)>=x&(i^j)<=y){
		ans+=sum[i]*sum[j];
		for(q=0;q<1024;q++)ans-=dp[i][q]*dp[j][q];
	}
	printf("%d",ans%998244353);
}
0