解法:
手动本地跑了一下1e9,显然超时。
然后预处理发现开不了这么大的数组。
肯定有规律,打表看看
代码如下
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
#define endl '\n'
int main()
{int n;while (cin >> n && n != -1) {if (n == 0) {cout << 0 << 1 << endl;}else if (n == 1) {cout << 0 << 6 << endl;}else if (n <= 6) {switch (n) {case 2:cout << 36 << endl; break;case 3:cout << 16 << endl; break;case 4:cout << 96 << endl; break;case 5:cout << 76 << endl; break;case 6:cout << 56 << endl; break;}}else {switch (n%5) {case 2:cout << 36 << endl; break;case 3:cout << 16 << endl; break;case 4:cout << 96 << endl; break;case 0:cout << 76 << endl; break;case 1:cout << 56 << endl; break;default:break;}}}/*0-11-62-36 7 123-16 8 134-96 9 145-76 10 156-56 11 16*/return 0;
}