結果
問題 |
No.442 和と積
|
ユーザー |
![]() |
提出日時 | 2016-11-12 19:09:34 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 1,735 ms |
コンパイル使用メモリ | 73,972 KB |
実行使用メモリ | 56,612 KB |
最終ジャッジ日時 | 2024-11-25 21:25:41 |
合計ジャッジ時間 | 4,887 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 4 RE * 14 |
ソースコード
import java.util.Scanner; public class Main { public static long gcd(long n,long r){ return r==0?n:gcd(r,n%r); } public static void main(String[] args) { Scanner sc=new Scanner(System.in); long a=sc.nextInt(); long b=sc.nextInt(); long s=a+b; long p=a*b; System.out.println(gcd(s,p)); } }