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 ...
随机推荐
- Tomcat服务器顶层结构和启动过程【转】
号外:2016 最流行的是哪一种 Java 应用服务器呢? 通过从部署的 1240 个 JVM 中得到的数据,我们能够确定出现了 862 个容器供应商,或者说是占到了运行环境的 70% 左右.这些容器 ...
- linux tar包追加问题【转】
只能已归档的文件才能追加文件. 如果tar.gz文件是如此生成:#tar -zcvf test.tar.gz a.txt即tar.gz是压缩(-z)和归档(-c)文件,则无法给它追加文件:若果tar ...
- C陷阱与缺陷 第二章
有关运算符优先级 1. "<<" 和 "+" data8 = data4H << 4 +data4L; 这里本意是让高四位的数据,左 ...
- C++中的基本数据类型
C++中定义了一组表示整数.浮点数.单个字符和布尔值的算术类型(arithmetic type). 另外还定义了一种叫做void的特殊类型.void类型没有对应的值,仅用在有限的一些情况下,通常用作无 ...
- Git本地项目上传 & SourceTree & GitHub 简单使用
Git(分布式版本控制系统) Git是一款免费.开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理 ...
- HBase Coprocessor 剖析与编程实践(转载http://www.cnblogs.com/ventlam/archive/2012/10/30/2747024.html)
HBase Coprocessor 剖析与编程实践 1.起因(Why HBase Coprocessor) HBase作为列族数据库最经常被人诟病的特性包括:无法轻易建立“二级索引”,难以执行求和. ...
- java 实例变量和类变量的区别
Example4_10.java public class Example4_10 { public static void main(String args[]) { Lader.下底=100; / ...
- KNN邻近分类算法
K邻近(k-Nearest Neighbor,KNN)分类算法是最简单的机器学习算法了.它采用测量不同特征值之间的距离方法进行分类.它的思想很简单:计算一个点A与其他所有点之间的距离,取出与该点最近的 ...
- 고 해서: 表示在做B的各种理由中, A是代表性的理由
1. 날씨도 좋고해서 산책이나 하려고 해요. 2. 할 일도 없고해서 일찍 돌어왔어요. 3. 기분도 우울하고 해서 친구란 술 마시기로 했어요. 可以加过去式和将来时使用 1. 수업도 끝 ...
- 安装PHP memcached扩展
引用 pecl.php.net有两个memcache扩展: memcache memcached extension memcached PHP extension for interfacing ...