結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
|
提出日時 | 2021-01-21 13:36:40 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,355 bytes |
コンパイル時間 | 1,128 ms |
コンパイル使用メモリ | 107,648 KB |
実行使用メモリ | 46,976 KB |
最終ジャッジ日時 | 2024-12-24 13:20:12 |
合計ジャッジ時間 | 79,186 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 TLE * 12 |
コンパイルメッセージ
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; namespace No { class MainClass { static int n; static int[] a; static int[] b; public static void Main(string[] args) { n = int.Parse(Console.ReadLine()); a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); b = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); int max_battle_number = n; for (int start = 0; start < n; start++) { int[] level = new int[n]; int pos = start, count = 0, max = 0; for (int i = 0; i < n; i++) level[i] = a[i] * 1000; while (true) { level[Array.IndexOf(level, level.Min())] += (b[pos] / 2) * 1000 + 1; pos++; if (pos >= n) pos = 0; count++; if (count == n) break; } foreach (int num in level) if (max < num % 1000) max = num % 1000; if (max_battle_number > max) max_battle_number = max; } Console.WriteLine(max_battle_number); } } }