Submission #993443

#TimeUsernameProblemLanguageResultExecution timeMemory
993443yellowtoadSuper Dango Maker (JOI22_dango3)C++17
20 / 100
211 ms604 KiB
#include "dango3.h" #include <iostream> #include <vector> #include <algorithm> using namespace std; namespace { vector<int> cur, tmp, ans, v, q; bool b[10010]; } // namespace void Solve(int n, int m) { for (int i = 1; i <= n*m; i++) cur.push_back(i); random_shuffle(cur.begin(),cur.end()); for (int _ = 1; _ < m-5; _++) { v.clear(); for (int i = 0; i < cur.size(); i += 8) { while (1) { q = v; for (int j = i+8; j < cur.size(); j++) if (!b[cur[j]]) q.push_back(cur[j]); if (Query(q)) break; tmp.clear(); for (int j = i; j < min(i+8,(int)cur.size()); j++) if (!b[cur[j]]) tmp.push_back(cur[j]); int l = 0, r = (int)tmp.size()-1; while (l < r) { int mid = (l+r)/2; q = v; for (int j = mid+1; j < tmp.size(); j++) q.push_back(tmp[j]); for (int j = i+8; j < cur.size(); j++) if (!b[cur[j]]) q.push_back(cur[j]); if (Query(q)) l = mid+1; else r = mid; } b[tmp[l]] = 1; v.push_back(tmp[l]); if (v.size() == n) goto skip; } } skip:; tmp.clear(); for (int i = 0; i < cur.size(); i++) if (!b[cur[i]]) tmp.push_back(cur[i]); Answer(v); cur = tmp; } for (int _ = m-5; _ < m; _++) { v.clear(); for (int i = 0; i < cur.size(); i++) { q = v; for (int j = i+1; j < cur.size(); j++) q.push_back(cur[j]); if (Query(q)) continue; b[cur[i]] = 1; v.push_back(cur[i]); if (v.size() == n) goto skipp; } skipp:; tmp.clear(); for (int i = 0; i < cur.size(); i++) if (!b[cur[i]]) tmp.push_back(cur[i]); Answer(v); cur = tmp; } Answer(cur); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:19:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for (int i = 0; i < cur.size(); i += 8) {
      |                     ~~^~~~~~~~~~~~
dango3.cpp:22:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         for (int j = i+8; j < cur.size(); j++) if (!b[cur[j]]) q.push_back(cur[j]);
      |                           ~~^~~~~~~~~~~~
dango3.cpp:30:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |           for (int j = mid+1; j < tmp.size(); j++) q.push_back(tmp[j]);
      |                               ~~^~~~~~~~~~~~
dango3.cpp:31:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |           for (int j = i+8; j < cur.size(); j++) if (!b[cur[j]]) q.push_back(cur[j]);
      |                             ~~^~~~~~~~~~~~
dango3.cpp:37:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |         if (v.size() == n) goto skip;
      |             ~~~~~~~~~^~~~
dango3.cpp:42:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |     for (int i = 0; i < cur.size(); i++) if (!b[cur[i]]) tmp.push_back(cur[i]);
      |                     ~~^~~~~~~~~~~~
dango3.cpp:48:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |     for (int i = 0; i < cur.size(); i++) {
      |                     ~~^~~~~~~~~~~~
dango3.cpp:50:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |       for (int j = i+1; j < cur.size(); j++) q.push_back(cur[j]);
      |                         ~~^~~~~~~~~~~~
dango3.cpp:54:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   54 |       if (v.size() == n) goto skipp;
      |           ~~~~~~~~~^~~~
dango3.cpp:58:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   58 |     for (int i = 0; i < cur.size(); i++) if (!b[cur[i]]) tmp.push_back(cur[i]);
      |                     ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...