結果
| 問題 |
No.72 そろばん Med
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2018-10-03 20:42:29 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 543 bytes |
| コンパイル時間 | 939 ms |
| コンパイル使用メモリ | 103,808 KB |
| 実行使用メモリ | 18,304 KB |
| 最終ジャッジ日時 | 2024-10-12 10:27:31 |
| 合計ジャッジ時間 | 2,620 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic;
using System.Numerics;
using System;
public class Hello
{
public const int MOD = 1000007;
public static void Main()
{
var n = long.Parse(Console.ReadLine().Trim());
var a = new List<long>();
a.Add(n / 2L); a.Add(n / 2L + 1); a.Add(n / 2L - 1);
BigInteger ans = 0;
foreach (var x in a)
{
BigInteger t = -x * x + n * x + n;
ans = BigInteger.Max(ans, t);
}
ans %= MOD;
Console.WriteLine(ans);
}
}
bluemegane