結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2020-05-05 17:13:55 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 1,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 767 ms |
コンパイル使用メモリ | 105,880 KB |
実行使用メモリ | 25,944 KB |
最終ジャッジ日時 | 2024-06-26 21:45:37 |
合計ジャッジ時間 | 2,373 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
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 = 2;int bp = (n == 1) ? a : b;int r = 1000000007;for (int i = 3; i < n; i++){bp = (b + a > r) ? (b + a) % r : (b + a);a = b;b = c;c = bp;}Console.WriteLine(bp);}}