結果
問題 | No.141 魔法少女コバ |
ユーザー |
|
提出日時 | 2017-09-18 04:45:56 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 145 bytes |
コンパイル時間 | 1,141 ms |
コンパイル使用メモリ | 26,752 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 02:14:19 |
合計ジャッジ時間 | 3,662 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 60 WA * 31 RE * 2 |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | g(a,b){return b?g(b,a%b):a;} | ^ main.c: In function 'g': main.c:1:1: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:2:1: warning: data definition has no type or storage class 2 | c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);} | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:2:3: warning: return type defaults to 'int' [-Wimplicit-int] 2 | c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);} | ^~~~ main.c: In function 'main': main.c:2:3: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:2:3: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:2:17: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 2 | c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | g(a,b){return b?g(b,a%b):a;} main.c:2:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 2 | c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);} | ^~~~~ main.c:2:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:2:95: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 2 | c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);} |
ソースコード
g(a,b){return b?g(b,a%b):a;} c;main(a,b){for(scanf("%d%d",&a,&b),a/=g(a,b),b/=g(a,b);a-1&&b-1;a^=b^=a^=b)c+=a/b+1,a-=a/b*b;printf("%d",a+b+c-2);}