結果

問題 No.1329 Square Sqsq
ユーザー tentententen
提出日時 2021-01-18 08:30:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 3,256 ms
コンパイル使用メモリ 73,940 KB
実行使用メモリ 42,392 KB
最終ジャッジ日時 2024-05-07 21:54:26
合計ジャッジ時間 6,816 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
41,360 KB
testcase_01 AC 93 ms
40,868 KB
testcase_02 AC 108 ms
41,276 KB
testcase_03 AC 160 ms
41,896 KB
testcase_04 AC 171 ms
41,688 KB
testcase_05 AC 173 ms
41,736 KB
testcase_06 AC 176 ms
42,392 KB
testcase_07 AC 169 ms
41,864 KB
testcase_08 AC 162 ms
41,628 KB
testcase_09 AC 175 ms
42,076 KB
testcase_10 AC 176 ms
42,004 KB
testcase_11 AC 169 ms
42,340 KB
testcase_12 AC 168 ms
42,080 KB
testcase_13 AC 168 ms
41,704 KB
testcase_14 AC 136 ms
41,568 KB
testcase_15 AC 116 ms
41,064 KB
testcase_16 AC 111 ms
40,968 KB
testcase_17 AC 132 ms
41,244 KB
testcase_18 AC 158 ms
41,748 KB
testcase_19 AC 162 ms
41,764 KB
testcase_20 AC 133 ms
41,068 KB
testcase_21 AC 111 ms
41,424 KB
testcase_22 AC 178 ms
42,124 KB
testcase_23 AC 145 ms
41,872 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