結果

問題 No.2723 Fortune-telling by Flowers
ユーザー yu_w(ゆ)yu_w(ゆ)
提出日時 2024-04-12 21:56:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,132 KB
実行使用メモリ 97,492 KB
最終ジャッジ日時 2024-04-12 21:56:33
合計ジャッジ時間 2,934 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,884 KB
testcase_01 AC 93 ms
76,952 KB
testcase_02 AC 131 ms
76,648 KB
testcase_03 AC 378 ms
77,892 KB
testcase_04 AC 335 ms
77,116 KB
testcase_05 AC 81 ms
97,000 KB
testcase_06 AC 95 ms
97,492 KB
testcase_07 AC 91 ms
97,316 KB
testcase_08 AC 91 ms
97,236 KB
testcase_09 AC 127 ms
76,796 KB
testcase_10 AC 104 ms
76,976 KB
testcase_11 AC 79 ms
76,024 KB
testcase_12 AC 84 ms
82,812 KB
testcase_13 AC 87 ms
88,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    N=int(input())
    S=list(input())

    last = "-"
    p,k = 0,0
    for i in S:
        if last == i:
            continue
        last = i
        if i == "P":
            p += 1
        elif i == "K":
            k += 1
    
    if p<=k:
        print("K")
    else:
        print("P")
0