結果

問題 No.83 最大マッチング
ユーザー villachvillach
提出日時 2017-09-19 15:26:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 3,251 ms
コンパイル使用メモリ 75,116 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2024-04-25 18:09:43
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
54,272 KB
testcase_01 AC 130 ms
54,124 KB
testcase_02 AC 130 ms
54,340 KB
testcase_03 WA -
testcase_04 AC 129 ms
54,020 KB
testcase_05 WA -
testcase_06 AC 131 ms
54,124 KB
testcase_07 WA -
testcase_08 AC 128 ms
53,904 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N83 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = 0;
		int c = n / 2;
		if(c >= 2){
			for(int i = 1;i < c;++i){
				m += Math.pow(10, i);
			}
			switch(n % 2){
			case 0:
				m += 1;
				break;
			case 1:
				m += 7;
				break;
			}
		}else{
			switch(n){
			case 2:
				m = 1;
				break;
			case 3:
				m = 7;
				break;
			}
		}
		
		System.out.println(m);
	}
}
0