結果
問題 | No.849 yuki国の分割統治 |
ユーザー | vwxyz |
提出日時 | 2023-11-29 13:45:35 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,143 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 26,928 KB |
最終ジャッジ日時 | 2023-11-29 13:45:43 |
合計ジャッジ時間 | 7,453 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
11,008 KB |
testcase_01 | AC | 39 ms
11,008 KB |
testcase_02 | AC | 38 ms
11,008 KB |
testcase_03 | AC | 38 ms
11,008 KB |
testcase_04 | AC | 38 ms
11,008 KB |
testcase_05 | AC | 38 ms
11,008 KB |
testcase_06 | AC | 39 ms
11,008 KB |
testcase_07 | WA | - |
testcase_08 | AC | 259 ms
17,720 KB |
testcase_09 | AC | 269 ms
16,188 KB |
testcase_10 | AC | 276 ms
12,796 KB |
testcase_11 | AC | 244 ms
16,184 KB |
testcase_12 | AC | 257 ms
12,288 KB |
testcase_13 | AC | 280 ms
16,444 KB |
testcase_14 | AC | 268 ms
13,820 KB |
testcase_15 | AC | 248 ms
17,336 KB |
testcase_16 | AC | 286 ms
22,120 KB |
testcase_17 | AC | 273 ms
11,136 KB |
testcase_18 | AC | 316 ms
21,692 KB |
testcase_19 | AC | 283 ms
13,308 KB |
testcase_20 | AC | 315 ms
18,620 KB |
testcase_21 | AC | 247 ms
11,008 KB |
testcase_22 | AC | 191 ms
14,848 KB |
testcase_23 | AC | 185 ms
14,592 KB |
testcase_24 | AC | 173 ms
11,776 KB |
testcase_25 | AC | 309 ms
26,928 KB |
testcase_26 | AC | 37 ms
11,008 KB |
testcase_27 | AC | 38 ms
11,008 KB |
testcase_28 | AC | 38 ms
11,008 KB |
testcase_29 | AC | 38 ms
11,008 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') #sys.set_int_max_str_digits(10**9) a,b,c,d=map(int,readline().split()) N=int(readline()) se=set() if a*d==b*c: gx=GCD(a,c) gy=GCD(b,d) for n in range(N): x,y=map(int,readline().split()) se.add((x*gy-y*gx)) else: for n in range(N): x,y=map(int,readline().split()) se.add(((d*x-c*y)%abs(a*d-b*c),(-b*x+a*y)%abs(a*d-b*c))) ans=len(se) print(ans)