結果
| 問題 |
No.2894 Monotonic Intervals
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-20 22:15:46 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 346 bytes |
| コンパイル時間 | 2,924 ms |
| コンパイル使用メモリ | 243,508 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-20 22:15:50 |
| 合計ジャッジ時間 | 3,698 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 8 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
int ans = 0;
if (s[0] == '<') ans++;
for (int i = 1; i < n; ++i) {
if (s[i] == '<' and s[i-1] == '>') ans += 2;
}
cout << ans << '\n';
return 0;
}