# CodeForces-12B-Correct Solution

Description

One cold winter evening Alice and her older brother Bob was sitting at home near the fireplace and giving each other interesting problems to solve. When it was Alice’s turn, she told the number n to Bob and said:

—Shuffle the digits in this number in order to obtain the smallest possible number without leading zeroes.

—No problem! — said Bob and immediately gave her an answer.

Alice said a random number, so she doesn’t know whether Bob’s answer is correct. Help her to find this out, because impatient brother is waiting for the verdict.

Input

The first line contains one integer n (0 ≤ n ≤ 109) without leading zeroes. The second lines contains one integer m (0 ≤ m ≤ 109) — Bob’s answer, possibly with leading zeroes.

Output

Print OK if Bob’s answer is correct and WRONG_ANSWER otherwise.

Sample Input
Input

3310
1033

Output

OK

Input

4
5

Output

WRONG_ANSWER
sort一下之后直接找第一个0和第一个非0就OK了

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
char a[10010];
char b[10010], c[1010], d[1010];
int main() {
while (scanf("%s%s", a, b) != EOF) {
int len = strlen(a);
sort(a, a + len);
int flag = 0;
for (int i = 0; i < len; i++) {
if (a[i] != '0') {
flag = i;
char t = a[i];
a[i] = a[0];
a[0] = t;
break;
}
}
if (strcmp(a, b) == 0) {
printf("OK\n");
}
else
{
printf("WRONG_ANSWER\n");
}
}
return 0;
}

• 本文已收录于以下专栏：

## 12B - Correct Solution?

B. Correct Solution? time limit per test 2 seconds memory limit per test 256 megabytes ...
• liuke19950717
• 2016年07月21日 09:57
• 312

## cf12B

http://codeforces.com/problemset/problem/12/B B. Correct Solution? time limit per test 2 sec...
• lanjiangzhou
• 2013年05月30日 11:20
• 519

## CodeForces 12B - Correct Solution?

• MrSiz
• 2015年09月17日 19:17
• 489

## CodeForces 527B Error Correct System

B. Error Correct System time limit per test 2 seconds memory limit per test 256 megabyte...
• lizhaowei213
• 2016年01月17日 14:25
• 147

## Codeforces Round #296 (Div. 2) B. Error Correct System

B. Error Correct System time limit per test 2 seconds memory limit per test 256 megabyte...
• wust_ZJX
• 2015年03月18日 10:32
• 868

## 【Codeforces Round 335 (Div 2) B】【模拟】Testing Robots 机器人逐步走 走到矿场就爆炸的最多行走步数

B. Testing Robots time limit per test 2 seconds memory limit per test 256 megabytes ...
• snowy_smile
• 2015年12月10日 13:43
• 753

## codeforces 12B - Correct Solution?

• ymrfzr
• 2013年06月05日 07:38
• 699

## Codeforces Testing Round #12 B - Restaurant ( 贪心 )

• u013167299
• 2015年11月12日 15:51
• 275

## CodeForces-12B-Correct Solution

DescriptionOne cold winter evening Alice and her older brother Bob was sitting at home near the fire...
• Ypopstar
• 2016年05月31日 22:19
• 294

## Codeforces 527 B Error Correct System 字母表

• haoliang94
• 2015年03月19日 13:26
• 585

举报原因： 您举报文章：CodeForces-12B-Correct Solution 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)