結果

問題 No.365 ジェンガソート
ユーザー ebicochinealebicochineal
提出日時 2016-05-10 21:54:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 1,010 bytes
コンパイル時間 1,497 ms
コンパイル使用メモリ 111,712 KB
実行使用メモリ 33,128 KB
最終ジャッジ日時 2024-04-20 07:08:05
合計ジャッジ時間 3,754 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
25,196 KB
testcase_01 AC 25 ms
25,204 KB
testcase_02 AC 25 ms
25,480 KB
testcase_03 AC 26 ms
25,200 KB
testcase_04 AC 24 ms
27,124 KB
testcase_05 AC 23 ms
23,348 KB
testcase_06 AC 24 ms
25,260 KB
testcase_07 AC 23 ms
25,076 KB
testcase_08 AC 23 ms
25,196 KB
testcase_09 AC 23 ms
25,072 KB
testcase_10 AC 23 ms
27,392 KB
testcase_11 AC 23 ms
25,336 KB
testcase_12 AC 23 ms
25,072 KB
testcase_13 AC 24 ms
27,004 KB
testcase_14 AC 22 ms
25,208 KB
testcase_15 AC 24 ms
27,388 KB
testcase_16 AC 48 ms
30,572 KB
testcase_17 AC 55 ms
31,008 KB
testcase_18 AC 30 ms
25,848 KB
testcase_19 AC 53 ms
31,104 KB
testcase_20 AC 35 ms
28,660 KB
testcase_21 AC 33 ms
28,760 KB
testcase_22 AC 50 ms
30,560 KB
testcase_23 AC 41 ms
27,296 KB
testcase_24 AC 53 ms
32,468 KB
testcase_25 AC 38 ms
26,932 KB
testcase_26 AC 45 ms
27,464 KB
testcase_27 AC 54 ms
33,128 KB
testcase_28 AC 45 ms
27,800 KB
testcase_29 AC 54 ms
33,036 KB
testcase_30 AC 43 ms
27,704 KB
testcase_31 AC 34 ms
26,524 KB
testcase_32 AC 34 ms
26,676 KB
testcase_33 AC 52 ms
31,392 KB
testcase_34 AC 32 ms
26,544 KB
testcase_35 AC 46 ms
30,444 KB
testcase_36 AC 54 ms
31,364 KB
testcase_37 AC 54 ms
31,236 KB
testcase_38 AC 53 ms
29,316 KB
testcase_39 AC 54 ms
33,068 KB
testcase_40 AC 53 ms
31,480 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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();
		int c = n;
		int ans = 0;
		for(int i=n; i>0; --i){
			if(m[i-1] == c){
				++ans;
				--c;
			}
		}
		Print(n-ans);
	}
	
	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();}
}
0