結果
問題 | No.1935 Water Simulation |
ユーザー | misonikomipan |
提出日時 | 2022-05-13 22:10:56 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,522 bytes |
コンパイル時間 | 804 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,280 KB |
最終ジャッジ日時 | 2024-07-22 02:06:09 |
合計ジャッジ時間 | 3,845 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 66 ms
17,152 KB |
testcase_05 | AC | 64 ms
17,280 KB |
testcase_06 | AC | 65 ms
17,024 KB |
testcase_07 | AC | 64 ms
17,152 KB |
testcase_08 | AC | 65 ms
17,152 KB |
testcase_09 | AC | 64 ms
17,024 KB |
testcase_10 | AC | 67 ms
17,024 KB |
testcase_11 | AC | 64 ms
17,024 KB |
testcase_12 | AC | 63 ms
17,024 KB |
testcase_13 | AC | 62 ms
17,280 KB |
testcase_14 | AC | 63 ms
17,280 KB |
testcase_15 | AC | 63 ms
17,024 KB |
testcase_16 | AC | 63 ms
17,024 KB |
testcase_17 | AC | 63 ms
17,024 KB |
testcase_18 | AC | 63 ms
17,280 KB |
testcase_19 | AC | 64 ms
16,896 KB |
testcase_20 | AC | 64 ms
17,148 KB |
testcase_21 | AC | 63 ms
16,896 KB |
testcase_22 | AC | 63 ms
17,024 KB |
testcase_23 | AC | 65 ms
17,280 KB |
testcase_24 | AC | 63 ms
16,896 KB |
testcase_25 | AC | 64 ms
17,152 KB |
testcase_26 | AC | 64 ms
17,280 KB |
testcase_27 | AC | 65 ms
17,024 KB |
testcase_28 | AC | 65 ms
17,024 KB |
testcase_29 | AC | 65 ms
17,024 KB |
testcase_30 | AC | 64 ms
17,024 KB |
testcase_31 | AC | 64 ms
17,152 KB |
ソースコード
import nntplib import sys import math import heapq from collections import deque, Counter, defaultdict from sys import stdin INF = 10 ** 7 int1 = lambda x: int(x) - 1 stinput = lambda: stdin.readline()[:-1] ii = lambda: int(stinput()) # int input mi = lambda: map(int, stdin.readline().split()) # map input (int) li = lambda: list(mi()) # list input (int) mi1 = lambda: map(int1, stdin.readline().split()) # map input (int)-1 li1 = lambda: list(mi1()) # list input (int)-1 mis = lambda: map(str, stdin.readline().split()) # map input (string) lis = lambda: list(mis()) # list input (string) *V, N = mi() nV = [V[i] if not(i) else 0 for i in range(4)] d = {(V[0], 0, 0, 0): 0} d2 = {0: (V[0], 0, 0, 0)} for n in range(N): pV = [nV[i] for i in range(4)] if n % 4 == 0: nV[1] = min(V[1], pV[1] + pV[0]) nV[0] = pV[0] - (nV[1] - pV[1]) elif n % 4 == 1: nV[2] = min(V[2], pV[2] + pV[1]) nV[1] = pV[1] - (nV[2] - pV[2]) elif n % 4 == 2: nV[3] = min(V[3], pV[3] + pV[2]) nV[2] = pV[2] - (nV[3] - pV[3]) else: nV[0] = min(V[0], pV[0] + pV[3]) nV[3] = pV[3] - (nV[0] - pV[0]) tnV = tuple(nV) if tnV in d: d[(N, N, N, N)] = n + 1 d2[n + 1] = tnV roopStart = d[tnV] roopEnd = n + 1 a = nV break else: d[tnV] = n + 1 d2[n + 1] = tnV if n == N - 1: print(*nV) exit() ind = roopStart + (N - roopStart) % (roopEnd - roopStart) print(*d2[ind])