跳到正文

个人记录

U527753小L失恋了 题解

Diego_Song约 2 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 2 分钟

版本

  1. v1当前

题目传送门

这个题是我同学写的,他不会Markdown,所以题面很抽象

思路(?)

这个题就是输出 2的100次方,所以输出就可以了。但是这个数超过了 longlonglong long 类型的范围,所以我们可以使用 __int128 (注:两个下划线,且需要开c++14标准), 一个比longlonglong long更大的类型。但是它的输入输出需要单独写,原理类似于快读快写。

代码

C++
#include<bits/stdc++.h>
#define x first
#define y second
#define pbp push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

//输入
__int128 read() {
	__int128 x = 0, f = 1;
	char ch = getchar();
	while (ch < '0' || ch > '9') {
		if (ch == '-') f = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9') {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return x * f;
}

//输出
void print(__int128 x) {
	if (x < 0) {
		putchar('-');
		x = -x;
	}
	if (x > 9) print(x / 10);
	putchar(x % 10 + '0');
}

int main() {
	__int128 x = pow(2, 100);
	print(x);
	return 0;
}
原文