結果
問題 | No.83 最大マッチング |
ユーザー |
|
提出日時 | 2018-10-03 20:41:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 741 bytes |
コンパイル時間 | 818 ms |
コンパイル使用メモリ | 112,792 KB |
実行使用メモリ | 22,100 KB |
最終ジャッジ日時 | 2024-10-12 10:27:28 |
合計ジャッジ時間 | 1,837 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Text; namespace Problem083 { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var ans = new List<int>(); Process(n, ans); ans.Sort(); ans.Reverse(); Console.WriteLine(string.Join("", ans)); } static void Process(int n, List<int> ans) { if (n >= 2 && n != 3) { ans.Add(1); n -= 2; } else if (n >= 3) { ans.Add(7); n -= 3; } if (n >= 2) Process(n, ans); } } }