結果
問題 | No.211 素数サイコロと合成数サイコロ (1) |
ユーザー |
|
提出日時 | 2020-03-28 00:15:56 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 1,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 1,005 ms |
コンパイル使用メモリ | 115,380 KB |
実行使用メモリ | 28,736 KB |
最終ジャッジ日時 | 2025-01-02 10:09:37 |
合計ジャッジ時間 | 3,146 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
コンパイルメッセージ
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 P0211 { public static void Main() { var k = int.Parse(Console.ReadLine().Trim()); var cands = new List<int>(); var primes = new int[]{2,3,5,7,11,13}; var comps = new int[]{4,6,8,9,10,12}; for(int i=0; i<6; i++) { for(int j=0; j<6; j++) { cands.Add(primes[i] * comps[j]); } } Console.WriteLine(cands.Where(c => c == k).Count() / 36.0); } }