Submission #1030770

#TimeUsernameProblemLanguageResultExecution timeMemory
1030770AntekbTower (JOI24_tower)C++17
5 / 100
68 ms16732 KiB
#include "bits/stdc++.h" /** keep-include */ using namespace std; #define rep(i, b, e) for(int i = (b); i <= (e); i++) #define per(i, b, e) for(int i = (e); i >= (b); i--) #define FOR(i, b, e) rep(i, b, (e) - 1) #define SZ(x) int(x.size()) #define all(x) x.begin(), x.end() #define pb push_back #define mp make_pair #define st first #define nd second using ll = long long; using vi = vector<int>; using pii = pair<int, int>; auto &operator<<(auto &o, pair<auto, auto> p) { return o << "(" << p.st << ", " << p.nd << ")"; } auto operator<<(auto &o, auto x)->decltype(end(x), o) { o << "{"; int i=0; for(auto e: x) o << ", " + 2*!i++ << e; return o << "}"; } #ifdef LOCAL #define deb(x...) cerr << "[" #x "]: ", [](auto...$) { \ ((cerr << $ << "; "),...) << endl; }(x) #else #define deb(...) #endif void solve() { int n, q; cin>>n>>q; ll A, B, D; cin>>D>>A>>B; int dl=1e6+5; vector<bool> blo(dl); vector<ll> odl(dl, 1e18); for(int i=0; i<n; i++){ ll l, r; cin>>l>>r; for(int j=l; j<=r; j++){ blo[j]=1; } } odl[0]=0; for(int i=1; i<dl; i++){ if(!blo[i]){ odl[i]=min(odl[i], odl[i-1]+A); if(i>=D)odl[i]=min(odl[i], odl[i-D]+B); } } while(q--){ ll x; cin>>x; if(odl[x]!=1e18)cout<<odl[x]<<"\n"; else cout<<"-1\n"; } } int main() { cin.tie(0)->sync_with_stdio(0); int tt = 1; // cin >> tt; FOR(te, 0, tt) solve(); return 0; }

Compilation message (stderr)

Main.cpp:17:18: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   17 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                  ^~~~
Main.cpp:17:32: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   17 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                                ^~~~
Main.cpp:17:38: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   17 | auto &operator<<(auto &o, pair<auto, auto> p) {
      |                                      ^~~~
Main.cpp:19:17: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | auto operator<<(auto &o, auto x)->decltype(end(x), o) {
      |                 ^~~~
Main.cpp:19:26: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | auto operator<<(auto &o, auto x)->decltype(end(x), o) {
      |                          ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...