Submission #892632

#TimeUsernameProblemLanguageResultExecution timeMemory
892632vjudge1Super Dango Maker (JOI22_dango3)C++17
100 / 100
583 ms840 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; /* __ __ __ */ /* ====== _ /| /| __ _ / | | /| | @ | | | | / /| |\ | / | | @ | / */ /* || |_| |_ / |/ | | | |_ |- | |--| /-| | | \ \ |==| |- /=| | \ | | |--| | |- */ /* || | | |_ / | |__| _| |_ \__ | | / | |__ | __| | | | \ / | | \| \__ | | | | \ */ /* */ void Solve(int n, int m) { queue < pair < vector <int> ,int > > q; vector <int> in; vector <vector <int> > ans; for(int i=1;i<=n*m;i++){ in.push_back(i); } q.push({in,m}); while(!q.empty()){ vector <int> v=q.front().first; int k=q.front().second; q.pop(); if(k<=1){ ans.push_back(v); } else{ vector <int> used(v.size()); for(int i=0;i<v.size();i++){ used[i]=1; vector <int> x; for(int j=0;j<v.size();j++){ if(used[j]==0)x.push_back(v[j]); } if(Query(x)<k/2)used[i]=0; } vector <int> g1,g2; for(int i=0;i<v.size();i++){ if(used[i]==0)g1.push_back(v[i]); else g2.push_back(v[i]); } q.push({g1,k/2}); if(k%2==1)q.push({g2,k/2+1}); else q.push({g2,k/2}); } } for(auto x : ans){ Answer(x); } return; }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:28:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |             for(int i=0;i<v.size();i++){
      |                         ~^~~~~~~~~
dango3.cpp:31:30: 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=0;j<v.size();j++){
      |                             ~^~~~~~~~~
dango3.cpp:37:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |             for(int i=0;i<v.size();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...