Submission #1258152

#TimeUsernameProblemLanguageResultExecution timeMemory
1258152_rain_Sob (COCI19_sob)C++20
110 / 110
41 ms7240 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

#define FOR(i,a,b) for(int i = (a) , _b = (b); i <= _b; ++i)
#define BIT(maks , x) (((mask) >> (x)) & (1))
#define MASK(x) ((LL)(1)<<(x))

template<class X,class Y>
	bool maximize(X &x , Y y){
		if (x < y) return x = y , true; else return false;
	}
template<class X,class Y>
	bool minimize(X &x,Y y){
		if (x > y) return x = y , true; else return false;
	}


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0) ; cout.tie(0) ;
	#define name "main"
		if (fopen(name".inp","r")){
			freopen(name".inp","r",stdin);
			freopen(name".out","w",stdout);
		}
		
		int n , m;
		cin >> n >> m;
		int cur = m , x = n - 1;
		while (cur <= m + n - 1){
			int last = cur;
			while (cur <= m + n - 1 && (cur & x) != x){
				++cur;
			}
			for(int i = cur; i >= last ; --i , --x){
				cout<<x<<' '<<i<<'\n';
				assert((i&x)==x);
			}
			++cur;
		}
	return 0;
}

Compilation message (stderr)

sob.cpp: In function 'int main()':
sob.cpp:24:32: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |                         freopen(name".inp","r",stdin);
      |                         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
sob.cpp:25:32: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |                         freopen(name".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...