結果

問題 No.455 冬の大三角
ユーザー くれちーくれちー
提出日時 2016-12-05 22:42:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 1,111 bytes
コンパイル時間 2,226 ms
コンパイル使用メモリ 106,956 KB
実行使用メモリ 27,288 KB
最終ジャッジ日時 2023-09-12 08:07:57
合計ジャッジ時間 8,501 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
25,064 KB
testcase_01 AC 62 ms
25,120 KB
testcase_02 AC 62 ms
23,068 KB
testcase_03 AC 61 ms
23,308 KB
testcase_04 AC 62 ms
23,088 KB
testcase_05 AC 62 ms
23,068 KB
testcase_06 AC 61 ms
23,088 KB
testcase_07 AC 61 ms
23,168 KB
testcase_08 AC 63 ms
23,096 KB
testcase_09 AC 61 ms
23,204 KB
testcase_10 AC 60 ms
23,180 KB
testcase_11 AC 61 ms
23,132 KB
testcase_12 AC 61 ms
27,288 KB
testcase_13 AC 61 ms
23,368 KB
testcase_14 AC 61 ms
23,160 KB
testcase_15 AC 61 ms
23,136 KB
testcase_16 AC 61 ms
23,088 KB
testcase_17 AC 61 ms
23,144 KB
testcase_18 AC 60 ms
21,128 KB
testcase_19 AC 62 ms
23,164 KB
testcase_20 AC 61 ms
23,084 KB
testcase_21 AC 62 ms
25,104 KB
testcase_22 AC 61 ms
23,132 KB
testcase_23 AC 61 ms
23,136 KB
testcase_24 AC 61 ms
21,060 KB
testcase_25 AC 61 ms
23,152 KB
testcase_26 AC 62 ms
23,136 KB
testcase_27 AC 62 ms
23,284 KB
testcase_28 AC 62 ms
25,200 KB
testcase_29 AC 64 ms
25,164 KB
testcase_30 AC 63 ms
23,116 KB
testcase_31 AC 63 ms
25,204 KB
testcase_32 AC 62 ms
23,132 KB
testcase_33 AC 63 ms
23,172 KB
testcase_34 AC 62 ms
23,240 KB
testcase_35 AC 63 ms
25,116 KB
testcase_36 AC 62 ms
23,096 KB
testcase_37 AC 63 ms
23,112 KB
testcase_38 AC 63 ms
23,064 KB
testcase_39 AC 63 ms
23,184 KB
testcase_40 AC 63 ms
25,140 KB
testcase_41 AC 63 ms
23,140 KB
testcase_42 AC 63 ms
23,088 KB
testcase_43 AC 62 ms
23,240 KB
testcase_44 AC 63 ms
23,024 KB
testcase_45 AC 62 ms
23,140 KB
testcase_46 AC 62 ms
23,080 KB
testcase_47 AC 64 ms
25,204 KB
testcase_48 AC 63 ms
23,084 KB
testcase_49 AC 61 ms
25,136 KB
testcase_50 AC 62 ms
23,140 KB
testcase_51 AC 61 ms
23,064 KB
testcase_52 AC 62 ms
23,172 KB
testcase_53 AC 62 ms
21,152 KB
testcase_54 AC 62 ms
25,272 KB
testcase_55 AC 62 ms
23,256 KB
testcase_56 AC 62 ms
23,120 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 P = System.Numerics.Complex;

class Program
{
    static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');
        int h = int.Parse(str[0]);
        int w = int.Parse(str[1]);

        var s = new List<char[]>(3);
        var star = new List<P>(3);

        for (int i = 0; i < h; i++)
        {
            s.Add(Console.ReadLine().ToCharArray());
            for (int j = 0; j < w; j++)
                if (s[i][j] == '*') star.Add(new P(i, j));
        }

        var rand = new Random();
        int sh, sw;

        while (true)
        {
            sh = rand.Next(h);
            sw = rand.Next(w);
            if (star.Count < 3) star.Add(new P(sh, sw));
            else star[2] = new P(sh, sw);
            P vec1 = star[1] - star[0];
            P vec2 = star[2] - star[0];
            if (vec1.Real * vec2.Imaginary - vec1.Imaginary * vec2.Real != 0)
            {
                s[sh][sw] = '*';
                for (int i = 0; i < h; i++) Console.WriteLine(s[i]);
                return;
            }
        }
    }
}
0