結果
| 問題 |
No.2454 Former < Latter
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2023-09-02 10:59:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 524 bytes |
| コンパイル時間 | 243 ms |
| コンパイル使用メモリ | 82,300 KB |
| 実行使用メモリ | 59,948 KB |
| 最終ジャッジ日時 | 2024-06-11 17:39:11 |
| 合計ジャッジ時間 | 4,036 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 TLE * 1 -- * 21 |
ソースコード
def solve(N,S):
cnt = 0
for i in range(1,N):
for j in range(N):
if j < i and i + j < N:
if S[j] < S[i+j]:
cnt += 1
break
if S[j] > S[i+j]:
break
elif j == i and i + j < N:
cnt += 1
break
elif j < i and i + j == N:
break
return cnt
T = int(input())
for t in range(T):
N = int(input())
S = input()
print(solve(N,S))
ntuda