結果
| 問題 |
No.713 素数の和
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-07-13 22:38:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 710 bytes |
| コンパイル時間 | 962 ms |
| コンパイル使用メモリ | 108,356 KB |
| 実行使用メモリ | 26,100 KB |
| 最終ジャッジ日時 | 2024-10-09 05:19:43 |
| 合計ジャッジ時間 | 1,833 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 3 |
コンパイルメッセージ
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;
namespace y
{
class Program
{
static void Main(string[] args)
{
var n = int.Parse(Console.ReadLine());
var s = new List<int>();
int a = 0;
for (int i = 2; i < n; i++)
{
if (s.Contains(i)) continue;
else
{
a += i;
int e = i;
int c = 2;
while (e * c <= n)
{
s.Add(e * c);
c++;
}
}
}
Console.WriteLine(a);
}
}
}
No