結果

問題 No.368 LCM of K-products
ユーザー 👑 testestesttestestest
提出日時 2016-05-13 01:46:03
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 22,912 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-05 14:11:14
合計ジャッジ時間 2,021 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,820 KB
testcase_01 AC 38 ms
6,816 KB
testcase_02 AC 2 ms
6,816 KB
testcase_03 AC 12 ms
6,820 KB
testcase_04 AC 5 ms
6,816 KB
testcase_05 AC 113 ms
6,816 KB
testcase_06 AC 1 ms
6,816 KB
testcase_07 WA -
testcase_08 AC 0 ms
6,816 KB
testcase_09 AC 1 ms
6,816 KB
testcase_10 AC 1 ms
6,816 KB
testcase_11 AC 1 ms
6,816 KB
testcase_12 AC 1 ms
6,820 KB
testcase_13 AC 8 ms
6,820 KB
testcase_14 AC 14 ms
6,816 KB
testcase_15 AC 17 ms
6,816 KB
testcase_16 AC 13 ms
6,820 KB
testcase_17 AC 11 ms
6,816 KB
testcase_18 AC 16 ms
6,816 KB
testcase_19 AC 4 ms
6,820 KB
testcase_20 AC 11 ms
6,820 KB
testcase_21 AC 3 ms
6,820 KB
testcase_22 AC 15 ms
6,816 KB
testcase_23 AC 0 ms
6,820 KB
testcase_24 AC 0 ms
6,820 KB
testcase_25 AC 1 ms
6,816 KB
testcase_26 AC 1 ms
6,816 KB
testcase_27 AC 0 ms
6,820 KB
testcase_28 AC 1 ms
6,820 KB
testcase_29 AC 1 ms
6,816 KB
testcase_30 AC 0 ms
6,816 KB
testcase_31 AC 0 ms
6,816 KB
testcase_32 AC 0 ms
6,816 KB
testcase_33 AC 5 ms
6,816 KB
testcase_34 AC 1 ms
6,820 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | d[3000][40];
      | ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | x,n,i,j,k,s,t,m=1e9+7;
      | ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |   ^
main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |     ^
main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |       ^
main.c:2:9: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |         ^
main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |           ^
main.c:2:13: warning: type defaults to ‘int’ in declaration of ‘t’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |             ^
main.c:2:15: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int]
    2 | x,n,i,j,k,s,t,m=1e9+7;
      |               ^
main.c: In function ‘p’:
main.c:3:6: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
    3 | long p(a,n){return n?a*p(a,n-1)%m:1;}
      |      ^
main.c:3:6: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int]
main.c: At top level:
main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:5:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    5 |         for(scanf("%*d%d",&n);~scanf("%d",&s);s=s>1?d[i][0]=s,d[i][2]=1:1){
      |             ^~~~~
main.c:1:1: note: inclu

ソースコード

diff #

d[3000][40];
x,n,i,j,k,s,t,m=1e9+7;
long p(a,n){return n?a*p(a,n-1)%m:1;}
main(){
	for(scanf("%*d%d",&n);~scanf("%d",&s);s=s>1?d[i][0]=s,d[i][2]=1:1){
		for(i=1;k=d[i][0];d[i++][t]++)for(t=1;s%k<1;t++)s/=k;
		for(k=2;s>1&s>k*k;t>1?d[i][0]=k,d[i++][t]++:k++)for(t=1;s%k<1;t++)s/=k;
	}
	for(i=0;x=d[++i][0]?:!printf("%d",s);s=s*p(x,k)%m)for(k=t=0,j=30;t<n&&j;t+=d[i][j--])k+=~-j*(d[i][j]>n-t?n-t:d[i][j]);
}
0