結果

問題 No.342 一番ワロタww
ユーザー kotatsugamekotatsugame
提出日時 2018-08-23 09:46:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 830 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 66,240 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 06:21:59
合計ジャッジ時間 1,805 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:18:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   18 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
string s;
struct myc{
	char c[3];
	bool check(){
		return c[0]==-17&&c[1]==-67&&c[2]==-105;
	}
	void print(){
		if(c[1]<0){
			string t={c[0],c[1],c[2]};
			cout<<t;
		}
		else cout<<c[0];
	}
};
myc a[114514];
main()
{
	cin>>s;
	int cnt=0;
	for(int i=0;i<s.size();)
	{
		if(s[i]<0)a[cnt].c[0]=s[i],a[cnt].c[1]=s[i+1],a[cnt].c[2]=s[i+2],i+=3;
		else a[cnt].c[0]=s[i],i++;
		cnt++;
	}
	int start=0;
	while(start<cnt&&a[start].check())start++;
	for(int k=cnt;k>0;k--)
	{
		bool f=0;
		for(int i=start;i+k<=cnt;i++)
		{
			bool l=1;
			for(int j=0;j<k;j++)
			{
				l&=a[i+j].check();
			}
			if(l)
			{
				f=1;
				int first=i;
				i--;
				while(i>=0&&!a[i].check())i--;
				for(int k=i+1;k<first;k++)a[k].print();
				cout<<endl;
				i=first;
			}
		}
		if(f)return 0;
	}
	cout<<""<<endl;
}
0