A. 整型溢出

    Type: Default 1000ms 256MiB

整型溢出

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给你两个 3232 位整数 A,BA,B,请你算算这两个数的和 A+BA+B 是否需要使用 long long 类型储存。

输入格式

一行两个整数 A,BA,B

输出格式

如果用 int3232 位整数)能存得下两个数的和,就输出 int。如果 int 存不下,用 long long 才能存得下,就输出 long long

2000 5000
int
2147483647 1
long long
-2147483647 -1
int

数据规模与约定

对于 100%100\% 的数据,保证 2147483648A,B2147483647-2147483648\le A,B\le 2147483647

  • 子任务 1(30 分):保证 10000A,B10000-10000\le A,B\le 10000
  • 子任务 2(30 分):保证 0A,B0\le A,B
  • 子任务 3(40 分):没有特殊限制。
数据类型名 内容(一般情况) 占用内存大小 能储存的范围
int/signed 3232 位整数 44 Bytes 2312311-2^{31}\sim 2^{31}-1
21474836482147483647-2147483648\sim 2147483647
long long 6464 位整数 88 Bytes 2632631-2^{63}\sim 2^{63}-1
92233720368547758089223372036854775807-9223372036854775808\sim 9223372036854775807

XAZXOI Round 13 - Level 1

Not Attended
Status
Done
Rule
Ledo
Problem
4
Start at
2025-4-19 19:00
End at
2025-4-20 12:00
Duration
17 hour(s)
Host
Partic.
3