結果
| 問題 | No.2723 Fortune-telling by Flowers |
| コンテスト | |
| ユーザー |
MasKoaTS
|
| 提出日時 | 2024-03-29 15:26:14 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 139 ms / 2,000 ms |
| + 683µs | |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 95,564 KB |
| 実行使用メモリ | 97,824 KB |
| 最終ジャッジ日時 | 2026-09-06 19:43:06 |
| 合計ジャッジ時間 | 3,253 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
import sys
input = sys.stdin.readline
def solve(n, s):
x = 0
for ss in s.split('-'):
if(len(ss) == 0):
continue
if(ss[0] == 'K' or ss[-1] == 'K'):
x += 1
if(ss[0] == 'P' or ss[-1] == 'P'):
x -= 1
if(x >= 0):
return 'K'
return 'P'
t = int(input())
for _ in [0] * t:
n = int(input())
s = input()[:-1]
print(solve(n, s))
MasKoaTS