結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-26 11:45:54 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 628 bytes |
| コンパイル時間 | 4,133 ms |
| コンパイル使用メモリ | 102,400 KB |
| 実行使用メモリ | 25,472 KB |
| 最終ジャッジ日時 | 2024-06-28 16:12:03 |
| 合計ジャッジ時間 | 5,723 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Program{
static void Main(string[]args){
int N=int.Parse(Console.ReadLine());
string[]t=Console.ReadLine().Split(' ');
int[]a=new int[N];
int count=0;
int y=0;
int max=0;
for(int i=0;i<N;i++){
a[i]=int.Parse(t[i]);
}
for(int i=0;i<N;i++){
if(y<a[i]){
y=a[i];
}else{
max=Math.Max(max,a[i]);
}
}
for(int i=0;i<N;i++){
if(a[i]<=max)count++;
}
Console.WriteLine(count);
}
}