結果

問題 No.906 Y字グラフ
ユーザー tomomo2b2tomomo2b2
提出日時 2019-10-11 22:10:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 1,796 ms
コンパイル使用メモリ 110,788 KB
実行使用メモリ 18,688 KB
最終ジャッジ日時 2024-11-25 07:40:28
合計ジャッジ時間 3,650 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Numerics;

class MyClass
{
    public static void Solve()
    {
        var N = BigInteger.Parse(Console.ReadLine());
        var X = (N - 1) * (N - 1) / 12;
        if (N % 6 == 4)
        {
            X++;
        }
        Console.WriteLine(X % 1000000007);
    }

    public static void Main()
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}
0