Submission #1087414

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10874142024-09-12 16:06:13pokmui9909Cultivation (JOI17_cultivation)C++17
100 / 100
1859 ms4856 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
#define x first
#define y second
ll H, W, N, F[3][305][305];
pair<ll, ll> A[305];
struct Data{
ll l, r, c[3];
};
ll Add[605], Del[605];
ll Solve(ll len){
for(ll i = 0; i <= 2 * N; i++){
Add[i] = Del[i] = 0;
}
vector<ll> Num;
A[N + 1].x = 1e18;
for(ll i = 1, j = 1; j <= N;){
if(A[i].x < A[j].x + len + 1){
Num.push_back(A[i].x);
i++;
} else {
Num.push_back(A[j].x + len + 1);
j++;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cultivation.cpp: In function 'll Solve(ll)':
cultivation.cpp:35:21: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |         while(p + 1 < Num.size() && !(Num[p] <= A[i].x && A[i].x < Num[p + 1])) p++;
      |               ~~~~~~^~~~~~~~~~~~
cultivation.cpp:36:21: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |         while(q + 1 < Num.size() && !(Num[q] <= A[i].x + len && A[i].x + len < Num[q + 1])) q++;
      |               ~~~~~~^~~~~~~~~~~~
cultivation.cpp:40:21: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<Data>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |     for(ll i = 0; i < V.size(); i++){
      |                   ~~^~~~~~~~~~
cultivation.cpp:42:42: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<Data>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |         V[i].l = Num[i], V[i].r = (i + 1 == V.size() ? INF : Num[i + 1] - 1);
      |                                    ~~~~~~^~~~~~~~~~~
cultivation.cpp:48:28: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<Data>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |     for(ll i = 0, j = 0; i < V.size(); i++){
      |                          ~~^~~~~~~~~~
cultivation.cpp:53:17: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<Data>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   53 |         while(j < V.size() && V[j].l <= V[i].l + H - 1){
      |               ~~^~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...