This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
int INF = 1LL<<30;
int maxbloat = 1008;
signed main() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
//freopen("input.txt", "r", stdin);
// for writing output to output.txt
// freopen("output.txt", "w", stdout);
#endif
/*#ifdef ONLINE_JUDGE
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif*/ //fast IO
int n,l; cin >> n >> l;
vector<int> balls;
for (int i=0; i<n; i++) {
int x; cin >> x; balls.push_back(x);
}
vector<int> coords;
for (int i=0; i<n; i++) {
coords.push_back(balls[i]);
}
coords.erase(unique(coords.begin(), coords.end()), coords.end());
int q; cin >> q;
if (coords.size()>maxbloat) {
while (q--) {
int s,g,t; cin >> s >> g >> t; cout << "No" << endl;
}
return 0;
}
//dp[l][r-l][x-l] = min cost of picking up balls l through r, if we start at pos of ball x (l<=x<=r)
n = coords.size();
vector<vector<vector<int>>> dp(n);
for (int l=0; l<n; l++) {
dp[l].resize(n-l);
for (int r=l; r<n; r++) {
dp[l][r-l]=vector<int>(r-l+1,INF);
}
}
}
Compilation message (stderr)
Main.cpp: In function 'int main()':
Main.cpp:31:22: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
31 | if (coords.size()>maxbloat) {
| ~~~~~~~~~~~~~^~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |