# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22279 | 카시코이 (#40) | Fully Generate (KRIII5_FG) | C++14 | 500 ms | 635800 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int PMAX = 4e7;
const int QMAX = 70000;
int dp[PMAX + 1]; // dp[i]: i�� ������ �� �� �����ϴ°�?
ll psum[PMAX + 1];
vector<int> deg[QMAX + 1];
ll fastpow(ll x, ll y) {
if (y == 0) return 1;
if (y % 2) return x*fastpow(x, y - 1) % MOD;
ll h = fastpow(x, y / 2);
return h*h%MOD;
}
int main() {
ll N; scanf("%lld", &N);
dp[1] = psum[1] = 1;
dp[2] = 2;
psum[2] = 3;
int j = 2;
for (int i = 3; i <= PMAX; i++) {
// find min(j) s.t. psum[j] >= i
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |