CodeForces 616A Comparing Two Long Integers
水题
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std; const int maxn=+;
char s1[maxn],s2[maxn];
int a[maxn],b[maxn];
int lena,lenb;
int c; int main()
{
scanf("%s%s",s1,s2);
lena=strlen(s1);
lenb=strlen(s2); c=; for(int i=lena-;i>=;i--) a[c++]=s1[i]-'';
c=; for(int i=lenb-;i>=;i--) b[c++]=s2[i]-''; for(int i=lena;i<max(lena,lenb);i++) a[i]=;
for(int i=lenb;i<max(lena,lenb);i++) b[i]=; int flag=;
for(int i=max(lena,lenb)-;i>=;i--)
{
if(a[i]!=b[i]){
if(a[i]>b[i]) printf(">\n");
else printf("<\n");
flag=;
break;
}
}
if(!flag) printf("=\n");
return ;
}
CodeForces 616A Comparing Two Long Integers的更多相关文章
- Codeforces Educational Codeforces Round 5 A. Comparing Two Long Integers 高精度比大小,模拟
A. Comparing Two Long Integers 题目连接: http://www.codeforces.com/contest/616/problem/A Description You ...
- Educational Codeforces Round 5 A. Comparing Two Long Integers
A. Comparing Two Long Integers time limit per test 2 seconds memory limit per test 256 megabytes inp ...
- 第六周周赛——AK机会不易得,好好把握题解(出自HDU5650,codeforces 616A,624A,659A,655A,658A)
A题: A题题目链接 题目描写叙述: 位运算 TimeLimit:1000MS MemoryLimit:65536KB 64-bit integer IO format:%I64d Problem ...
- codeforces Educational Codeforces Round 5 A. Comparing Two Long Integers
题目链接:http://codeforces.com/problemset/problem/616/A 题目意思:顾名思义,就是比较两个长度不超过 1e6 的字符串的大小 模拟即可.提供两个版本,数组 ...
- Educational Codeforces Round 37-G.List Of Integers题解
一.题目 二.题目链接 http://codeforces.com/contest/920/problem/G 三.题意 给定一个$t$,表示有t次查询.每次查询给定一个$x$, $p$, $k$,需 ...
- Codeforces 1051E Vasya and Big Integers&1051F The Shortest Statement
1051E. Vasya and Big Integers 题意 给出三个大整数\(a,l,r\),定义\(a\)的一种合法的拆分为把\(a\)表示成若干个字符串首位相连,且每个字符串的大小在\(l, ...
- Codeforces 920 G List Of Integers
题目描述 Let's denote as L(x,p)L(x,p) an infinite sequence of integers yy such that gcd(p,y)=1gcd(p,y)=1 ...
- Codeforces 1051E. Vasya and Big Integers
题意:给你N个点M条边,M-N<=20,有1e5个询问,询问两点的最短距离.保证没有自环和重边. 题解:连题目都在提示你这个20很有用,所以如果是颗树的话那任意两点的最短距离就是求一下lca搞一 ...
- CodeForces 616A(水题)
while(t--) 最后结果t=-1 #include <iostream> #include <string> #include <cstring> #incl ...
随机推荐
- MVC 项目中又一新方法实现依懒注入 (AutoFac)
详情请查看:http://docs.autofac.org/en/latest/integration/mvc.html#quick-start
- C陷阱与缺陷 第二章
有关运算符优先级 1. "<<" 和 "+" data8 = data4H << 4 +data4L; 这里本意是让高四位的数据,左 ...
- PHP之音乐ID3扩展
不知道你有没有这样的经历,一些从网上下载的MP3音乐,文件名明明是01.02这样的序号,但播放时却能显示出歌曲的正确名称来,是不是有点奇妙? 这其实都是ID3在暗中相助 ID3,一般是位于一个mp3文 ...
- 快速批量插入sqlserver方法之我见
---------------------------------------------------------------------------------------------------- ...
- php五种常用的设计模式
php 设计模式 1.单例模式 单例模式顾名思义,就是只有一个实例.作为对象的创建模式, 单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例. 单例模式的要点有三个: 一是某个类 ...
- openwrt+ndp+ndppd+radvd+dhcpv6,ipv6穿透配置指南
要用ipv6首先你的openwrt路由内核必须已经支持ipv6,且能安装相关软件! 首先说说最简单的ndp手工ipv6穿透,很简单,看代码详解: 环境: wan口 eth1 lan口 br-lan w ...
- GameUnity 2.0 发布倒计时
万众期待的 gameunity 网络游戏框架 已经完成了,现在在最后的检验调试阶段. 因为版本 改动非常之大,所以 版本号 从0.2版本 改成 2.0版本. gameunity事件部分,一如既往保持高 ...
- HDU1114--Piggy-Bank(完全背包变形)
Piggy-Bank Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total ...
- Android多线程下安全访问数据库
http://zhiwei.neatooo.com/blog/detail?blog=5343818a9d4869f0310000de github 原文https://github.com/dmyt ...
- .Net多线程编程—Parallel LINQ、线程池
Parallel LINQ 1 System.Linq.ParallelEnumerable 重要方法概览: 1)public static ParallelQuery<TSource> ...