結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2015-12-27 08:59:41 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 2,355 ms |
コンパイル使用メモリ | 108,516 KB |
実行使用メモリ | 28,672 KB |
最終ジャッジ日時 | 2024-09-19 07:22:05 |
合計ジャッジ時間 | 2,181 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 2 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;class Program{static void Main(){long n = long.Parse(Console.ReadLine());var a = new int[n];var b = new int[n];var c = new int[n];a[0] = 1;int m = 1000000007;for (int i = 1; i < n; i++){a[i] = c[i - 1] % m;b[i] = a[i - 1] % m;c[i] = (a[i - 1] + b[i - 1]) % m;}Console.WriteLine((a[n - 1] + b[n - 1] + c[n - 1]) % m);}}