結果
問題 |
No.557 点対称
|
ユーザー |
![]() |
提出日時 | 2017-08-12 00:07:52 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,231 bytes |
コンパイル時間 | 762 ms |
コンパイル使用メモリ | 110,372 KB |
実行使用メモリ | 30,572 KB |
最終ジャッジ日時 | 2024-10-12 22:25:46 |
合計ジャッジ時間 | 4,538 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 RE * 4 TLE * 1 -- * 21 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; namespace y { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); bool f = false; if (n % 2 == 0) f = true; else f = false; if (n == 1) { Console.WriteLine(2); return; } int cnt = 0; if (f) { cnt = n / 2 - 1; } else { cnt = n / 2; } long ans = 1; for (int i = 1; i <= cnt; i++) { if (i == 1) { ans = ans * 4 % 1000000007; } else { ans = ans * 5 % 1000000007; } } if (n != 2) { if (f) { ans = ans * 5 % 1000000007; } else { ans = ans * 3 % 1000000007; } } Console.WriteLine(ans); Console.ReadLine(); } } }