結果
問題 | No.455 冬の大三角 |
ユーザー | zimpha |
提出日時 | 2017-04-02 13:54:28 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 2,735 bytes |
コンパイル時間 | 2,177 ms |
コンパイル使用メモリ | 77,564 KB |
実行使用メモリ | 37,432 KB |
最終ジャッジ日時 | 2024-06-30 01:04:24 |
合計ジャッジ時間 | 6,297 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 47 ms
37,044 KB |
testcase_01 | AC | 47 ms
37,092 KB |
testcase_02 | AC | 49 ms
37,272 KB |
testcase_03 | AC | 48 ms
37,304 KB |
testcase_04 | AC | 47 ms
37,156 KB |
testcase_05 | AC | 47 ms
37,184 KB |
testcase_06 | AC | 48 ms
37,084 KB |
testcase_07 | AC | 48 ms
37,100 KB |
testcase_08 | AC | 52 ms
36,828 KB |
testcase_09 | AC | 47 ms
37,144 KB |
testcase_10 | AC | 47 ms
37,160 KB |
testcase_11 | AC | 46 ms
36,812 KB |
testcase_12 | AC | 46 ms
37,180 KB |
testcase_13 | AC | 46 ms
36,692 KB |
testcase_14 | AC | 46 ms
36,724 KB |
testcase_15 | AC | 50 ms
37,152 KB |
testcase_16 | AC | 49 ms
37,032 KB |
testcase_17 | AC | 48 ms
37,140 KB |
testcase_18 | AC | 48 ms
36,804 KB |
testcase_19 | AC | 48 ms
36,844 KB |
testcase_20 | AC | 49 ms
37,272 KB |
testcase_21 | AC | 49 ms
36,716 KB |
testcase_22 | AC | 50 ms
37,304 KB |
testcase_23 | AC | 49 ms
36,920 KB |
testcase_24 | AC | 46 ms
37,236 KB |
testcase_25 | AC | 47 ms
37,284 KB |
testcase_26 | AC | 48 ms
36,832 KB |
testcase_27 | AC | 48 ms
36,692 KB |
testcase_28 | AC | 47 ms
37,080 KB |
testcase_29 | AC | 51 ms
37,188 KB |
testcase_30 | AC | 49 ms
37,004 KB |
testcase_31 | AC | 51 ms
37,312 KB |
testcase_32 | AC | 50 ms
37,228 KB |
testcase_33 | AC | 49 ms
37,048 KB |
testcase_34 | AC | 51 ms
37,064 KB |
testcase_35 | AC | 52 ms
36,808 KB |
testcase_36 | AC | 50 ms
36,704 KB |
testcase_37 | AC | 50 ms
37,300 KB |
testcase_38 | AC | 48 ms
37,072 KB |
testcase_39 | AC | 49 ms
36,968 KB |
testcase_40 | AC | 48 ms
36,712 KB |
testcase_41 | AC | 48 ms
36,932 KB |
testcase_42 | AC | 47 ms
37,432 KB |
testcase_43 | AC | 47 ms
37,080 KB |
testcase_44 | AC | 47 ms
36,704 KB |
testcase_45 | AC | 49 ms
37,320 KB |
testcase_46 | AC | 48 ms
36,820 KB |
testcase_47 | AC | 50 ms
36,792 KB |
testcase_48 | AC | 47 ms
37,332 KB |
testcase_49 | AC | 51 ms
37,044 KB |
testcase_50 | AC | 46 ms
37,280 KB |
testcase_51 | AC | 50 ms
37,132 KB |
testcase_52 | AC | 49 ms
37,312 KB |
testcase_53 | AC | 48 ms
36,840 KB |
testcase_54 | AC | 47 ms
37,172 KB |
testcase_55 | AC | 46 ms
36,828 KB |
testcase_56 | AC | 48 ms
36,708 KB |
ソースコード
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Chiaki.Hoshinomori */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Task455 solver = new Task455(); solver.solve(1, in, out); out.close(); } static class Task455 { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int m = in.nextInt(); char[][] s = new char[n][]; int x1 = -1, y1 = -1; int x2 = -1, y2 = -1; for (int i = 0; i < n; i++) { s[i] = in.next().toCharArray(); for (int j = 0; j < m; j++) { if (s[i][j] == '*') { if (x1 == -1) { x1 = i; y1 = j; } else { x2 = i; y2 = j; } } } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (s[i][j] == '*') continue; if ((x2 - x1) * (j - y1) - (i - x1) * (y2 - y1) != 0) { s[i][j] = '*'; for (int k = 0; k < n; k++) { out.println(s[k]); } return; } } } } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }