結果

問題 No.365 ジェンガソート
ユーザー ebicochinealebicochineal
提出日時 2016-05-10 20:40:52
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,041 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 112,984 KB
実行使用メモリ 32,396 KB
最終ジャッジ日時 2024-04-15 15:05:26
合計ジャッジ時間 4,050 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
19,328 KB
testcase_01 AC 28 ms
19,328 KB
testcase_02 AC 28 ms
18,944 KB
testcase_03 AC 28 ms
19,200 KB
testcase_04 AC 29 ms
19,072 KB
testcase_05 AC 28 ms
19,072 KB
testcase_06 AC 29 ms
18,944 KB
testcase_07 AC 28 ms
19,072 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 27 ms
19,200 KB
testcase_15 AC 28 ms
19,200 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 35 ms
20,352 KB
testcase_19 AC 63 ms
25,984 KB
testcase_20 AC 42 ms
21,136 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 65 ms
26,368 KB
testcase_37 AC 66 ms
26,368 KB
testcase_38 WA -
testcase_39 AC 64 ms
26,624 KB
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = 0;
		int ans = 0;
		for(int i=n; i>0; --i){
			if(m[i-1] == n){
				ans += c;
				c = 0;
				--n;
			}else{
				++c;
			}
		}
		Print(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