CF 12B Correct Solution?
来源:互联网 发布:淘宝一键下架 编辑:程序博客网 时间:2024/05/16 23:39
题意 给两个数 问第一个数重新排列后最小的非前导零的数是否是第二个
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int main(){ char a[15],b[15]; while(cin>>a>>b) { int len_a = strlen(a); sort(a,a+len_a); int k = 0; for(int i = 0;i < len_a;i ++) { if(a[i] != '0') { k = i; break; } } char tmp; tmp = a[0]; a[0] = a[k]; a[k] = tmp; if(strcmp(a,b) == 0) cout<<"OK"<<endl; else cout<<"WRONG_ANSWER"<<endl; } return 0;}
0 0
- CF 12B Correct Solution?
- 12B Correct Solution?
- 12B - Correct Solution?
- codeforces 12B - Correct Solution?
- CodeForces 12B - Correct Solution?
- CodeForces-12B-Correct Solution
- Correct Solution?
- B. Error Correct System (CF Round #296 (Div. 2))
- B. Error Correct System
- CF practice #1 solution
- CF practice #2 solution
- CF 742 B-Arpa’s obvious problem and Mehrdad’s terrible solution
- CF Educational Round 12, B
- cf-B
- cf B
- Codeforces 527B Error Correct System(字符串)
- Codeforces 527 B Error Correct System 字母表
- 527B. Error Correct System【string】
- LintCode-二叉树的层次遍历 II
- HTML 常用标签
- Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE
- enable_irq_wake
- C#读取文件路径
- CF 12B Correct Solution?
- 动态顺序表
- mongoDB命令
- TangIDE开发技巧之GridView控件布局
- Objective-C(二、类与isa指针,类的封装,set&get,类方法,对象方法)——iOS开发基础
- [Codeforces Round #309 (Div. 2)] 酱油记
- EL表达式快速入门
- MFC 一个简单的消息示例
- GPIO及中断API函数