結果
問題 |
No.909 たぴの配置
|
ユーザー |
![]() |
提出日時 | 2019-10-18 21:34:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 261 ms / 3,000 ms |
コード長 | 918 bytes |
コンパイル時間 | 4,875 ms |
コンパイル使用メモリ | 114,392 KB |
実行使用メモリ | 62,832 KB |
最終ジャッジ日時 | 2024-06-25 15:07:56 |
合計ジャッジ時間 | 6,396 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; using System.Collections.Generic; using System.IO; class MyClass { public static void Solve() { var N = int.Parse(Console.ReadLine()); var X = Console.ReadLine().Split().Select(int.Parse).ToArray(); var Y = Console.ReadLine().Split().Select(int.Parse).ToArray(); var min = Enumerable.Range(0, N).Select(i => X[i] + Y[i]).Min(); Console.WriteLine(min); var pos = new int[N + 2]; pos[0] = 0; pos[N + 1] = min; for (int i = 0; i < N; i++) { pos[i + 1] = Math.Min(X[i], min); } foreach (var item in pos) { Console.WriteLine(item); } } public static void Main() { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); Solve(); Console.Out.Flush(); } }