結果

問題 No.202 1円玉投げ
ユーザー mbanmban
提出日時 2017-07-11 19:29:35
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,691 bytes
コンパイル時間 3,599 ms
コンパイル使用メモリ 105,444 KB
実行使用メモリ 455,708 KB
最終ジャッジ日時 2023-08-23 23:34:01
合計ジャッジ時間 15,949 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 58 ms
24,836 KB
testcase_03 AC 59 ms
24,596 KB
testcase_04 AC 59 ms
22,648 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 163 ms
336,656 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 70 ms
27,408 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 60 ms
26,668 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 AC 74 ms
44,788 KB
testcase_35 AC 927 ms
105,780 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 AC 958 ms
108,776 KB
testcase_39 AC 92 ms
135,436 KB
testcase_40 AC 83 ms
92,140 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[40002, 40002];
    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]) + 20000;
            Y[i] = int.Parse(line[1]) + 20000;
        }
    }

    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