Submission #1022138

# Submission time Handle Problem Language Result Execution time Memory
1022138 2024-07-13T10:26:28 Z edogawa_something Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7252 KB
#include "candies.h"

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define pb push_back
#define F first 
#define S second 
const ll M=2e5+10;

vector<int> distribute_candies(vector<int>c,vector<int>l,vector<int>r,vector<int>v){
    vector<int>ans(c.size());
    for(int i=0;i<l.size();i++){
        for(int j=l[i];j<=r[i];j++){
            ans[j]+=v[j];
            ans[j]=max(ans[j],0);
            ans[j]=min(ans[j],c[j]);
        }
    }
    return ans;
}

Compilation message

candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
candies.cpp:15:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for(int i=0;i<l.size();i++){
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5070 ms 7252 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -