結果
| 問題 | No.320 眠れない夜に |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-03-05 15:00:12 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 147 bytes |
| 記録 | |
| コンパイル時間 | 133 ms |
| コンパイル使用メモリ | 29,312 KB |
| 最終ジャッジ日時 | 2026-02-23 20:50:08 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 |
コンパイルメッセージ
main.c:1:14: warning: data definition has no type or storage class
1 | long m,a[99];s;main(n){for(a[1]=1;++n<99;a[n]=a[n-1]+a[n-2]);for(scanf("%d%ld",&n,&m),m=a[n--]-m;--n;m/a[n]?m-=a[n],s++:0);s=!printf("%d",m?-1:s);}
| ^
main.c: In function ‘main’:
main.c:1:66: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
1 | long m,a[99];s;main(n){for(a[1]=1;++n<99;a[n]=a[n-1]+a[n-2]);for(scanf("%d%ld",&n,&m),m=a[n--]-m;--n;m/a[n]?m-=a[n],s++:0);s=!printf("%d",m?-1:s);}
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | long m,a[99];s;main(n){for(a[1]=1;++n<99;a[n]=a[n-1]+a[n-2]);for(scanf("%d%ld",&n,&m),m=a[n--]-m;--n;m/a[n]?m-=a[n],s++:0);s=!printf("%d",m?-1:s);}
main.c:1:127: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
1 | long m,a[99];s;main(n){for(a[1]=1;++n<99;a[n]=a[n-1]+a[n-2]);for(scanf("%d%ld",&n,&m),m=a[n--]-m;--n;m/a[n]?m-=a[n],s++:0);s=!printf("%d",m?-1:s);}
| ^~~~~~
main.c:1:127: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
long m,a[99];s;main(n){for(a[1]=1;++n<99;a[n]=a[n-1]+a[n-2]);for(scanf("%d%ld",&n,&m),m=a[n--]-m;--n;m/a[n]?m-=a[n],s++:0);s=!printf("%d",m?-1:s);}
testestest