結果
問題 | No.455 冬の大三角 |
ユーザー | zimpha |
提出日時 | 2017-04-02 13:52:06 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 2,735 bytes |
コンパイル時間 | 2,239 ms |
コンパイル使用メモリ | 78,148 KB |
実行使用メモリ | 37,368 KB |
最終ジャッジ日時 | 2024-07-08 00:05:04 |
合計ジャッジ時間 | 7,147 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 47 ms
36,964 KB |
testcase_01 | RE | - |
testcase_02 | AC | 47 ms
37,148 KB |
testcase_03 | AC | 46 ms
36,876 KB |
testcase_04 | AC | 49 ms
37,272 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 47 ms
37,068 KB |
testcase_08 | AC | 50 ms
36,644 KB |
testcase_09 | AC | 47 ms
36,852 KB |
testcase_10 | RE | - |
testcase_11 | AC | 48 ms
36,888 KB |
testcase_12 | RE | - |
testcase_13 | AC | 47 ms
37,092 KB |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | WA | - |
testcase_17 | RE | - |
testcase_18 | AC | 47 ms
37,244 KB |
testcase_19 | AC | 46 ms
37,064 KB |
testcase_20 | AC | 47 ms
36,992 KB |
testcase_21 | RE | - |
testcase_22 | WA | - |
testcase_23 | RE | - |
testcase_24 | WA | - |
testcase_25 | RE | - |
testcase_26 | AC | 48 ms
37,128 KB |
testcase_27 | AC | 48 ms
37,188 KB |
testcase_28 | AC | 49 ms
37,120 KB |
testcase_29 | RE | - |
testcase_30 | AC | 49 ms
37,268 KB |
testcase_31 | RE | - |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | AC | 50 ms
37,016 KB |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | AC | 49 ms
37,232 KB |
testcase_41 | RE | - |
testcase_42 | AC | 48 ms
37,136 KB |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | AC | 48 ms
37,292 KB |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | AC | 48 ms
36,992 KB |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | AC | 49 ms
37,152 KB |
testcase_55 | AC | 49 ms
37,260 KB |
testcase_56 | RE | - |
ソースコード
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 < n; 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 < n; j++) { if (s[i][j] == '*') continue; if ((x2 - x1) * (j - y1) - (i - x1) * (y2 - x2) != 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()); } } }