Submission #1021203

#TimeUsernameProblemLanguageResultExecution timeMemory
1021203amunduzbaevSki 2 (JOI24_ski2)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define ar array typedef long long ll; #define int ll const int inf = 1e9; const ll INF = 1e15; const int N = 305; ll dp[2][N][N]; signed main() { ios::sync_with_stdio(0); cin.tie(0); int n, k; cin >> n >> k; vector<int> h(n), c(n); for(int i=0;i<n;i++){ cin >> h[i] >> c[i]; } vector<int> p(n); iota(p.begin(), p.end(), 0); sort(p.begin(), p.end(), [&](int i, int j){ if(h[i] != h[j]) return h[i] < h[j]; else return c[i] < c[j]; }); memset(dp, 63, sizeof dp); //~ cout<<"here"<<endl; dp[0][0][1] = 0; int t = 0, s = 1; ll mn = INF; //~ const int MX = N + N; vector<int> H = h; sort(H.begin(), H.end()); for(int i=1;i<n;i++){ if(H[i] <= H[i - 1]) H[i] = H[i - 1] + 1; } int i = 0; for(auto h_ : H){ int j = i; while(j < n && h[p[j]] == h_){ j++; } memset(dp[s], 63, sizeof dp[s]); int cur = j - i; for(int c=0;c<=i;c++){ for(int cnt=0;cnt<=i+1;cnt++){ //~ if(dp[t][c][cnt] >= INF) continue; if(cnt <= c + cur){ dp[s][c + cur - cnt][cnt] = min(dp[s][c + cur - cnt][cnt], dp[t][c][cnt] + (c + cur - cnt) * 1ll * k); } else { dp[s][0][cnt] = min(dp[s][0][cnt], dp[t][c][cnt]); } //~ for(int x=min(cnt, c + cur);x<=c + cur;x++){ //~ dp[s][c + cur - x][max(cnt, x)] = min(dp[s][c + cur - x][max(cnt, x)], dp[t][c][cnt] + max(0ll, x - cnt) * 1ll * mn + (c + cur - x) * 1ll * k); //~ } } } for ( int c=j;c>0;c--) { for(int cnt=0;cnt<=j+1;cnt++){ dp[s][c - 1][cnt + 1] = min(dp[s][c - 1][cnt + 1], dp[s][c][cnt] + mn - k); } } swap(s, t); while(i < j){ mn = min(mn, 1ll * c[p[i]]); i++; } } mn = INF; for(int i=0;i<=n;i++){ mn = min(mn, dp[t][0][i]); } //~ cout<<dp[t][0][ cout<<mn<<"\n"; }  

Compilation message (stderr)

Main.cpp:93:1: error: extended character   is not valid in an identifier
   93 |  
      | ^
Main.cpp:93:1: error: '\U000000a0' does not name a type
   93 |  
      | ^