結果
| 問題 | 
                            No.316 もっと刺激的なFizzBuzzをください
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ken
                         | 
                    
| 提出日時 | 2018-07-15 10:41:43 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                MLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 704 bytes | 
| コンパイル時間 | 823 ms | 
| コンパイル使用メモリ | 114,620 KB | 
| 実行使用メモリ | 826,852 KB | 
| 最終ジャッジ日時 | 2024-10-15 04:38:57 | 
| 合計ジャッジ時間 | 4,096 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 4 | 
| other | AC * 2 MLE * 1 -- * 30 | 
コンパイルメッセージ
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