結果
| 問題 | No.1285 ゴミ捨て |
| コンテスト | |
| ユーザー |
キョウチク
|
| 提出日時 | 2022-05-16 15:13:07 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 339 ms / 2,000 ms |
| + 131µs | |
| コード長 | 697 bytes |
| 記録 | |
| コンパイル時間 | 2,285 ms |
| コンパイル使用メモリ | 84,528 KB |
| 実行使用メモリ | 53,900 KB |
| 最終ジャッジ日時 | 2026-08-26 22:43:38 |
| 合計ジャッジ時間 | 8,846 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
import java.util.*;
public class Test10 {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String line;
line=sc.nextLine();
int n=Integer.parseInt(line);
int[] cups=new int[n+1];
for(int i=0;i<n;i++){
line=sc.nextLine();
cups[i]=Integer.parseInt(line);
}
cups[n]=Integer.MAX_VALUE;
Arrays.sort(cups);
int max=0;
while(cups[0]<Integer.MAX_VALUE){
max++;
int tmp=0;
for(int i=0;cups[i]<Integer.MAX_VALUE;i++){
if(tmp<cups[i]){
tmp=cups[i]+1;
cups[i]=Integer.MAX_VALUE;
}
}
Arrays.sort(cups);
}
System.out.println(max);
sc.close();
}
}
キョウチク