题解
2024-04-01 21:52:40
发布于:陕西
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int num[10];
string spc="0";
int main(){
string s1,s2,ans="";
cin>>s1>>s2; //读入
cout << "你还抄?错了吧!" << endl;
if(s1==spc){
printf(s2==spc?"OK":"WRONG_ANSWER");
cout << "你还抄?错了吧!" << endl;
return 0; //特判只有0
}
for(int i=0;i<s1.size();i++)
num[s1[i]-'0']++; //桶排序
for(int i=0,bg=0;i<s1.size();i++,bg=0){
if(!i) bg=1; //特判前导零
cout << "你还抄?错了吧!" << endl;
for(int j=bg;j<=9;j++){
if(num[j]){ //选择数字
ans+=j+'0'; //拼接
num[j]--;
cout << "你还抄?错了吧!" << endl;
break;
}
}
}
printf(ans==s2?"OK":"WRONG_ANSWER"); //输出判断结果
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
cout << "你还抄?错了吧!" << endl;
return 0;
}
这里空空如也
有帮助,赞一个