結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー |
|
提出日時 | 2017-08-10 03:48:08 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 4,548 ms |
コンパイル使用メモリ | 114,928 KB |
実行使用メモリ | 19,456 KB |
最終ジャッジ日時 | 2024-10-12 01:08:22 |
合計ジャッジ時間 | 4,149 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList(); a.Sort(); int turu = 0; int kame = 0; if (a[0] == a[n - 1]) { if (a[0] / (n - 1) == 2) turu = n; else kame = n; } else { kame = a.IndexOf(a[n - 1]); turu = n - kame; } Console.WriteLine(turu + " " + kame); } }