結果
| 問題 | No.112 ややこしい鶴亀算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-02 18:13:17 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 5,000 ms |
| コード長 | 457 bytes |
| 記録 | |
| コンパイル時間 | 1,743 ms |
| コンパイル使用メモリ | 83,320 KB |
| 実行使用メモリ | 42,216 KB |
| 最終ジャッジ日時 | 2026-04-18 04:16:55 |
| 合計ジャッジ時間 | 7,193 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt(),a[]=new int[50],m=0,s1=0,s2=0,t=0,i;
for(i=0;i<n;i++) {
a[i]=sc.nextInt();
if(a[i]>m) m=a[i];
if(i>0&&a[i-1]!=a[i]) t++;
}
sc.close();
for(i=0;i<n;i++) {
if(m>a[i]) s2++;
else s1++;
}
if(1>t&&m/(n-1)>2) System.out.print(s2+" "+s1);
else System.out.print(s1+" "+s2);
}
}