結果

問題 No.2723 Fortune-telling by Flowers
ユーザー titiatitia
提出日時 2024-04-12 22:56:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,072 KB
最終ジャッジ日時 2024-04-12 22:56:10
合計ジャッジ時間 4,336 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 141 ms
11,776 KB
testcase_06 WA -
testcase_07 AC 241 ms
24,072 KB
testcase_08 AC 249 ms
24,068 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):
    N=int(input())
    S=input().strip()

    LIST=[]
    now=[]
    for s in S:
        if s=="-":
            if now!=[]:
                LIST.append(now)
            now=[]
        else:
            now+=[s]

    P=0
    K=0

    for l in LIST:
        if l[0]==l[-1]=="P":
            P+=1
        elif l[0]==l[-1]=="K":
            K+=1

    if K>P:
        print("K")
    else:
        print("P")
0