結果

問題 No.2140 Triangle
ユーザー AsahiAsahi
提出日時 2022-12-14 18:44:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 75,012 KB
実行使用メモリ 54,452 KB
最終ジャッジ日時 2024-04-25 22:24:39
合計ジャッジ時間 6,739 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
54,044 KB
testcase_01 AC 125 ms
54,148 KB
testcase_02 AC 123 ms
54,076 KB
testcase_03 AC 124 ms
54,288 KB
testcase_04 AC 121 ms
54,228 KB
testcase_05 AC 121 ms
54,016 KB
testcase_06 AC 121 ms
54,304 KB
testcase_07 AC 126 ms
54,152 KB
testcase_08 AC 123 ms
54,136 KB
testcase_09 AC 109 ms
53,028 KB
testcase_10 AC 119 ms
54,236 KB
testcase_11 AC 122 ms
54,136 KB
testcase_12 AC 120 ms
54,336 KB
testcase_13 AC 118 ms
54,124 KB
testcase_14 AC 121 ms
53,972 KB
testcase_15 AC 120 ms
54,156 KB
testcase_16 AC 124 ms
54,452 KB
testcase_17 AC 123 ms
53,832 KB
testcase_18 AC 123 ms
54,188 KB
testcase_19 AC 123 ms
54,256 KB
testcase_20 AC 124 ms
54,192 KB
testcase_21 AC 120 ms
54,184 KB
testcase_22 AC 122 ms
54,140 KB
testcase_23 AC 123 ms
54,008 KB
testcase_24 AC 110 ms
53,116 KB
testcase_25 AC 122 ms
54,116 KB
testcase_26 AC 126 ms
54,328 KB
testcase_27 AC 113 ms
53,008 KB
testcase_28 AC 124 ms
54,308 KB
testcase_29 AC 121 ms
53,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
 
class Main{
    public static final int INF = Integer.MAX_VALUE;
    public static PrintWriter out = new PrintWriter(System.out);
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws IOException {
        int A = sc.nextInt();
        long ans = 0;
        //必要条件 a + b > c || a + c > b
        //A == B のとき
        ans += (A*2)-1;
        out.print(ans);
        out.flush();
    }
}
0