結果

問題 No.342 一番ワロタww
ユーザー CleyLCleyL
提出日時 2022-01-31 23:07:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 768 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 73,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 02:25:47
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
  string s;cin>>s;s += "あ";
  //-17 -67 -105 
  string k = "";
  int tmp = 0;
  int mx = -1;
  vector<string> z;
  for(int i = 0; s.size()-2 > i; i+=3){
    
    if((int)s[i] == -17 && (int)s[i+1] == -67 && (int)s[i+2] == -105){
      tmp++;
    }else{
      if(tmp && k != ""){
        if(mx < tmp){
          z.clear();
          z.push_back(k);
          mx = tmp;
        }else if(mx == tmp){
          z.push_back(k);
        }
        if(s[i] > 0)k = s[i];
        else k = s.substr(i,3);
      }else{
        if(s[i] > 0)k += s[i];
        else k += s.substr(i,3);
      }
      tmp = 0;
    }
    if(s[i] > 0)i-=2;
  }
  for(int i = 0; z.size() > i; i++){
    cout << z[i] << endl;
  }
}
0