Submission #540598

#TimeUsernameProblemLanguageResultExecution timeMemory
540598Killer2501Sob (COCI19_sob)C++14
0 / 110
1 ms340 KiB
#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], lst[N]; 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)) { while(i >= 0 && ((i&(j+m)) == i)) { cout << i <<" "<<j+m<<'\n'; --i; --j; } lst = j+1; 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)

sob.cpp: In function 'int main()':
sob.cpp:49:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   49 |   freopen(task".inp", "r", stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
sob.cpp:50:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |   freopen(task".out", "w", stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...