結果

問題 No.510 二次漸化式
ユーザー testestesttestestest
提出日時 2017-06-16 17:52:07
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 301 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 9,108 KB
最終ジャッジ日時 2024-04-08 13:41:04
合計ジャッジ時間 13,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 198 ms
6,676 KB
testcase_03 AC 195 ms
6,676 KB
testcase_04 AC 197 ms
6,676 KB
testcase_05 AC 195 ms
6,676 KB
testcase_06 AC 1,874 ms
6,676 KB
testcase_07 AC 1,886 ms
6,676 KB
testcase_08 AC 1,898 ms
6,676 KB
testcase_09 AC 1,912 ms
6,676 KB
testcase_10 AC 8 ms
6,676 KB
testcase_11 AC 8 ms
6,676 KB
testcase_12 AC 8 ms
6,676 KB
testcase_13 AC 8 ms
6,676 KB
testcase_14 AC 8 ms
6,676 KB
testcase_15 AC 8 ms
6,676 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | x[1<<17],y[1<<17];
      | ^
main.c:2:1: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:2:10: warning: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    2 | x[1<<17],y[1<<17];
      |          ^
main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         scanf("%*d%*d");
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | //さすがにTLEしそう
main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         scanf("%*d%*d");
      |         ^~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:33: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |                                 printf("%d\n",a);
      |                                 ^~~~~~
main.c:12:33: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:33: note: include '<stdio.h>' or provide a declaration of 'printf'

ソースコード

diff #

//さすがにTLEしそう
x[1<<17],y[1<<17];
long a,b,c,i,k,M=1e9+7;
main(){
	scanf("%*d%*d");
	for(;~scanf("%c%d%d",&c,&i,&k);){
		switch(c){
			case'x':x[i]=k;break;
			case'y':y[i]=k;break;
			case'a':a=b=1;
				for(int j=0;j<i;j++)a=(b*b%M*x[j]+a)%M,b=(y[j]*b+1)%M;
				printf("%d\n",a);
		}
	}
}
0