結果

問題 No.245 貫け!
ユーザー nebukuro09nebukuro09
提出日時 2016-11-10 13:28:49
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 998 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 99,108 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-02 22:49:49
合計ジャッジ時間 1,736 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,368 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 1 ms
4,372 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,368 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 8 ms
4,372 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;

int N;
int Pa, Pb;

void main() {
  int N = readln.chomp.to!int;
  auto p = iota(N).map!(_ => readln.split.map!(to!int).array).array;

  int ans;
  int[4] e1 = [0, 0, 2, 2];
  int[4] e2 = [0, 2, 0, 2];
  foreach (i; 0..N)
    foreach (j; i+1..N)
      foreach (e; 0..4) {
        int tmp_ans;
        int p1x = p[i][e1[e]];
        int p1y = p[i][e1[e]+1];
        int p2x = p[i][e2[e]];
        int p2y = p[i][e2[e]+1];
        foreach (k; 0..N) {
          int p3x = p[k][0];
          int p3y = p[k][1];
          int p4x = p[k][2];
          int p4y = p[k][3];
          if (((p1x - p2x) * (p3y - p1y) + (p1y - p2y) * (p1x - p3x)) *
              ((p1x - p2x) * (p4y - p1y) + (p1y - p2y) * (p1x - p4x)) < 0)
            tmp_ans++;
        }
        ans = max(ans, tmp_ans+2);
      }
  writeln(ans);
}
0