結果
| 問題 | No.320 眠れない夜に |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-03-05 15:00:12 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 147 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 14:20:44 |
| 合計ジャッジ時間 | 1,346 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / 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:1:14: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
main.c:1:16: warning: return type defaults to ‘int’ [-Wimplicit-int]
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:16: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:66: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
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: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:66: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:127: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
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
ソースコード
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