結果

問題 No.932 解法破綻!高橋君
ユーザー ok
提出日時 2019-11-29 21:43:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 916 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 80,120 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 21:44:49
合計ジャッジ時間 1,499 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	string s;
	
	cin>>s;
	
	s += ',';
	
	if(s.size()%3){
		 cout<<"Failed..."<<endl;
	} else {
		
		bool flag = true;
		
		for(int i = 0; i < s.size(); i+= 3){
			if(s[i] != 'A') flag = false;
		}
		// cout<<flag<<endl;
		for(int i = 1; i < s.size(); i+= 3){
			if(s[i] != 'C') flag = false;
		}
		// cout<<flag<<endl;
		for(int i = 2; i < s.size(); i+= 3){
			if(s[i] != ',') flag = false;
		}
		
		if(flag) cout<<"Done!"<<endl;
		else cout<<"Failed..."<<endl;
	}
	
	
	return 0;
}
0