結果
| 問題 |
No.9005 実行時間/使用メモリテスト(テスト用)
|
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-08-24 14:43:37 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 82 ms / 3,000 ms |
| コード長 | 875 bytes |
| コンパイル時間 | 1,819 ms |
| コンパイル使用メモリ | 105,344 KB |
| 実行使用メモリ | 25,984 KB |
| 最終ジャッジ日時 | 2024-11-08 02:02:56 |
| 合計ジャッジ時間 | 3,014 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 |
コンパイルメッセージ
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;
namespace EratosthenesCS
{
class Program
{
readonly static int N = 5000000;
static List<int> SieveOfEratosthenes(int n)
{
bool[] isPrime = Enumerable.Repeat(true, n).ToArray();
var primes = new List<int>();
isPrime[0] = isPrime[1] = false;
for (int i = 2; i < n; i++)
{
if (isPrime[i])
{
primes.Add(i);
for (int j = 2 * i; j < n; j += i)
{
isPrime[j] = false;
}
}
}
return primes;
}
static void Main(string[] args)
{
var _ = SieveOfEratosthenes(N);
Console.WriteLine(0);
}
}
}
はむ吉🐹