結果

問題 No.2088 数当てゲーム
ユーザー shojin_proshojin_pro
提出日時 2022-09-30 21:41:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 2,234 ms
コンパイル使用メモリ 71,792 KB
実行使用メモリ 57,920 KB
最終ジャッジ日時 2023-08-24 15:06:15
合計ジャッジ時間 6,738 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,764 KB
testcase_01 AC 121 ms
55,948 KB
testcase_02 AC 121 ms
55,728 KB
testcase_03 AC 122 ms
55,864 KB
testcase_04 AC 123 ms
57,920 KB
testcase_05 AC 121 ms
56,276 KB
testcase_06 AC 122 ms
55,848 KB
testcase_07 WA -
testcase_08 AC 122 ms
55,748 KB
testcase_09 AC 121 ms
56,496 KB
testcase_10 AC 122 ms
55,996 KB
testcase_11 AC 120 ms
56,064 KB
testcase_12 AC 123 ms
56,324 KB
testcase_13 AC 120 ms
55,876 KB
testcase_14 AC 122 ms
56,000 KB
testcase_15 WA -
testcase_16 AC 121 ms
55,704 KB
testcase_17 AC 123 ms
54,364 KB
testcase_18 AC 121 ms
56,248 KB
testcase_19 AC 120 ms
56,116 KB
testcase_20 AC 121 ms
56,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextLong();
        long B = sc.nextLong();
        if(B == 0){
            System.out.println(0);   
        }else if(Math.abs(B) % (Math.abs(A)-1) == 0){
            if(A < 0){
                A = -A;
                B = -B;
            }
            System.out.println(-B/(A-1));
        }else{
            System.out.println("なんや");
        }
    }
}
0