[CF1812C] Digits 题解
qifan_maker · · 题解
题目链接
洛谷
Codeforces
题意分析
第一行包含一个整数
每个测试用例有
所有测试用例的
题目解法
愚人节的题目没有其他技巧,就全靠猜。
我们猜测每组测试用例求的是它们的乘积,那么样例中的 所有测试用例的 n 总和不超过 155,我们可以把
所以,我们只需要用一个字符串
AC Code
/*
题目编号:
C. Digits
思路:
无
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
string s="0314159265358979323846264338327950288419716939937510"; //这里我直接用了50位
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
for (int i=1;i<=t;i++){
int pro=1;
for (int j=1;j<=s[i]-'0';j++){
int temp;
cin >> temp;
pro *= temp;
}
cout << pro << endl;
}
return 0;
}