結果
問題 | No.341 沈黙の期間 |
ユーザー |
![]() |
提出日時 | 2016-02-19 22:06:18 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 602 bytes |
コンパイル時間 | 1,442 ms |
コンパイル使用メモリ | 163,420 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 12:22:25 |
合計ジャッジ時間 | 1,910 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h>#define REP(i,n) for(int i=0;i<(int)(n);i++)#define ALL(x) (x).begin(),(x).end()using namespace std;vector<string> utf8(string str) {vector<string> res;int n = 0;for (int i = 0; i < (int)str.size(); i += n) {n = 1; unsigned char c = str[i];n += (c >= 0x80); n += (c >= 0xE0); n += (c >= 0xF0);res.push_back(str.substr(i, n));}return res;}int main() {string str; cin >> str;int res = 0, cnt = 0;for (string c: utf8(str)) {if (c == "…") ++cnt; else cnt = 0;res = max(res, cnt);}cout << res << endl;return 0;}