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 ...
随机推荐
- vs设计界面出现“建控件时出错 响应在此上下文中不可用”
使用VS2010设计Asp.net时出现: 只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态.还请确保在应用程序配置的 \\ 节中包括 ...
- PHP文件相关函数试题
一.问答题 1.返回路径中的文件名部分的函数是什么? 2.改变文件模式的函数是什么? 3.拷贝文件的函数是什么? 4.返回路径中的目录部分的函数是什么? 5.将上传的文件移动到指定位置的函数是? 6. ...
- Asp.Net调用Office组件操作时的DCOM配置 (转)
Asp.Net调用Office组件操作时的DCOM配置 http://blog.csdn.net/gz775/article/details/6447758 在项目中将数据导出为Excel格式时出现“ ...
- ubuntu 设置vpn
百度了资料 http://jingyan.baidu.com/article/fa4125aca7f1b628ad709271.html 1. 设置 VPN CONNECTION 2.configur ...
- Django Template模板
Django Template 你可能已经注意到我们在例子视图中返回文本的方式有点特别. 也就是说,HTML被直接硬编码在 Python 代码之中. 下面我们来调用html views def ind ...
- How To Install Apache Kafka on Ubuntu 14.04
打算学习kafka ,接触一些新的知识.加油!!! 参考:https://www.digitalocean.com/community/tutorials/how-to-install-apache- ...
- Swift 响应式编程 浅析
这里我讲一下响应式编程(Reactive Programming)是如何将异步编程推到一个全新高度的. 异步编程真的很难 大多数有关响应式编程的演讲和文章都是在展示Reactive框架如何好如何惊人, ...
- Lucene add、updateDocument添加、更新与search查询(转)
package com.lucene; import java.io.IOException; import org.apache.lucene.analysis.standard.Stand ...
- FZU 1912 Divisibility by Thirty-six(整除问题+字符串维护+贪心)
这个整除36的与整除45的完全一样,就是被4整除的有点多,但都是两位数,所以枚举后面两位就可以了. #include <stdio.h> #include <string.h> ...
- android viewpager 深究
参考: http://blog.csdn.net/xushuaic/article/details/42638311 GitHub上相关的ViewPager动画的项目 https://github.c ...