結果

問題 No.365 ジェンガソート
ユーザー #ラス+
提出日時 2019-10-11 08:02:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 838 bytes
コンパイル時間 1,206 ms
コンパイル使用メモリ 113,604 KB
実行使用メモリ 24,960 KB
最終ジャッジ日時 2024-11-24 00:25:07
合計ジャッジ時間 5,016 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.IO;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
class Start{
  static void Solve(){
    var n=int.Parse(ReadLine());
    var s=ReadLine().Split();
    var ans=n;
    for(int i=n-1;i>=0;i--)if(int.Parse(s[i])==ans)ans--;
    WriteLine(ans);
  }
  static void Main(){
    var sw=new StreamWriter(OpenStandardOutput()){AutoFlush=false};
    SetOut(sw);
    Solve();
    Out.Flush();
  }
  const long MOD=1000000007L;
  static void Swap<T>(ref T a,ref T b){T c=a;a=b;b=c;}
}
class Pair<T1,T2>:IComparable<Pair<T1,T2>>where T1:IComparable<T1>where T2:IComparable<T2>{
  public T1 F;public T2 S;
  public Pair(T1 f,T2 s){F=f;S=s;}
  public int CompareTo(Pair<T1,T2> p)=>F.CompareTo(p.F)!=0?F.CompareTo(p.F):S.CompareTo(p.S);
  public override string ToString()=>F+" "+S;
}
0