結果

問題 No.342 一番ワロタww
ユーザー 0w10w1
提出日時 2016-11-29 16:45:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 739 bytes
コンパイル時間 1,818 ms
コンパイル使用メモリ 178,852 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-05 16:28:17
合計ジャッジ時間 2,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0