結果
| 問題 |
No.72 そろばん Med
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2018-10-03 20:53:00 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 569 bytes |
| コンパイル時間 | 964 ms |
| コンパイル使用メモリ | 110,604 KB |
| 実行使用メモリ | 26,768 KB |
| 最終ジャッジ日時 | 2024-10-12 10:27:53 |
| 合計ジャッジ時間 | 2,677 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 9 |
コンパイルメッセージ
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 = BigInteger.Parse(Console.ReadLine().Trim()) % MOD;
var a = new List<BigInteger>();
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) % MOD;
ans = BigInteger.Max(ans, t);
}
ans %= MOD;
Console.WriteLine(ans);
}
}
bluemegane