結果

問題 No.1329 Square Sqsq
ユーザー tentententen
提出日時 2021-01-18 08:30:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 5,620 ms
コンパイル使用メモリ 78,920 KB
実行使用メモリ 56,876 KB
最終ジャッジ日時 2023-08-20 15:30:29
合計ジャッジ時間 10,974 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,384 KB
testcase_01 AC 118 ms
55,756 KB
testcase_02 AC 119 ms
55,904 KB
testcase_03 AC 192 ms
54,512 KB
testcase_04 AC 206 ms
56,844 KB
testcase_05 AC 194 ms
56,232 KB
testcase_06 AC 202 ms
56,352 KB
testcase_07 AC 202 ms
56,644 KB
testcase_08 AC 205 ms
54,600 KB
testcase_09 AC 203 ms
56,876 KB
testcase_10 AC 204 ms
56,836 KB
testcase_11 AC 230 ms
56,664 KB
testcase_12 AC 201 ms
56,116 KB
testcase_13 AC 206 ms
56,452 KB
testcase_14 AC 141 ms
55,696 KB
testcase_15 AC 133 ms
55,704 KB
testcase_16 AC 123 ms
55,720 KB
testcase_17 AC 143 ms
55,640 KB
testcase_18 AC 187 ms
56,560 KB
testcase_19 AC 173 ms
56,516 KB
testcase_20 AC 139 ms
56,060 KB
testcase_21 AC 142 ms
55,708 KB
testcase_22 AC 204 ms
56,292 KB
testcase_23 AC 181 ms
56,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int length = s.length();
        int ans;
        if (length % 2 == 0) {
            ans = length / 2;
        } else {
            ans = length / 2 + 1;
        }
        System.out.println(ans);
    }
}
0