Submission #444157

#TimeUsernameProblemLanguageResultExecution timeMemory
4441578e7The Collection Game (BOI21_swaps)C++17
50 / 100
71 ms448 KiB
//Challenge: Accepted
#include "swaps.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <set>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
void debug() {cout << endl;}
template<class T, class ... U> void debug(T a, U ... b) {cout << a << " ", debug(b ...);}
template<class T> void pary(T l, T r) {
	while (l != r) cout << *l << " ", l++;
	cout << endl;
}
#define ll long long
#define maxn 100005
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);
void solve(int N, int V) {
	vector<int> ret;
	for (int i = 0;i < N;i++) ret.push_back(i + 1);
	for (int ti = 0;ti < N;ti++) {
		vector<int> v;
		for (int i = ti % 2;i + 1 < N;i += 2) schedule(ret[i], ret[i + 1]);
		v = visit();	
		for (int i = ti % 2, j = 0;j < v.size();i += 2, j++) {
			if (v[j] == 0) {
				swap(ret[i], ret[i + 1]);
			}
		}	
	}	
	answer(ret);
}

Compilation message (stderr)

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:32:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |   for (int i = ti % 2, j = 0;j < v.size();i += 2, j++) {
      |                              ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...