题意:
按照已知的排饼干顺序推算规律
题解:
排饼干按照首项为1,公比为3的等比序列排序
代码:
#include <iostream>
using namespace std;
const int mod = 1e6 + 3;
int main()
{
int n; cin >> n; int ans = 1;
if (n == 0) {
cout << 1;
}
else {
for (int i = 1; i < n; i++) {
ans *= 3;
ans %= mod;
}
cout << ans;
}
//14
return 0;
}