結果
| 問題 |
No.8081 HQ9+
|
| コンテスト | |
| ユーザー |
nok0
|
| 提出日時 | 2021-04-01 20:40:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 295 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-12-20 03:03:46 |
| 合計ジャッジ時間 | 1,693 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 6 |
ソースコード
import math
n = int(input())
s = input()
cnt = 0
for c in s:
if c != "Q":
print(-1)
exit()
else:
cnt += 1
m = int(math.sqrt(cnt))
if m ** 2 == cnt and n % m == 0:
u = s[0:m]
if u * m == s:
print(u)
else:
print(-1)
else:
print(-1)
nok0