結果
問題 | No.442 和と積 |
ユーザー |
![]() |
提出日時 | 2016-12-09 02:13:08 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 150 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 22:53:16 |
合計ジャッジ時間 | 812 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
コンパイルメッセージ
main.c: In function ‘run’: main.c:17:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%lld%lld",&a,&b); | ^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>typedef long long int ln;ln gcd(ln a,ln b){ln r=a%b;while(r>0){a=b;b=r;r=a%b;}return b;}void run(void){ln a,b;scanf("%lld%lld",&a,&b);ln g=gcd(a,b);printf("%lld\n",g*gcd(g,(a+b)/g));return;}int main(void){run();return 0;}