結果
| 問題 |
No.106 素数が嫌い!2
|
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2015-11-24 23:15:55 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 766 bytes |
| コンパイル時間 | 757 ms |
| コンパイル使用メモリ | 106,180 KB |
| 実行使用メモリ | 27,264 KB |
| 最終ジャッジ日時 | 2024-09-13 17:22:24 |
| 合計ジャッジ時間 | 13,193 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 12 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Program
{
static void Main()
{
var temp = Console.ReadLine().Split();
int n = int.Parse(temp[0]);
int k = int.Parse(temp[1]);
int ans = 0;
for (int i = 2; i <= n; i++)
{
int cnt = 0;
int t = i;
for (int j = 2; j <= i; j++)
{
if (t % j == 0) cnt++;
else continue;
if (cnt >= k)
{
ans++;
break;
}
while (true)
{
if (t % j == 0) t /= j;
else break;
}
}
}
Console.WriteLine(ans);
}
}
しらゆき