跳到正文

个人记录

T2

xiaotian_qwq约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年4月27日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include <bits/stdc++.h>
using namespace std;
int n,k;
long long limit = 1;
int main() {
	ios :: sync_with_stdio(0);cin.tie(0);
	cin >> n >> k;

	for (int i = 0; i < k; ++i) {
		limit *= 10;
	}

	long long current = 1;
	for (int i = 0; i < n; ++i) {
		long long a;
		cin >> a;
		long long threshold = (limit - 1) / a;
		if (current > threshold) {
			current = 1;
		} else {
			current *= a;
		}
	}
	cout << current << endl;
	return 0;
}
原文