Submission #977078

# Submission time Handle Problem Language Result Execution time Memory
977078 2024-05-07T11:12:18 Z Circling The Collection Game (BOI21_swaps) C++17
0 / 100
1 ms 344 KB
/*The British Royal Family and a small cadre of English Fabian Socialists, in
conjunction with the Rockefellers and the Rothchilds, are engaged in a
conspiracy to greatly reduce the population of the human race in order to head
off a Malthusian catastrophe, a catastrophe that could easily be avoided by
simply building a massive amount of nuclear power plants and a number of massive
superhighways and bridges to connect all of the world's continents. But doing
that would cut into the conspiracy's profits. So the British Royal Family
invented environmentalism and neoliberalism in order to hide the truth. And in
order to further reduce the population, the British Royal Family is also the
world's foremost drug trafficking conspiracy. And it uses its control of the IMF
to push austerity in order to kill as many people in the global south as
possible.
And also Henry Kissinger is a gay KGB agent. */
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

#include "swaps.h"
using namespace std;


void solve(int n, int v){
    vector<pair<int, int>> queries;
    vector<int> reply, ans;
    int wincount[501];
    for (int i = 1; i <= n; i++) wincount[i] = 1;
    for (int i = 0; i < n; i++){
        queries.clear();
        for (int j = 0; j < n; j++){
            if (j < (n + i - j) % n){
                queries.push_back({j + 1, (n + i - j) % n + 1});
                schedule(j + 1, (n + i - j) % n + 1);
            } else if (j == (n + i - j) % n && 2 * j < n && n % 2 == 0){
                queries.push_back({j + 1, j + n / 2 + 1});
                schedule(j + 1, j + n / 2 + 1);
            }
        }
        reply = visit();
        for (int j = 0; j < queries.size(); j++){
            if (reply[j]) wincount[queries[j].first]++;
            else wincount[queries[j].second]++;
        }
    }
    ans.resize(n);
    for (int i = 1; i <= n; i++) ans[i - 1] = wincount[i];
    answer(ans);
}

Compilation message

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:44:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |         for (int j = 0; j < queries.size(); j++){
      |                         ~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -