結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
|
提出日時 | 2018-07-25 15:56:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 319 bytes |
コンパイル時間 | 288 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-26 09:41:42 |
合計ジャッジ時間 | 1,908 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
N = int(input()) l = list(map(int, input().split())) f1 = l[0] f2 = 0 c1 = 0 c2 = 0 for i in l: if i == f1: c1 += 1 else: f2 = i c2 += 1 if f2 == 0: if f1 == 2 * (N-1): print(c1,0) else: print(0,c1) elif f2 > f1: print(c2,c1) elif f1 > f2: print(c1,c2)