Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits\stdc++.h>
- using namespace std;
- int main()
- {
- string ques, ans, ques1;
- cin >> ques >> ans;
- int sz = ques.length();
- if(sz != ans.length())
- {
- printf("WRONG_ANSWER\n");
- return 0;
- }
- sort(ques.begin(), ques.end());
- int i;
- /*for(i = 0; i < ques.length(); i++) printf("%c", ques[i]);
- cout << endl;*/
- int cnt0 = 0;
- char min_not0;
- for(i = 0; i < ques.length(); i++)
- {
- if(ques[i] == '0') cnt0++;
- if(ques[i] != '0')
- {
- min_not0 = ques[i];
- break;
- }
- }
- ques1[0] = min_not0;
- //cout << "minnot0 " << ques1[0] << endl;
- for(i = 1; i <= cnt0; i++) ques1[i] = '0';
- for(i = cnt0 + 1; i < sz; i++) ques1[i] = ques[i];
- for(i = 0; i < sz; i++)
- {
- if(ques1[i] != ans[i])
- {
- printf("WRONG_ANSWER\n");
- return 0;
- }
- }
- printf("OK\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement