結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー %20%20
提出日時 2017-01-27 13:57:27
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 1,006 ms
コンパイル使用メモリ 23,436 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-25 03:38:40
合計ジャッジ時間 27,239 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,591 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1,725 ms
4,380 KB
testcase_05 AC 1,932 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 370 ms
4,384 KB
testcase_08 AC 979 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 983 ms
4,380 KB
testcase_13 AC 1,976 ms
4,380 KB
testcase_14 AC 985 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1,961 ms
4,380 KB
testcase_17 AC 124 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 877 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 21 ms
4,380 KB
testcase_22 AC 511 ms
4,380 KB
testcase_23 AC 721 ms
4,380 KB
testcase_24 AC 71 ms
4,376 KB
testcase_25 AC 228 ms
4,376 KB
testcase_26 AC 192 ms
4,380 KB
testcase_27 AC 1,262 ms
4,376 KB
testcase_28 AC 1,275 ms
4,380 KB
testcase_29 AC 1,350 ms
4,380 KB
testcase_30 AC 167 ms
4,380 KB
testcase_31 AC 24 ms
4,380 KB
testcase_32 AC 25 ms
4,380 KB
testcase_33 AC 320 ms
4,376 KB
testcase_34 AC 886 ms
4,380 KB
testcase_35 AC 56 ms
4,376 KB
testcase_36 AC 383 ms
4,380 KB
testcase_37 AC 0 ms
4,380 KB
testcase_38 AC 26 ms
4,380 KB
testcase_39 AC 46 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 39 ms
4,380 KB
testcase_42 WA -
testcase_43 AC 399 ms
4,380 KB
testcase_44 AC 68 ms
4,380 KB
testcase_45 AC 222 ms
4,380 KB
testcase_46 AC 130 ms
4,380 KB
testcase_47 AC 1 ms
4,376 KB
testcase_48 AC 0 ms
4,376 KB
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:11:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main(){
 ^~~~
main.c: In function ‘main’:
main.c:12:2: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
  scanf("%lld%lld%lld",&a,&b,&c);
  ^~~~~
main.c:12:2: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:12:2: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:1:
+#include <stdio.h>
 typedef long long L;
main.c:12:2:
  scanf("%lld%lld%lld",&a,&b,&c);
  ^~~~~
main.c:16:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
  printf("%lld/%lld\n",l,x);
  ^~~~~~
main.c:16:2: warning: incompatible implicit declaration of built-in function ‘printf’
main.c:16:2: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #

typedef long long L;
L gcd(L a,L b){
	for(;a^=b^=a^=b%=a;);
	return b;
}
L lcm(L a,L b){
	return a*b/gcd(a,b);
}

L a,b,c,l,x;
main(){
	scanf("%lld%lld%lld",&a,&b,&c);
	l=lcm(lcm(a,b),c);
	x=a=l/a,b=l/b,c=l/c;
	for(;--x,a%x!=b%x||b%x!=c%x;);
	printf("%lld/%lld\n",l,x);
	return 0;
}
0