# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
929493 | bambaa | Rack (eJOI19_rack) | C++14 | 8 ms | 4240 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 <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <iterator>
#include <vector>
#define ff first
#define ss second
#define mp make_pair
#define ll long long
using namespace std;
int main() {
int n;
long long q, s = 0;
cin >> n >> q;
int modulo[n];
modulo[0] = 1;
for (int i = 1; i < n; i++){
modulo[i] = (modulo[i - 1] * 2) % 1000000007;
}
bool way = true;
for (int i = 0; i < n; i++){
if (way == true){
if (q % 2 == 0){
s = (modulo[n - i - 1] + s) % 1000000007;
} else {
way = false;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |