結果

問題 No.365 ジェンガソート
コンテスト
ユーザー ebicochineal
提出日時 2016-05-12 16:52:29
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 1,036 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,053 ms
コンパイル使用メモリ 105,472 KB
実行使用メモリ 27,008 KB
最終ジャッジ日時 2026-04-28 13:10:23
合計ジャッジ時間 6,328 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

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();}
}
0