美文网首页
python写大整数

python写大整数

作者: 与卿__歌 | 来源:发表于2017-02-21 18:45 被阅读0次

[I - Yet another A + B] (https://vjudge.net/problem/Gym-100735I)

You are given three numbers. Is there a way to replace variables A, B and C with these numbers so the equality A + B = C is correct?

Input
There are three numbers X1, X2 and X3 (1 ≤ Xi ≤ 10100), each on a separate line of input.

Output
Output either "YES", if there is a way to substitute variables A, B and C with given numbers so the equality is correct, or "NO" otherwise.1
2
3
Output
YES
Input
1
2
4
Output
YES
Input
1
3
5
Output
NO

a = int(input()) 
b = int(input()) 
c = int(input())
if a+a==b or a+a==c or b+b==a or b+b==c or c+c==a or c+c==b or a+b==c or a+c==b or b+c==a:
   print("YES")
else:
   print("NO") 

相关文章

  • python写大整数

    [I - Yet another A + B] (https://vjudge.net/problem/Gym...

  • Python 基础学习 一

    python3 中的语法。 1、python 中,变量可以赋值为任意大小的整数;不会出现大整数溢出的问题;如 a ...

  • Python基础知识总结

    Python 数据类型 一、整数 Python可以处理任意大小的整数,当然包括负整数,在Python程序中,整数的...

  • Python 入门篇

    一、python 变量和数据类型 1.整数 Python可以处理任意大小的整数,当然包括负整数,在Python程序...

  • (二)Python变量与数据类型

    1、Python中数据类型 1、整数 Python可以处理任意大小的整数,当然包括负整数,在Python程序中,整...

  • 3. Python3源码—整数对象

    3.1. 整数对象 整数对象是“变长对象”。 3.1.1. Python中的创建 Python中整数对象最重要的创...

  • Python第二天,数字与列表

    Python中的数字: 1.整数:在python中可对整数执行+、-、*、/运算 Python使用两个乘号表示乘方...

  • 2020-09-19

    一、python数据类型 1、int :整数。 python3唯一的整数类型,python里没有long之类的类型...

  • Python的入门

    一、python中的数据类型 1.1 整数 Python可以处理任意大小的整数,包括负整数,例如:1,100,-8...

  • Python源码学习笔记 2 整数对象

    Python中的整数类型是不可变对象,为了提高python运行效率,内部实现了小整数对象池(数组实现),和通用整数...

网友评论

      本文标题:python写大整数

      本文链接:https://www.haomeiwen.com/subject/babuwttx.html