Submission #803382

#TimeUsernameProblemLanguageResultExecution timeMemory
803382ono_de206Distributing Candies (IOI21_candies)C++17
Compilation error
0 ms0 KiB
#include "candies.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second //#define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; vi distribute_candies(vi c, vi l, vi r, vi v) { int n = c.size(), q = l.size(); if(n * m <= 2000 * 2000) { vector<int> ret(n); for(int i = 0; i < q; i++) { for(int j = l[i]; j <= r[i]; j++) { ret[j] += v[i]; mxx(ret[j], 0); mnn(ret[j], c[j]); } } return ret; } }

Compilation message (stderr)

candies.cpp: In function 'vi distribute_candies(vi, vi, vi, vi)':
candies.cpp:23:12: error: 'm' was not declared in this scope
   23 |     if(n * m <= 2000 * 2000) {
      |            ^
candies.cpp:28:17: error: 'mxx' was not declared in this scope
   28 |                 mxx(ret[j], 0);
      |                 ^~~
candies.cpp:29:17: error: 'mnn' was not declared in this scope
   29 |                 mnn(ret[j], c[j]);
      |                 ^~~
candies.cpp:22:34: warning: control reaches end of non-void function [-Wreturn-type]
   22 |     int n = c.size(), q = l.size();
      |                                  ^