提出 #66809749


ソースコード 拡げる

T = int(input())

N = 0
A = []
B = []
res = ""
pos_diff = 0
first = 0
diff_0 = 0
diff_j = 0
fac_0 = 0
fac_j = 0
for i in range(T):
    res = "No"
    first = 0
    N = int(input())
    A = list(map(int,input().split(" ")))
    B = list(map(int,input().split(" ")))

    while(A[first] == B[first]):
        first += 1
    for j in range(N):
        if(A[j] > B[j] == A[first] < B[first]):
            pos_diff = j
            res = ""
            break

    if(res == "No"):
        print(res)
        continue
    if(A[first] > B[first]):
        fac_0 = 1
    elif(A[first] < B[first]):
        fac_0 = -1
    else:
        pass
    diff_0 = A[first] - B[first]
    diff_j = A[j] - B[j]
    fac_j = -fac_0

    fac_0 *= abs(diff_0)
    fac_j *= abs(diff_j)

    sumA = fac_0 * A[first] +fac_j * A[pos_diff]
    sumB = fac_0 * B[first] +fac_j * B[pos_diff]
    res = "Yes\n"
    for j in range(N):
        if(j == first):
            res +=str(fac_0)+" "
        elif(j == pos_diff):
            res += str(fac_j) + " "
        else:
            res += "0 "
    print(res)

提出情報

提出日時
問題 A - Dot Product
ユーザ keram02
言語 Python (CPython 3.11.4)
得点 0
コード長 1128 Byte
結果 RE
実行時間 541 ms
メモリ 33528 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 500
結果
WA × 1
AC × 2
WA × 40
RE × 3
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 01_handmade_10.txt, 01_handmade_11.txt, 01_handmade_12.txt, 01_handmade_13.txt, 01_handmade_14.txt, 01_handmade_15.txt, 01_handmade_16.txt, 01_handmade_17.txt, 01_handmade_18.txt, 01_handmade_19.txt, 01_handmade_20.txt, 01_handmade_21.txt, 01_handmade_22.txt, 01_handmade_23.txt, 01_handmade_24.txt, 01_handmade_25.txt, 02_No_00.txt, 02_No_01.txt, 02_No_02.txt, 02_No_03.txt, 03_Yes_00.txt, 03_Yes_01.txt, 03_Yes_02.txt, 03_Yes_03.txt, 03_Yes_04.txt, 03_Yes_05.txt, 03_Yes_06.txt, 03_Yes_07.txt, 04_YesNo_00.txt, 04_YesNo_01.txt, 04_YesNo_02.txt, 04_YesNo_03.txt, 04_YesNo_04.txt, 04_YesNo_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt WA 9 ms 8832 KiB
01_handmade_00.txt RE 9 ms 8800 KiB
01_handmade_01.txt WA 518 ms 8764 KiB
01_handmade_02.txt WA 522 ms 8768 KiB
01_handmade_03.txt WA 518 ms 8844 KiB
01_handmade_04.txt WA 518 ms 8872 KiB
01_handmade_05.txt WA 525 ms 8640 KiB
01_handmade_06.txt WA 525 ms 8804 KiB
01_handmade_07.txt WA 518 ms 8812 KiB
01_handmade_08.txt WA 519 ms 8780 KiB
01_handmade_09.txt WA 514 ms 8776 KiB
01_handmade_10.txt WA 525 ms 8768 KiB
01_handmade_11.txt WA 533 ms 8828 KiB
01_handmade_12.txt WA 533 ms 8840 KiB
01_handmade_13.txt WA 514 ms 8596 KiB
01_handmade_14.txt WA 527 ms 8792 KiB
01_handmade_15.txt WA 524 ms 8848 KiB
01_handmade_16.txt WA 517 ms 8800 KiB
01_handmade_17.txt WA 526 ms 8800 KiB
01_handmade_18.txt WA 541 ms 8752 KiB
01_handmade_19.txt WA 531 ms 8836 KiB
01_handmade_20.txt WA 520 ms 8792 KiB
01_handmade_21.txt WA 524 ms 8856 KiB
01_handmade_22.txt WA 388 ms 8800 KiB
01_handmade_23.txt WA 372 ms 8744 KiB
01_handmade_24.txt WA 373 ms 8808 KiB
01_handmade_25.txt WA 66 ms 8836 KiB
02_No_00.txt RE 285 ms 8768 KiB
02_No_01.txt RE 323 ms 8788 KiB
02_No_02.txt AC 68 ms 29024 KiB
02_No_03.txt AC 70 ms 25668 KiB
03_Yes_00.txt WA 532 ms 8792 KiB
03_Yes_01.txt WA 533 ms 8840 KiB
03_Yes_02.txt WA 74 ms 29232 KiB
03_Yes_03.txt WA 308 ms 25388 KiB
03_Yes_04.txt WA 70 ms 33428 KiB
03_Yes_05.txt WA 72 ms 33528 KiB
03_Yes_06.txt WA 305 ms 8816 KiB
03_Yes_07.txt WA 215 ms 8712 KiB
04_YesNo_00.txt WA 301 ms 8836 KiB
04_YesNo_01.txt WA 215 ms 8804 KiB
04_YesNo_02.txt WA 304 ms 8840 KiB
04_YesNo_03.txt WA 212 ms 8856 KiB
04_YesNo_04.txt WA 299 ms 8656 KiB
04_YesNo_05.txt WA 212 ms 8884 KiB