結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2020-05-05 17:06:51 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 2,537 ms |
コンパイル使用メモリ | 109,552 KB |
実行使用メモリ | 27,836 KB |
最終ジャッジ日時 | 2024-06-26 21:38:13 |
合計ジャッジ時間 | 3,379 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; 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); } }