結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー NoNo
提出日時 2018-04-28 00:57:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 1,578 bytes
コンパイル時間 2,124 ms
コンパイル使用メモリ 100,288 KB
実行使用メモリ 29,476 KB
最終ジャッジ日時 2023-09-10 07:38:08
合計ジャッジ時間 4,133 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,412 KB
testcase_01 AC 60 ms
22,564 KB
testcase_02 AC 61 ms
20,664 KB
testcase_03 AC 60 ms
20,772 KB
testcase_04 AC 67 ms
22,144 KB
testcase_05 AC 65 ms
28,040 KB
testcase_06 AC 65 ms
28,432 KB
testcase_07 AC 62 ms
29,192 KB
testcase_08 AC 65 ms
27,388 KB
testcase_09 AC 64 ms
28,428 KB
testcase_10 AC 63 ms
28,176 KB
testcase_11 AC 64 ms
27,136 KB
testcase_12 AC 64 ms
27,452 KB
testcase_13 AC 65 ms
27,524 KB
testcase_14 AC 66 ms
29,476 KB
testcase_15 AC 65 ms
28,056 KB
testcase_16 AC 63 ms
26,168 KB
testcase_17 AC 65 ms
28,212 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.Generic;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int lb = int.Parse(ss[1]);
            int rb = int.Parse(ss[2]);

            var m = new int[1280, 1680];

            for (int i = 1; i <= n; i++)
            {
                ss = Console.ReadLine().Split();
                var xl = int.Parse(ss[0]);
                var yu = int.Parse(ss[1]);
                var xr = int.Parse(ss[2]);
                var yd = int.Parse(ss[3]);

                if (xl < 0) xl = 1;
                if (xr > 1280) xr = 1280;
                if (yu < 0) yu = 1;
                if (yd > 1680) yd = 1680;


                for (int j = xl - 1; j <= xr - 1; j++)
                {
                    for (int k = yu - 1; k <= yd - 1; k++)
                    {
                      m[j, k] = i;
                    }
                }
            }

            var ans = new List<int>();
            for (int i = lb -1; i <= rb - 1; i++)
            {
                for (int j = 1679; j >= 0; j--)
                {
                    if (m[i, j] != 0)
                    {
                        ans.Add(m[i, j]);
                        break;
                    }
                }
            }

            for (int i = 1; i <= n; i++)
            {
                Console.WriteLine(ans.Contains(i) ? 1 : 0);
            }
            Console.ReadLine();
        }
    }
}
0