Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- typedef long long ll;
- int main()
- {
- fast();
- string a, b;
- cin>>a>>b;
- int ara[50],res[50],cnt=0;
- int m=a.size(),n=b.size();
- if(m!=n)
- printf("WRONG_ANSWER\n");
- else
- {
- for(int i=0; i<n; i++)
- {
- ara[i]=a[i]-48;
- res[i]=b[i]-48;
- if(res[i]==0)
- cnt++;
- }
- sort(ara,ara+n);
- int i=0;
- if(ara[0]==0)
- {
- while(ara[i]==0)
- {
- i++;
- }
- if(i==n)
- {
- if(i==cnt)
- {
- printf("OK\n");
- return 0;
- }
- else
- {
- printf("WRONG_ANSWER\n");
- return 0;
- }
- }
- else
- {
- ara[0]=ara[i];
- ara[i]=0;
- }
- }
- for(i=0;i<n;i++)
- {
- if(ara[i]!=res[i])
- {
- printf("WRONG_ANSWER\n");
- return 0;
- }
- }
- printf("OK\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement