結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-05-12 16:52:29 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 1,036 bytes |
コンパイル時間 | 3,104 ms |
コンパイル使用メモリ | 109,732 KB |
実行使用メモリ | 33,200 KB |
最終ジャッジ日時 | 2024-10-12 02:17:44 |
合計ジャッジ時間 | 6,100 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
コンパイルメッセージ
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; using System.Collections.Generic; public class P{ public static void Main(){ int n = InputToInt(); int[] m = Input().Split().MapInt(); for(int i=n; i>0; --i){if(m[i-1]==n){--n;}} Print(n); } public static void Print(params object[] o){ for(int i=0; i<o.Length; ++i){ Console.Write(o[i]); Console.Write(i==o.Length-1 ? '\n' : ' '); } } public static string Input(){return Console.ReadLine();} public static int InputToInt(){return int.Parse(Console.ReadLine());} } public static class StringArrayExtensions{ public static int[] MapInt(this string[] s){return s.Select(int.Parse).ToArray();} public static long[] MapLong(this string[] s){return s.Select(long.Parse).ToArray();} public static float[] MapFloat(this string[] s){return s.Select(float.Parse).ToArray();} public static double[] MapDouble(this string[] s){return s.Select(double.Parse).ToArray();} }