結果
| 問題 |
No.354 メルセンヌ素数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-17 23:48:35 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 1,622 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 18,304 KB |
| 最終ジャッジ日時 | 2024-10-14 13:59:34 |
| 合計ジャッジ時間 | 2,393 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
public class yukicoder
{
public static void Main()
{
double n = double.Parse(Console.ReadLine());
string s = Convert.ToString((int)Math.Pow(2, n) - 1, 2);
int ans = 0;
foreach(char c in s)
{
if(char.IsDigit(c))
ans = ans + int.Parse(c.ToString());
}
Console.WriteLine(ans);
}
}