# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
540600 | Killer2501 | Sob (COCI19_sob) | C++14 | 82 ms | 7244 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>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define pll pair<ll, ll>
#define pii pair<int, int>
#define fi first
#define se second
using namespace std;
const int N = 2e5+5;
const int M = 1e5+5;
const int mod = 1e9+7;
const ll base = 75;
const int inf = 1e9+7;
int a[N], b[N], dp[N][3];
int n, m, q;
ll ans;
void sol()
{
cin >> n >> m;
int lst = 0;
for(int i = n-1; i >= 0; )
{
for(int j = lst; j < n; j ++)
{
if(((i&(j+m)) == i))
{
int l = lst;
lst = j+1;
while(i >= 0 && j >= l && ((i&(j+m)) == i))
{
cout << i <<" "<<j+m<<'\n';
--i;
--j;
}
break;
}
}
}
}
int main()
{
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
#define task "test"
if(fopen(task".inp", "r"))
{
freopen(task".inp", "r", stdin);
freopen(task".out", "w", stdout);
}
int test = 1;
//cin >> test;
while(test -- > 0)sol();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |