Submission #433552

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4335522021-06-20 06:07:41Kevin_Zhang_TWChameleon's Love (JOI20_chameleon)C++17
20 / 100
69 ms620 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb emplace_back
#define AI(i) begin(i), end(i)
template<class T> bool chmin(T &a, T b) { return b < a && (a = b, true); }
template<class T> bool chmax(T &a, T b) { return a < b && (a = b, true); }
#ifdef KEV
#define DE(args...) kout("[ " + string(#args) + " ] = ", args)
void kout() { cerr << endl; }
template<class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ', kout(b...); }
template<class T> void debug(T l, T r) { while (l != r) cerr << *l << " \n"[next(l)==r], ++l; }
#else
#define DE(...) 0
#define debug(...) 0
#endif
#include "chameleon.h"
#include <vector>
namespace {
const int MAX_N = 1010;
int qcnt;
int qry(vector<int> p) { for (int &i : p) ++i; ++qcnt; return Query(p); }
int n, love[MAX_N];
vector<int> edge[MAX_N];
void ans(int a, int b) { ++a, ++b; if (a > b) return; Answer(a, b); }
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

chameleon.cpp: In function 'void {anonymous}::find(int, std::vector<int>)':
chameleon.cpp:45:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |    if (qry(vec) == vec.size()) return;
      |        ~~~~~~~~~^~~~~~~~~~~~~
chameleon.cpp:50:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   50 |    mid = l + r >> 1;
      |          ~~^~~
chameleon.cpp:52:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |    if (qry(vec) == vec.size())
      |        ~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from chameleon.cpp:1:
chameleon.cpp: In function 'void {anonymous}::make_edge()':
chameleon.cpp:90:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   90 |  assert(one.size() == n && two.size() == n);
      |         ~~~~~~~~~~~^~~~
chameleon.cpp:90:39: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   90 |  assert(one.size() == n && two.size() == n);
      |                            ~~~~~~~~~~~^~~~
chameleon.cpp:14:17: warning: statement has no effect [-Wunused-value]
   14 | #define DE(...) 0
      |                 ^
chameleon.cpp:96:3: note: in expansion of macro 'DE'
   96 |   DE(i, use, edge[ one[i] ].size());
      |   ^~
chameleon.cpp:15:20: warning: statement has no effect [-Wunused-value]
   15 | #define debug(...) 0
      |                    ^
chameleon.cpp:97:3: note: in expansion of macro 'debug'
   97 |   debug(AI( edge[ one[i] ]));
      |   ^~~~~
chameleon.cpp:95:7: warning: unused variable 'use' [-Wunused-variable]
   95 |   int use = qcnt - oc;
      |       ^~~
chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:128:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  128 |   for (int j = 0;j < edge[i].size();++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...