Submission #942529

#TimeUsernameProblemLanguageResultExecution timeMemory
942529makravSuper Dango Maker (JOI22_dango3)C++17
100 / 100
1159 ms992 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() vector<int> sol(int n, int m, vector<int> nums) { random_shuffle(all(nums)); vector<int> used(n * m, 0), ans; for (int i = 0; i < n * m; i++) { if (ans.size() == n) return ans; vector<int> lol; used[i] = 1; for (int j = 0; j < n * m; j++) { if (!used[j]) lol.push_back(nums[j]); } int A = Query(lol); if (A != m - 1) { used[i] = 0; continue; } ans.push_back(nums[i]); } return ans; } void Solve(int N, int M) { vector<int> used(N * M, 0); for (int j = 0; j < M; j++) { vector<int> curost; for (int i = 0; i < N * M; i++) { if (!used[i]) curost.push_back(i + 1); } vector<int> answ = sol(N, M - j, curost); Answer(answ); for (int j = 0; j < answ.size(); j++) used[answ[j] - 1] = 1; } }

Compilation message (stderr)

dango3.cpp: In function 'std::vector<int> sol(int, int, std::vector<int>)':
dango3.cpp:12:24: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   12 |         if (ans.size() == n) return ans;
      |             ~~~~~~~~~~~^~~~
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:37:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |         for (int j = 0; j < answ.size(); j++) used[answ[j] - 1] = 1;
      |                         ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...