結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2016-10-31 21:37:07 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 1,898 ms |
コンパイル使用メモリ | 74,304 KB |
実行使用メモリ | 56,136 KB |
最終ジャッジ日時 | 2024-11-25 00:15:16 |
合計ジャッジ時間 | 5,363 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 2 WA * 18 |
ソースコード
import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { long n = sc.nextLong(); long d = sc.nextLong(); long ret; if (n==d) { ret = 0; } else { if (d>n/2) d = n-d; long m = n%d; if (m==0) { ret = n/d-1; } else { ret = n-1; } } System.out.println(ret); } }