結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2020-05-05 17:08:35 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 962 ms |
コンパイル使用メモリ | 107,500 KB |
実行使用メモリ | 27,840 KB |
最終ジャッジ日時 | 2024-06-26 21:39:10 |
合計ジャッジ時間 | 2,215 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 2 WA * 15 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; class test1 { static void Main() { int n = int.Parse(Console.ReadLine()); int a = 1; int b = 2; int c = 3; int bp = (n == 1) ? a : b; const int r = 1000000007; for (int i = 3; i < n; i++) { bp = (b + c > r) ? (b + c) % r : (b + c); c = b; b = a; a = bp; } Console.WriteLine(bp); } }