結果

問題 No.455 冬の大三角
ユーザー kuuso1kuuso1
提出日時 2016-12-06 00:15:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,550 bytes
コンパイル時間 3,189 ms
コンパイル使用メモリ 106,516 KB
実行使用メモリ 24,956 KB
最終ジャッジ日時 2023-09-12 08:15:34
合計ジャッジ時間 9,477 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,692 KB
testcase_01 AC 62 ms
22,816 KB
testcase_02 AC 61 ms
20,880 KB
testcase_03 AC 62 ms
22,880 KB
testcase_04 AC 62 ms
24,824 KB
testcase_05 AC 62 ms
22,904 KB
testcase_06 AC 60 ms
22,864 KB
testcase_07 AC 62 ms
24,924 KB
testcase_08 AC 63 ms
22,832 KB
testcase_09 AC 61 ms
24,796 KB
testcase_10 AC 61 ms
22,988 KB
testcase_11 AC 61 ms
22,768 KB
testcase_12 AC 61 ms
22,944 KB
testcase_13 AC 61 ms
22,884 KB
testcase_14 AC 61 ms
24,816 KB
testcase_15 AC 60 ms
20,880 KB
testcase_16 AC 61 ms
22,864 KB
testcase_17 AC 61 ms
22,884 KB
testcase_18 AC 61 ms
22,788 KB
testcase_19 AC 60 ms
22,776 KB
testcase_20 AC 61 ms
22,872 KB
testcase_21 AC 61 ms
22,904 KB
testcase_22 AC 62 ms
24,864 KB
testcase_23 AC 62 ms
24,956 KB
testcase_24 AC 62 ms
22,868 KB
testcase_25 AC 61 ms
24,924 KB
testcase_26 AC 61 ms
22,884 KB
testcase_27 AC 60 ms
22,916 KB
testcase_28 AC 61 ms
22,904 KB
testcase_29 AC 61 ms
20,756 KB
testcase_30 AC 61 ms
22,788 KB
testcase_31 AC 63 ms
24,932 KB
testcase_32 AC 62 ms
24,904 KB
testcase_33 AC 61 ms
22,896 KB
testcase_34 AC 60 ms
22,908 KB
testcase_35 AC 62 ms
22,892 KB
testcase_36 AC 61 ms
22,792 KB
testcase_37 AC 61 ms
24,904 KB
testcase_38 AC 61 ms
22,780 KB
testcase_39 AC 61 ms
24,888 KB
testcase_40 AC 61 ms
24,852 KB
testcase_41 AC 62 ms
22,852 KB
testcase_42 AC 61 ms
22,880 KB
testcase_43 AC 61 ms
22,968 KB
testcase_44 AC 60 ms
22,904 KB
testcase_45 AC 61 ms
24,920 KB
testcase_46 AC 62 ms
24,764 KB
testcase_47 AC 62 ms
22,872 KB
testcase_48 AC 61 ms
20,904 KB
testcase_49 AC 61 ms
24,800 KB
testcase_50 AC 60 ms
20,844 KB
testcase_51 AC 61 ms
24,828 KB
testcase_52 AC 61 ms
22,804 KB
testcase_53 AC 60 ms
22,868 KB
testcase_54 AC 60 ms
24,924 KB
testcase_55 AC 61 ms
22,792 KB
testcase_56 AC 61 ms
24,900 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.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		List<int> Y = new List<int>();
		List<int> X = new List<int>();
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if(S[i][j]== '*'){
					X.Add(j);
					Y.Add(i);
				}
			}
		}
		
		var rnd = new Random();
		int ty,tx;
		Func<int,int,int,int,int> det = (a,b,c,d) => a*d-b*c;
		while(true){
			ty = rnd.Next(0,H);
			tx = rnd.Next(0,W);
			if( det(X[0]-tx,Y[0]-ty,X[1]-tx,Y[1]-ty) == 0 )continue;
			break;
		}
		
		for(int i=0;i<H;i++){
			var ca = S[i].ToCharArray();
			if(i == ty) ca[tx] = '*';
			Console.WriteLine(new String(ca));
		}
		
		
	}
	
	
	String[] S;
	int H,W;
	public Sol(){
		var d = ria();
		H = d[0];
		W = d[1];
		S = new String[H];
		for(int i=0;i<H;i++)S[i] = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0