結果

問題 No.342 一番ワロタww
ユーザー h_nosonh_noson
提出日時 2016-02-24 13:51:07
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 858 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 62,880 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-23 19:35:25
合計ジャッジ時間 3,204 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8

typedef long long ll;

int main() {
    string s, strs[50];
    int w[50] {};
    int i, si = 0;
    bool wara = false;
    cin >> s;
    rep (i, s.size()/3+1) {
        if (s.compare(i*3,3,"w") == 0) {
            wara = true;
            w[si]++;
        }
        else {
            if (wara) si++;
            wara = false;
            strs[si] += s.substr(i*3,3);
        }
    }
    int mx = *max_element(w,w+50);
    if (mx == 0)
        cout << endl;
    else {
        rep (i,51) {
            if (w[i] == mx && strs[i] != "")
                cout << strs[i] << endl;
        }
    }
    return 0;
}

0