結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2020-05-05 17:10:24 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 745 ms |
コンパイル使用メモリ | 103,040 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-06-26 21:41:29 |
合計ジャッジ時間 | 1,903 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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(string[] args){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);}}