結果

問題 No.342 一番ワロタww
ユーザー hotpepsi
提出日時 2016-02-13 23:03:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 635 bytes
コンパイル時間 933 ms
コンパイル使用メモリ 77,140 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 13:20:42
合計ジャッジ時間 1,424 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <algorithm>
#include <map>
#include <vector>

using namespace std;

int main(int argc, char *argv[])
{
	string s;
	cin >> s;
	int cnt = 0;
	string w;
	map<int, vector<string> > m;
	for (int i = 0; i < (int)s.length() - 2; ++i) {
		if (s[i] == -17 && s[i + 1] == -67 && s[i+2] == -105) {
			i += 2;
			++cnt;
		} else {
			if (cnt > 0 && !w.empty()) {
				m[-cnt].push_back(w);
				w.clear();
			}
			cnt = 0;
			w += s[i];
		}
	}
	if (cnt > 0 && !w.empty()) {
		m[-cnt].push_back(w);
	}
	if (!m.empty()) {
		for (string s : m.begin()->second) {
			cout << s << endl;
		}
	}
	return 0;
}
0