結果

問題 No.3038 フィボナッチ数列の周期
ユーザー testestesttestestest
提出日時 2018-01-26 07:26:42
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 261 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 28,192 KB
実行使用メモリ 6,092 KB
最終ジャッジ日時 2023-09-07 12:41:43
合計ジャッジ時間 6,235 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,092 KB
testcase_01 AC 24 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 434 ms
4,380 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: 関数 ‘main’ 内:
main.c:6:9: 警告: 関数 ‘scanf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | #define N 10000000
main.c:6:9: 警告: 組み込み関数 ‘scanf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d",&n);
      |         ^~~~~
main.c:6:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:18:9: 警告: 関数 ‘printf’ の暗黙的な宣言です [-Wimplicit-function-declaration]
   18 |         printf("%d\n",cnt);
      |         ^~~~~~
main.c:18:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:18:9: 警告: 組み込み関数 ‘printf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch]
main.c:18:9: 備考: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

#define N 10000000
main(){
	//small解法
	int n;
	int m=1;
	scanf("%d",&n);
	while(n--){
		int p,k;
		scanf("%d%d",&p,&k);
		while(k--)m*=p;
	}
	if(m>=N)return 0;
	int a=1,b=1,cnt=1;
	while(a!=0||b!=1){
		int t=a+b;
		a=b;b=t%m;cnt++;
	}
	printf("%d\n",cnt);
}
0