CARVIEW |
Select Language
HTTP/2 200
date: Wed, 15 Oct 2025 00:26:15 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=a5cc12f6de4764d591e4a02d3c34d3551a2270a6f5a19c50b62d3b65fad63f1ba%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22KF-MXupXC_ioQnwQGo9K1BsELg54hLbA%22%3B%7D; HttpOnly; Path=/
cf-ray: 98eb2f16f9905ace-BLR
HW1_2_pointers - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #two pointers
- #4j
- s = input()
- new_s = ""
- i, j = 0, 0
- while i != len(s):
- while j != len(s) and s[i] == s[j]:
- j += 1
- new_s += f"{s[i]}{j - i}"
- i = j
- print(new_s)
- #5m
- n, s = map(int, input().split())
- a = list(map(int, input().split()))
- cnt = 0
- sum_sub = 0
- for l in range(n):
- r = l
- sum_sub = 0
- while r < n:
- sum_sub += a[r]
- if sum_sub > s:
- break
- cnt += 1
- r += 1
- print(cnt)
- #6s
- n, s = map(int, input().split())
- a = list(map(int, input().split()))
- b = list(map(int, input().split()))
- max_vk = 0
- l_max, r_max = -1, -1
- for l in range(n):
- sum_subA = a[l]
- sum_subB = b[l]
- r = l
- sum_subA = 0
- sum_subB = 0
- while r < n:
- sum_subA += a[r]
- if sum_subA > s:
- break
- sum_subB += b[r]
- r += 1
- if sum_subB > max_vk:
- max_vk = sum_subB
- l_max, r_max = l+1, r
- print(l_max, r_max)
Advertisement
Add Comment
Please, Sign In to add comment
-
π¨ Free Crypto Method π¨
JavaScript | 3 sec ago | 0.24 KB
-
β
Marketplace Glitch β
Working NEVER SEEN BE...
JavaScript | 7 sec ago | 0.25 KB
-
π‘ Instant BTC Profit Method β
Working
JavaScript | 13 sec ago | 0.24 KB
-
ββ
Exploit 2500$ in 15 Minutesβββ X
JavaScript | 15 sec ago | 0.25 KB
-
π EASY MONEY GUIDE β
Working J
JavaScript | 23 sec ago | 0.25 KB
-
π MAKE $2500 IN 15 MIN β
Working
JavaScript | 24 sec ago | 0.24 KB
-
π Instant BTC Profit Method β
Working 7
JavaScript | 31 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 35 sec ago | 0.24 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