結果
| 問題 |
No.182 新規性の虜
|
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2015-11-19 09:03:11 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 111,340 KB |
| 実行使用メモリ | 32,360 KB |
| 最終ジャッジ日時 | 2024-09-13 17:00:47 |
| 合計ジャッジ時間 | 4,166 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 RE * 2 |
コンパイルメッセージ
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());
int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
Array.Sort(a);
int cnt = 0;
for (int i = 0; i < n - 2; i++)
{
if (a[i] != a[i + 1] && a[i + 1] != a[i + 2])
{
cnt++;
}
}
if (a[0] != a[1]) cnt++;
if (a[n - 2] != a[n - 1]) cnt++;
Console.WriteLine(cnt);
}
}
しらゆき