結果
| 問題 |
No.1882 Areas of Triangle
|
| ユーザー |
|
| 提出日時 | 2023-05-10 02:01:55 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 765 bytes |
| コンパイル時間 | 7,703 ms |
| コンパイル使用メモリ | 167,024 KB |
| 実行使用メモリ | 89,428 KB |
| 最終ジャッジ日時 | 2024-11-26 09:44:42 |
| 合計ジャッジ時間 | 20,204 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 15 WA * 6 TLE * 3 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (98 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main(string[] args)
{
var input = Console.ReadLine().Split().Select(long.Parse).ToArray();
var N = (int)input[0];
var K = input[1];
var A = Console.ReadLine().Split().Select(int.Parse).ToArray();
Array.Sort(A);
var count = 0;
for (int i = 0; i < N; i++)
{
for (int j = i; j < N; j++)
{
double S = A[i] * A[j] / 2.0;
if (S >= K)
{
count += (N - j) * 2;
if (i == j) count--;
break;
}
}
}
Console.WriteLine(count);
}
}