結果
| 問題 | No.316 もっと刺激的なFizzBuzzをください |
| コンテスト | |
| ユーザー |
ken
|
| 提出日時 | 2018-07-15 10:41:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 704 bytes |
| 記録 | |
| コンパイル時間 | 1,651 ms |
| コンパイル使用メモリ | 109,608 KB |
| 実行使用メモリ | 1,302,756 KB |
| 最終ジャッジ日時 | 2026-05-02 23:01:05 |
| 合計ジャッジ時間 | 5,026 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 2 MLE * 2 -- * 29 |
コンパイルメッセージ
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;
public class CountDivisors{
static void AddDiv(HashSet<long> h, long x, long n){
for(long i = x; i <= n; i+=x){
h.Add(i);
}
}
public static void Main(){
var n = long.Parse(Console.ReadLine());
var input = Console.ReadLine();
var inputArr = input.Split(' ');
var a = long.Parse(inputArr[0]);
var b = long.Parse(inputArr[1]);
var c = long.Parse(inputArr[2]);
var divSet = new HashSet<long>(new long[]{});
AddDiv(divSet, a, n);
AddDiv(divSet, b, n);
AddDiv(divSet, c, n);
Console.WriteLine(divSet.Count);
}
}
ken