結果

問題 No.83 最大マッチング
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-29 16:57:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,137 bytes
コンパイル時間 3,594 ms
コンパイル使用メモリ 85,968 KB
実行使用メモリ 57,452 KB
最終ジャッジ日時 2024-04-16 18:16:14
合計ジャッジ時間 6,961 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,596 KB
testcase_01 AC 123 ms
40,540 KB
testcase_02 AC 136 ms
41,664 KB
testcase_03 WA -
testcase_04 AC 134 ms
41,316 KB
testcase_05 WA -
testcase_06 AC 138 ms
41,592 KB
testcase_07 WA -
testcase_08 AC 135 ms
41,556 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 332 ms
45,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki83{
	
	public static void main(String[] args) {
		
//		int numbers[] = {8,2,5,5,5,4,5,6,3,7,6};
		
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		scan.close();
		int two_num = 0;
		int three_num = 0;
		String ans = "";
		
		two_num = num / 2;
		
		if (three_num == 3){
			three_num ++;
		} else if(num % 2 != 0) {
			two_num = two_num -1;
			three_num ++;
		}
		
		for(int i =0; i < two_num; i++ ) {
			ans += "1"; 	
		}
		for(int i =0; i < three_num; i++ ) {
			ans += "7"; 	
		}

		System.out.println(ans);
		
		/*
		int ans = 0;
		int ans2 = 0;
		String strAns = "";
		
		
		for (int i = 0; i <= 9 ; i++ ) {
			if(ans >= ans2){
				ans2 = ans;
				if(count < num[i]){
					ans = num[i]/count;
					for(int j = 0; j < i; j++) {
						strAns += String.valueOf(i);
					}
					ans = Integer.parseInt(strAns);
				}else{
					ans = (count / num[i]);
					strAns += String.valueOf(ans);
					for(int j = 0; j < i; j++) {
						strAns += String.valueOf(i);
					}
					ans = Integer.parseInt(strAns);
				}
			}
		}
		System.out.println(ans);
		*/
	}
}
0