結果
| 問題 |
No.83 最大マッチング
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-10-03 21:04:40 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 2,117 ms / 5,000 ms |
| コード長 | 798 bytes |
| コンパイル時間 | 854 ms |
| コンパイル使用メモリ | 103,552 KB |
| 実行使用メモリ | 40,832 KB |
| 最終ジャッジ日時 | 2024-10-12 10:28:42 |
| 合計ジャッジ時間 | 7,151 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var matchNum = int.Parse(Console.ReadLine());
var oneNum = matchNum / 2;
var sevenFlag = matchNum % 2 == 1;
var result = "";
for(int i = 0; i < oneNum; i++)
{
result += "1";
}
if(sevenFlag)
{
result = result.Insert(0, "7");
if(oneNum >= 1)
{
result = result.Substring(0, result.Length - 1);
}
}
Console.WriteLine(result);
}
}
}