# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22712 | oj.uz (#40) | Fully Generate (KRIII5_FG) | C++11 | 453 ms | 21552 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 <iostream>
using namespace std;
#define MAX 5000000
// #define MAX 50
const long long mod = 1000000007LL;
int a[MAX+1];
long long calc(long long a, long long b, long long c) {
long long ans = 1;
while (b > 0) {
if (b % 2 == 1) {
ans = (ans * a) % c;
}
a = (a*a) % c;
b = b/2;
}
return ans;
}
int main(){
long long n;
cin >> n;
a[1] = 1;
a[2] = a[3] = 2;
int now = 4;
for (int i=3;; i++){
for (int j=0; j<a[i]; j++) {
a[now++] = i;
if (now >= MAX) {
break;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |