-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq95.cpp
57 lines (52 loc) · 1.09 KB
/
q95.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
ıllıllı 𝔻𝓎Rr𝕠𝐭𝐇 ıllıllı
*/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mk make_pair
double pi=3.141592653589793238;
const int M = 1e9+7;
const int Nmax=3001;
const int MM = 1e5+2;
int main(){
int T=1;
//cin>>T;
while(T--){
string S;
cin>>S;
vector<string> ans;
for(int i=0;i<S.size();i++)
{
string sub="";
while(S[i]!='@'&&i<S.size())
sub+=S[i],i++;
if(sub.size()==0){cout<<"No solution";return 0;}
sub+='@';i++;
if(i>=S.size()){cout<<"No solution";return 0;}
if(S.find('@',i)==string::npos)
{
sub+=S.substr(i);
ans.push_back(sub);
break;
}
string after;
if(i<S.size()&&S[i]=='@'){cout<<"No solution";return 0;}
else
{
if(i<S.size())
sub += S[i];
ans.push_back(sub);
}
}
for(int i=0;i<ans.size();i++)
{
if(i)cout<<',';
cout<<ans[i];
}
}
return 0;
}
/*_*/