Educational Codeforces Round 5 A
Problem A:http://codeforces.com/contest/616/problem/A
A. Comparing Two Long Integers
果然还是我太天真了(长整数比较不就是long long么........于是一直wa on 9,直到今天起床看了看别人的代码才恍然大悟。。。
#include<stdio.h>
#include<string.h>
const int MAX_N = ; int main(){
char a[MAX_N],b[MAX_N];
int lena,lenb,la,lb,pa=,pb=,i;
scanf("%s%s",a,b);
lena=strlen(a);
lenb=strlen(b);
while(pa<lena&&a[pa]=='') pa++;
while(pb<lenb&&b[pb]=='') pb++;
la=lena-pa;
lb=lenb-pb;
if(la>lb)
printf(">\n");
else if(la<lb)
printf("<\n");
else{
for(i=pa;i<lena;i++){
if(a[i]>b[i-pa+pb]){
printf(">\n");
return ;
}
else if(a[i]<b[i-pa+pb]){
printf("<\n");
return ;
}
}
printf("=\n");
}
return ;
}
Educational Codeforces Round 5 A的更多相关文章
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 6 C. Pearls in a Row
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...
- Educational Codeforces Round 9
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...
- Educational Codeforces Round 37
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
随机推荐
- winform 上传文件
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO ...
- asterisk 语音文件转换
Centos wav to sln sox foo-in.wav -t raw -r 8000 -s -2 -c 1 foo-out.sln 当前目录下所有语音wav文件 转换成sln for a i ...
- Cocos2d-x中使用音频CocosDenshion引擎介绍与音频文件的预处理
Cocos2d-x提供了一个音频CocosDenshion引擎,CocosDenshion引擎可以独立于Cocos2d-x单独使用,CocosDenshion引擎本质上封装了OpenAL音频处理库.具 ...
- CentOS 7 下使用 Firewall
在 CentOS 7 中,引入了一个新的服务,Firewalld,下面一张图,让大家明确的了解 Firewall 与 iptables 之间的关系与区别. 安装它,只需 yum install fir ...
- (转)SQLSERVER表分区的介绍(一)
下面进入正题吧,很多时候当单张数据表的数据量比较大的时候比如千万级别条记录.上亿级别记录,如果不做优化,那么查询的效率大家清楚. 有经验的人会通过各种手段做优化,其中表分区就是其中一种手段. 个人对表 ...
- SEO前端优化
精减代码 清除网页中一些冗余的代码,网上有这样的工具,可以辅助完成,如果需要的话,我们可以把代码中的注释去掉,甚至空行之类的也去掉,尽量的减少代码量,从而减小页面体积. CSS Sprites 通俗点 ...
- jLink(v8)GDB 命令总结
/** ****************************************************************************** * @author Maox ...
- Nodejs微信接口
代码重要部分都已详细注释,test.js为实例,如果启动url请求,那么程序默认对json格式数据友好,如果有特殊需要,请自行修改返回数据的处理格式 大概功能简介为下: this._token 提供t ...
- MySQL EER反向建表
Database > Synchronize Model... Choose Stored Connection Select the Schemata Choose which to upda ...
- Android Activity 注意笔记
图1:Activity生命周期的简化图,就像一个阶梯金字塔.这图像表明每个状态中是怎么样使用回调函数使得恢复状态回到顶端,或者降低状态到达底部.Activity可以从Paused状态和stopped状 ...