結果
問題 |
No.909 たぴの配置
|
ユーザー |
![]() |
提出日時 | 2019-10-19 02:53:54 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 112 ms / 3,000 ms |
コード長 | 1,713 bytes |
コンパイル時間 | 789 ms |
コンパイル使用メモリ | 104,448 KB |
実行使用メモリ | 22,400 KB |
最終ジャッジ日時 | 2024-06-26 02:29:17 |
合計ジャッジ時間 | 5,184 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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.Collections.Generic; using System.Linq; using System.Numerics; using static System.Console; using static System.Math; class Program { static void Main() { SetOut(new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false }); var N = FastIO.Int(); var X = new int[N]; var Y = new int[N]; for (int i = 0; i < X.Length; i++) { X[i] = FastIO.Int(); } for (int i = 0; i < Y.Length; i++) { Y[i] = FastIO.Int(); } var m = int.MaxValue; for (int i = 0; i < N; i++) { var d = X[i] + Y[i]; if (m > d) { m = d; } } WriteLine(m); WriteLine(0); for (int i = 0; i < N; i++) { WriteLine(Min(X[i], m)); } WriteLine(m); Out.Flush(); } } public static class FastIO { static System.IO.Stream str = System.Console.OpenStandardInput(); const int size = 1024; static byte[] buffer = new byte[size]; static int ptr = size; static byte Read() { if (ptr == size) { str.Read(buffer, 0, size); ptr = 0; } return buffer[ptr++]; } public static int Int() { var c = Read(); while (c < 0x21) { c = Read(); } var n = false; if (c == '-') { n = true; c = Read(); } var ret = 0; while (c > 0x20) { ret = ret * 10 + c - '0'; c = Read(); } return n ? -ret : ret; } }