Submission #442763

#TimeUsernameProblemLanguageResultExecution timeMemory
442763ToniBSob (COCI19_sob)C++14
110 / 110
127 ms15144 KiB
#include <iostream> #include <algorithm> #include <string> #include <queue> #include <vector> #include <set> #include <map> #include <stack> #include <cmath> #include <ext/pb_ds/assoc_container.hpp> #include <bitset> using namespace std; using namespace __gnu_pbds; #define FOR(i, x, n) for(int i = x; i < n; ++i) #define REP(i, n) for(int i = 0; i < n; ++i) #define TRACE(x) cerr << #x << " " << x << endl; #define endl "\n" #define mp make_pair typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MOD = 1e9+7; const int inf = 2147483647; const int maxN = 1e6 + 2; int m, n; vector<int> x, y; int p1, p2, plast; vector<pii> ans; int main(){ // ios_base::sync_with_stdio(0); cin >> n >> m; REP(i, n) x.push_back(i); for(int i = m; i < m+n; ++i){ y.push_back(i); } p2 = n-1; while(p2 >= 0){ plast = p1; while((y[p1] & x[p2]) != x[p2]){ p1++; } for(int i = p1; i >= plast; --i){ ans.push_back(mp(x[p2], y[i])); p2--; } p1++; } REP(i, ans.size()){ cout << ans[i].first << " " << ans[i].second << endl; } return 0; }

Compilation message (stderr)

sob.cpp: In function 'int main()':
sob.cpp:15:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 | #define REP(i, n) for(int i = 0; i < n; ++i)
......
   49 |  REP(i, ans.size()){
      |      ~~~~~~~~~~~~~                  
sob.cpp:49:2: note: in expansion of macro 'REP'
   49 |  REP(i, ans.size()){
      |  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...