結果

問題 No.1624 三角形の反射
コンテスト
ユーザー titia
提出日時 2026-02-09 03:58:11
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
WA  
実行時間 -
コード長 1,936 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 705 ms
コンパイル使用メモリ 20,684 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-02-09 03:58:18
合計ジャッジ時間 6,343 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

a=input().strip()

A=""
for x in a:
    if x==".":
        continue
    A+=x

a=int(A)

ANS=0
x=0
y=0

while True:
    #print(x,y,ANS)
    # (x,y)から
    # (x^1,y+a)へ

    tox=x^1
    toy=y+a

    if 0<=y<1000 and x==0:
        if toy%2000==0:
            k=toy//1000
            ANS+=(k-2)*2+2
        elif 0<toy%2000<1000:
            k=toy//1000
            ANS+=k*2+2
        elif toy%2000==1000:
            k=toy//1000
            ANS+=(k-1)*2+1
        elif 1000<toy%2000<2000:
            k=toy//1000
            ANS+=k*2+1
            
    elif 1000<y<2000 and x==0:
        if toy%2000==0:
            k=toy//1000
            ANS+=(k-2)*2
        elif 0<toy%2000<1000:
            k=toy//1000
            ANS+=k*2-1
        elif toy%2000==1000:
            k=toy//1000
            ANS+=(k-2)*2
        elif 1000<toy%2000<2000:
            k=toy//1000
            ANS+=k*2

    if 1000<=y<2000 and x==1:
        if toy%2000==0:
            k=toy//1000
            ANS+=(k-2)*2+1
        elif 0<toy%2000<1000:
            k=toy//1000
            ANS+=k*2-1
        elif toy%2000==1000:
            k=toy//1000
            ANS+=(k-2)*2
        elif 1000<toy%2000<2000:
            k=toy//1000
            ANS+=k*2
            
    elif 0<y<1000 and x==1:
        if toy%2000==0:
            k=toy//1000
            ANS+=(k-1)*2
        elif 0<toy%2000<1000:
            k=toy//1000
            ANS+=k*2+2
        elif toy%2000==1000:
            k=toy//1000
            ANS+=(k-1)*2
        elif 1000<toy%2000<2000:
            k=toy//1000
            ANS+=k*2+1

    x=tox
    y=toy%2000

    if x==0:
        if y==0:
            print("A",ANS)
            break
        elif y==1000:
            print("C",ANS)
            break
    elif x==1:
        if y==0:
            print("B",ANS)
            break
        elif y==1000:
            print("A",ANS)
            break
        
0