CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 23:18:26 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=3c0d60d11adf71ceccaa2d4d129195faf4f20a033b3b4866b9d5710a5b35f203a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22V8hpa-2lgo2NyfSlEeeF2KEgFjvl8snn%22%3B%7D; HttpOnly; Path=/
cf-ray: 98da50faaec6165e-BLR
sum of chocolates - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- int main(){
- ll n,l;
- cin>>n>>l;
- ll a[n+1];
- for (ll i=1; i<=n; i++){
- cin>>a[i];
- }
- ll i=1;
- ll sum=0;
- for (ll j=1; j<=n; j++){
- sum+=a[j];
- while (sum>l){
- sum-=a[i++];
- }
- if (sum==l){
- for (ll k=i; k<=j; k++){
- cout<<a[k]<<" ";
- }
- return 0;
- }
- }
- cout<<-1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
π Instant BTC Profit Method β
Working O
JavaScript | 8 sec ago | 0.25 KB
-
β
Make $2500 in 20 minutesβ F
JavaScript | 17 sec ago | 0.25 KB
-
π Swapzone +37% glitch β J
JavaScript | 26 sec ago | 0.25 KB
-
β
β Make huge profits on trading ββ 5
JavaScript | 35 sec ago | 0.25 KB
-
π Swapzone +37% glitch β J
JavaScript | 1 min ago | 0.25 KB
-
Auto-mapper_MC
Lua | 1 min ago | 6.55 KB
-
β
β Make huge profits on trading ββ 5
JavaScript | 1 min ago | 0.25 KB
-
β
Marketplace Glitch β
Working NEVER SEEN BE...
JavaScript | 1 min ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand