結果

問題 No.202 1円玉投げ
ユーザー mbanmban
提出日時 2017-07-11 19:31:00
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,691 bytes
コンパイル時間 2,280 ms
コンパイル使用メモリ 104,164 KB
実行使用メモリ 628,488 KB
最終ジャッジ日時 2023-08-23 23:34:43
合計ジャッジ時間 30,489 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,037 ms
327,368 KB
testcase_01 MLE -
testcase_02 AC 74 ms
26,720 KB
testcase_03 AC 63 ms
26,584 KB
testcase_04 AC 62 ms
26,736 KB
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 AC 1,040 ms
429,952 KB
testcase_17 AC 954 ms
136,392 KB
testcase_18 AC 952 ms
140,552 KB
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 AC 178 ms
397,180 KB
testcase_23 AC 175 ms
398,748 KB
testcase_24 AC 71 ms
61,744 KB
testcase_25 AC 71 ms
61,536 KB
testcase_26 AC 71 ms
27,392 KB
testcase_27 AC 70 ms
26,468 KB
testcase_28 AC 62 ms
26,612 KB
testcase_29 AC 62 ms
26,512 KB
testcase_30 AC 166 ms
391,488 KB
testcase_31 AC 63 ms
28,700 KB
testcase_32 AC 228 ms
420,952 KB
testcase_33 AC 73 ms
46,016 KB
testcase_34 AC 75 ms
39,116 KB
testcase_35 AC 938 ms
103,852 KB
testcase_36 AC 1,254 ms
419,364 KB
testcase_37 MLE -
testcase_38 AC 968 ms
106,672 KB
testcase_39 AC 95 ms
133,536 KB
testcase_40 AC 83 ms
92,264 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

class Magatro
{

    private int N;
    private int[] X, Y;

    bool[,] B = new bool[40050, 40050];
    private int[] Lx, Ly;

    private void Scan()
    {
        N = int.Parse(Console.ReadLine());
        X = new int[N];
        Y = new int[N];
        for (int i = 0; i < N; i++)
        {
            var line = Console.ReadLine().Split(' ');
            X[i] = int.Parse(line[0]) + 20020;
            Y[i] = int.Parse(line[1]) + 20020;
        }
    }

    private void CalcL()
    {
        var resultX = new List<int>();
        var resultY = new List<int>();
        for (int x = -20; x <= 20; x++)
        {
            for (int y = -20; y <= 20; y++)
            {
                if (Math.Sqrt(x * x + y * y) < 20)
                {
                    resultX.Add(x);
                    resultY.Add(y);
                }
            }
        }
        Lx = resultX.ToArray();
        Ly = resultY.ToArray();
    }

    private bool C(int n)
    {
        if (B[X[n], Y[n]]) return false;

        for (int i = 0; i < Lx.Length; i++)
        {
            B[X[n] + Lx[i], Y[n] + Ly[i]] = true;
        }
        return true;
    }

    public void Solve()
    {
        Scan();
        CalcL();
        int ans = 0;
        for (int i = 0; i < N; i++)
        {
            if (C(i))
            {
                ans++;
            }
        }
        Console.WriteLine(ans);
    }
}
0