結果
| 問題 |
No.342 一番ワロタww
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-29 16:45:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 739 bytes |
| コンパイル時間 | 1,852 ms |
| コンパイル使用メモリ | 181,776 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 13:34:45 |
| 合計ジャッジ時間 | 2,551 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
string S; cin >> S;
int cnt = 0;
priority_queue< tuple< int, int, string > > ans;
string cur;
for( int i = 0; i < S.size() - 2; ++i ){
if( S[ i ] == -17 and S[ i + 1 ] == -67 and S[ i + 2 ] == -105 ){
i += 2;
++cnt;
} else{
if( cnt > 0 and not cur.empty() ){
ans.emplace( cnt, 10000 - i, cur );
cur.clear();
}
cnt = 0;
cur += S[ i ];
}
}
if( cnt > 0 and not cur.empty() )
ans.emplace( cnt, 0, cur );
int maxc = -1;
while( not ans.empty() ){
int c, r; string s; tie( c, r, s ) = ans.top(); ans.pop();
if( maxc > c )
break;
maxc = c;
cout << s << endl;
}
return 0;
}