結果
問題 | No.72 そろばん Med |
ユーザー |
![]() |
提出日時 | 2018-10-03 20:45:49 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 36 ms / 5,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 1,680 ms |
コンパイル使用メモリ | 103,296 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-10-12 10:27:37 |
合計ジャッジ時間 | 2,881 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
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());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;ans = BigInteger.Max(ans, t);}ans %= MOD;Console.WriteLine(ans);}}