結果
| 問題 | No.2723 Fortune-telling by Flowers |
| コンテスト | |
| ユーザー |
prin_kemkem
|
| 提出日時 | 2024-04-12 22:38:56 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 137 ms / 2,000 ms |
| + 294µs | |
| コード長 | 782 bytes |
| 記録 | |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 64,772 KB |
| 実行使用メモリ | 91,752 KB |
| 最終ジャッジ日時 | 2026-10-20 21:52:13 |
| 合計ジャッジ時間 | 4,037 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 |
ソースコード
from collections import defaultdict, deque, Counter
from functools import cache
# import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint, shuffle
import sys
# sys.setrecursionlimit(200000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)
#################################################
T = int(input())
for _ in range(T):
N = int(input())
S = list(input().split("-"))
x = 0
for s in S:
if s == "" or s[0] != s[-1]: continue
x += 1 if s[0] == "K" else -1
print("K" if x >= 0 else "P")
prin_kemkem