結果

問題 No.83 最大マッチング
ユーザー mos_13184925mos_13184925
提出日時 2018-06-30 12:44:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 3,845 ms
コンパイル使用メモリ 72,216 KB
実行使用メモリ 56,224 KB
最終ジャッジ日時 2023-09-13 16:16:52
合計ジャッジ時間 4,522 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,640 KB
testcase_01 AC 124 ms
55,936 KB
testcase_02 AC 123 ms
55,604 KB
testcase_03 AC 121 ms
56,224 KB
testcase_04 AC 121 ms
56,016 KB
testcase_05 AC 121 ms
55,648 KB
testcase_06 AC 123 ms
55,624 KB
testcase_07 AC 123 ms
55,596 KB
testcase_08 AC 121 ms
55,840 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        if(n%2==0) ans+=1;
        else ans+=7;
        int m = (int)Math.ceil(n/2);
        for(int i=1; i<m; i++) {
            ans*=10;
            ans+=1;
        }
        System.out.println(ans);
    }
}
0