結果

問題 No.365 ジェンガソート
ユーザー hogeki
提出日時 2016-07-30 12:29:34
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 110,516 KB
実行使用メモリ 25,472 KB
最終ジャッジ日時 2024-11-06 21:02:21
合計ジャッジ時間 4,500 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace JengaSort
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] a = new int[N];
            string[] vals = Console.ReadLine().Split(' ');

            for(int i=0; i < N; i++)
            {
                a[i] = int.Parse(vals[i]);
            }

            int max = 0;
            int count = 0;

            for(int i=0; i< N; i++)
            {
                if (a[i] < max)
                {
                    count++;
                }
                else
                {
                    max = a[i];
                }
            }

            Console.WriteLine(count);
        }
    }
}
0