-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12B_codeforces
More file actions
44 lines (40 loc) · 811 Bytes
/
12B_codeforces
File metadata and controls
44 lines (40 loc) · 811 Bytes
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
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fastio \
{ \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
}
// #define inf 1e12
int main()
{
string n,m;
cin>>n>>m;
vector<ll>v,v1;
ll ans1=0,ans2=0;
if(n.size()!=m.size()){
cout<<"WRONG_ANSWER\n";
return 0;
}
for(ll i=0;i<n.size();i++)v.push_back(n[i]-'0');
for(ll i=0;i<m.size();i++)v1.push_back(m[i]-'0');
sort(v.begin(),v.end());
if(v[0]==0)
{
for(ll i=1;i<v.size();i++){
if(v[i]!=0){swap(v[i],v[0]);
break;
}
}
}
ll c=0;
for(ll i=0;i<v.size();i++){
if(v[i]!=v1[i]){
c=1;
break;
}
}
if(c==1)cout<<"WRONG_ANSWER\n";
else cout<<"OK\n";
}