結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-15 05:44:16 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 532 bytes |
| 記録 | |
| コンパイル時間 | 1,829 ms |
| コンパイル使用メモリ | 104,704 KB |
| 実行使用メモリ | 42,752 KB |
| 最終ジャッジ日時 | 2024-10-13 10:18:27 |
| 合計ジャッジ時間 | 6,314 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 TLE * 1 -- * 24 |
コンパイルメッセージ
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;
class Program {
static void Main() {
int ans = 0;
int n = int.Parse(Console.ReadLine());
var a = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
for (int i = n; 0 <= i; i--) {
int ai = a.IndexOf(i);
for (int j = i - 1; 0 <= j; j--) {
if (ai < a.IndexOf(j)) {
ans = Math.Max(ans, j);
break;
}
}
}
Console.WriteLine(ans);
}
}