結果

問題 No.83 最大マッチング
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-10 11:29:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 458 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 71,508 KB
実行使用メモリ 67,144 KB
最終ジャッジ日時 2023-09-17 19:09:02
合計ジャッジ時間 5,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,624 KB
testcase_01 AC 126 ms
55,584 KB
testcase_02 AC 125 ms
55,936 KB
testcase_03 AC 125 ms
55,700 KB
testcase_04 AC 125 ms
55,744 KB
testcase_05 AC 124 ms
55,372 KB
testcase_06 AC 122 ms
55,600 KB
testcase_07 AC 124 ms
55,684 KB
testcase_08 AC 124 ms
55,584 KB
testcase_09 AC 229 ms
59,520 KB
testcase_10 AC 368 ms
65,244 KB
testcase_11 AC 430 ms
67,144 KB
testcase_12 AC 458 ms
66,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        if(n%2==0){
            int lg = n/2;
            for(int i=0; i<lg-1; i++){
                System.out.print(1);
            }
            System.out.println(1);
        }else{
            int lk =(n-3)/2;
            System.out.print(7);
            if(n-3>0){
               for(int i=0; i<lk-1; i++){
                System.out.print(1);
               }
               System.out.println(1);
            }
        }
    }
}
0