結果
問題 |
No.2454 Former < Latter
|
ユーザー |
![]() |
提出日時 | 2023-07-07 16:06:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 2,015 ms |
コンパイル使用メモリ | 194,360 KB |
最終ジャッジ日時 | 2025-02-15 06:35:42 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 TLE * 1 -- * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve(){ string S; int N, ans=0; cin >> N >> S; for (int i=1; i<N; i++){ if (S.substr(0, i) < S.substr(i, N-i)) ans++; } cout << ans << endl; } int main(){ int T; cin >> T; while(T){ T--; solve(); } return 0; }