message
stringlengths
2
65.1k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
0
108k
cluster
float64
14
14
__index_level_0__
int64
0
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,667
14
209,334
Tags: combinatorics, math, sortings Correct Solution: ``` import math,sys input=sys.stdin.readline from collections import Counter def fact(n): res = 1 for i in range(2, n+1): res = res * i return res def nCr(n, r): p=10**9 +7 # initialize numerator # and denomi...
output
1
104,667
14
209,335
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,668
14
209,336
Tags: combinatorics, math, sortings Correct Solution: ``` import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.m...
output
1
104,668
14
209,337
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,669
14
209,338
Tags: combinatorics, math, sortings Correct Solution: ``` mod=10**9+7 def ncr(a,b): c=1 for i in range(a,b,-1): c=(c*i)%mod d=1 for i in range(1,a-b+1): d=(d*i)%mod d=pow(d,mod-2,mod) return (c*d)%mod t=int(input()) for _ in range(t): n,k=map(int,input().split()) l=list(m...
output
1
104,669
14
209,339
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,670
14
209,340
Tags: combinatorics, math, sortings Correct Solution: ``` from math import factorial n = int(input()) for k in range(n): a = list(map(int, input().split())) b = list(map(int, input().split())) b.sort() temp = b[a[0]-a[1]:] not_chosen = b[:a[0]-a[1]] if not_chosen.count(b[a[0]-a[1]]) > 0: ...
output
1
104,670
14
209,341
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,671
14
209,342
Tags: combinatorics, math, sortings Correct Solution: ``` from itertools import repeat, groupby def line(): return map(int, input().split()) def num(): return int(input()) def nfunc(f, n, *args, **kwargs): return (f(*args, **kwargs) for _ in repeat(None, n)) t = num() for _ in repeat(None, t): n,k = ...
output
1
104,671
14
209,343
Provide tags and a correct Python 3 solution for this coding contest problem. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numbered i has a_i followers. Since Masha has a li...
instruction
0
104,672
14
209,344
Tags: combinatorics, math, sortings Correct Solution: ``` import io,os input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline N = 10001 # array to store inverse of 1 to N factorialNumInverse = [None] * (N + 1) # array to precompute inverse of 1! to N! naturalNumInverse = [None] * (N + 1) # array to store facto...
output
1
104,672
14
209,345
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,673
14
209,346
Yes
output
1
104,673
14
209,347
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,674
14
209,348
Yes
output
1
104,674
14
209,349
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,675
14
209,350
Yes
output
1
104,675
14
209,351
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,676
14
209,352
Yes
output
1
104,676
14
209,353
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,677
14
209,354
No
output
1
104,677
14
209,355
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,678
14
209,356
No
output
1
104,678
14
209,357
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,679
14
209,358
No
output
1
104,679
14
209,359
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Masha works in an advertising agency. In order to promote the new brand, she wants to conclude contracts with some bloggers. In total, Masha has connections of n different bloggers. Blogger numb...
instruction
0
104,680
14
209,360
No
output
1
104,680
14
209,361
Provide tags and a correct Python 3 solution for this coding contest problem. Dima loves Inna very much. He decided to write a song for her. Dima has a magic guitar with n strings and m frets. Dima makes the guitar produce sounds like that: to play a note, he needs to hold one of the strings on one of the frets and th...
instruction
0
104,794
14
209,588
Tags: brute force, implementation, math Correct Solution: ``` def solution() : # ζœ€ε€§ηš„θ·η¦»ζ₯θ‡ͺδΊŽθ§’θ½ι™„θΏ‘ηš„η‚Ή n,m,k,s = map(int, input().split()) dis = lambda a,b : abs(a[0] - b[0]) + abs(a[1] - b[1]) corner = [(0,0), (0,m-1), (n-1,0), (n-1,m-1)] vertex = [[(n,m), (n,-1), (-1,m), (-1,-1)] for _ in range(k+1)] for i in range(n) ...
output
1
104,794
14
209,589
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dima loves Inna very much. He decided to write a song for her. Dima has a magic guitar with n strings and m frets. Dima makes the guitar produce sounds like that: to play a note, he needs to hol...
instruction
0
104,795
14
209,590
No
output
1
104,795
14
209,591
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,339
14
210,678
Tags: data structures, implementation Correct Solution: ``` from collections import defaultdict n,k=map(int,input().split()) l=list(map(int,input().split())) s=[] x=0 d=defaultdict(int) for i in l: if d[i]==0: s.append(i) d[i]=1 x+=1 if x>k: q=s.pop(0) d[q]=0 x-=1...
output
1
105,339
14
210,679
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,340
14
210,680
Tags: data structures, implementation Correct Solution: ``` def solve(nums, k): l = list() h = set() for j in nums: if j not in h: if len(l) == k: h.remove(l[0]) l.pop(0) l.append(j) h.add(j) return l def main(): _, k =...
output
1
105,340
14
210,681
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,341
14
210,682
Tags: data structures, implementation Correct Solution: ``` from collections import deque n, k = map(int, input().split()) arr = list(map(int, input().split())) d = deque() s = set() for v in arr: if v in s: continue d.append(v) s.add(v) if len(d) > k: s.remove(d.popleft()) print(l...
output
1
105,341
14
210,683
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,342
14
210,684
Tags: data structures, implementation Correct Solution: ``` # Bhagwaan codeforces n, k = map(int, input().split()) a = list(map(int, input().split())) import queue s = set() q = queue.Queue() count = 0 for x in a: if x not in s: if count < k: q.put(x) s.add(x) count +=...
output
1
105,342
14
210,685
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,343
14
210,686
Tags: data structures, implementation Correct Solution: ``` from collections import deque n,k=map(int,input().split()) q=list(map(int,input().split())) z={} w=deque() for i in q: if not(i in z and z[i]==1): z[i]=1 if len(w)<k: w.append(i) else: x=w.popleft() z[x]=-1 ...
output
1
105,343
14
210,687
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,344
14
210,688
Tags: data structures, implementation Correct Solution: ``` n,k=map(int,input().split()) a=list(map(int,input().split())) d=[] s=set() for i in a: if i not in s: d.append(i) s.add(i) if len(d)>k: s.remove(d.pop(0)) print(len(d)) print(*d[::-1]) ```
output
1
105,344
14
210,689
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,345
14
210,690
Tags: data structures, implementation Correct Solution: ``` import collections def ii(): return int(input()) def fi(): return float(input()) def si(): return input() def mi(): return map(int,input().split()) def li(): return list(mi()) n,k=mi() d=li() b=collections.deque([]) s=set(d) l1=list(s) di={} for i in range(len...
output
1
105,345
14
210,691
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k most recent conversations with your friends. Init...
instruction
0
105,346
14
210,692
Tags: data structures, implementation Correct Solution: ``` '''Author- Akshit Monga''' from collections import deque from sys import stdin,stdout input=stdin.readline t=1 for _ in range(t): n,k=map(int,input().split()) a=[int(x) for x in input().split()] d={} arr=deque() for i in a: if not(i...
output
1
105,346
14
210,693
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,347
14
210,694
Yes
output
1
105,347
14
210,695
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,348
14
210,696
Yes
output
1
105,348
14
210,697
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,349
14
210,698
Yes
output
1
105,349
14
210,699
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,350
14
210,700
Yes
output
1
105,350
14
210,701
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,351
14
210,702
No
output
1
105,351
14
210,703
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,352
14
210,704
No
output
1
105,352
14
210,705
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,353
14
210,706
No
output
1
105,353
14
210,707
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions are constraints on n and k. You are messaging in one of the popular social networks via your smartphone. Your smartphone can show at most k mo...
instruction
0
105,354
14
210,708
No
output
1
105,354
14
210,709
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,804
14
211,608
Tags: implementation, math Correct Solution: ``` import math name=['Sheldon','Leonard','Penny','Rajesh','Howard'] n=int(input()) for i in range(100000000): if math.floor(n/5)-(2**i-1)<2**i: h=i #print(h) print(name[math.ceil((n-5*(2**h-1))/2**h-1)]) exit() ```
output
1
105,804
14
211,609
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,805
14
211,610
Tags: implementation, math Correct Solution: ``` n = int(input()) while(n>5): n = n-4 n = n/2 n = int(n) l = ["Sheldon", "Leonard", "Penny", "Rajesh", "Howard"] print(l[n-1]) ```
output
1
105,805
14
211,611
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,806
14
211,612
Tags: implementation, math Correct Solution: ``` n = int(input()) s = 1+float(n)/5 import math k = math.ceil((math.log(s,2))) deta = n-5*(2**(k-1)-1) test = math.ceil(deta/(2**(k-1))) if test == 1: print("Sheldon") if test == 2: print("Leonard") if test == 3: print("Penny") if test == 4: print("Rajesh")...
output
1
105,806
14
211,613
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,807
14
211,614
Tags: implementation, math Correct Solution: ``` import sys class Scanner: def __init__(self): self.current_tokens = [] def remaining_tokens(self): return len(self.current_tokens) def nextline(self): assert self.remaining_tokens() == 0, "Reading next line with remaining tokens" ...
output
1
105,807
14
211,615
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,808
14
211,616
Tags: implementation, math Correct Solution: ``` import math def doubleCola(n: int) -> str: dictionary = { 1:'Sheldon', 2:'Leonard', 3:'Penny', 4:'Rajesh', 5:'Howard' } lowerBound = 1 upperBound = 5 currentNumber = 1 while n >...
output
1
105,808
14
211,617
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,809
14
211,618
Tags: implementation, math Correct Solution: ``` # A. Double Cola # 82A names = ['Sheldon', 'Leonard', 'Penny', 'Rajesh', 'Howard'] n = int(input()) - 1 # print(f'n is initially {n}') r = 0 while n >= 5 * 2**r: # print() n -= 5 * 2**r # print(f'subtracting n by {5 * 2**r}') r += 1 # print(f'Now n...
output
1
105,809
14
211,619
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,810
14
211,620
Tags: implementation, math Correct Solution: ``` import math n = int(input()) for i in range(1, 30): if 5 * (2 ** (i - 1) - 1) < n <= 5 * (2 ** i - 1): k = i break man = ["null","Sheldon","Leonard","Penny","Rajesh","Howard"] c = math.ceil((n - 5 * (2 ** (k - 1) - 1)) / (2 ** (k - 1))) print(...
output
1
105,810
14
211,621
Provide tags and a correct Python 3 solution for this coding contest problem. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons...
instruction
0
105,811
14
211,622
Tags: implementation, math Correct Solution: ``` from math import ceil d = {0: "Sheldon", 1: "Leonard", 2: "Penny", 3: "Rajesh", 4: "Howard"} n = int(input()) i = 1 while n > i*5: n -= i*5 i *= 2 print(d[ceil(n/i)-1]) ```
output
1
105,811
14
211,623
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,812
14
211,624
Yes
output
1
105,812
14
211,625
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,813
14
211,626
Yes
output
1
105,813
14
211,627
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,814
14
211,628
Yes
output
1
105,814
14
211,629
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,815
14
211,630
Yes
output
1
105,815
14
211,631
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,816
14
211,632
No
output
1
105,816
14
211,633
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,817
14
211,634
No
output
1
105,817
14
211,635
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,818
14
211,636
No
output
1
105,818
14
211,637
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a "Double Cola" drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, dr...
instruction
0
105,819
14
211,638
No
output
1
105,819
14
211,639
Provide tags and a correct Python 3 solution for this coding contest problem. You have a set of n weights. You know that their masses are a_1, a_2, ..., a_n grams, but you don't know which of them has which mass. You can't distinguish the weights. However, your friend does know the mass of each weight. You can ask yo...
instruction
0
106,147
14
212,294
Tags: dp, math Correct Solution: ``` from collections import defaultdict def calcBinomials(N): global binom N += 1 binom = [[0]*N for _ in range(N)] for n in range(N): binom[n][0] = binom[n][n] = 1 for k in range(1, n): binom[n][k] = binom[n-1][k] + binom[n-1][k-1] n = int(...
output
1
106,147
14
212,295
Provide tags and a correct Python 3 solution for this coding contest problem. Have you ever used the chat application QQ? Well, in a chat group of QQ, administrators can muzzle a user for days. In Boboniu's chat group, there's a person called Du Yi who likes to make fun of Boboniu every day. Du will chat in the grou...
instruction
0
106,321
14
212,642
Tags: dp, greedy, sortings, two pointers Correct Solution: ``` import math,sys,bisect,heapq,os from collections import defaultdict,Counter,deque from itertools import groupby,accumulate from functools import lru_cache #sys.setrecursionlimit(200000000) pr = lambda x: x def input(): return sys.stdin.readline().rstrip(...
output
1
106,321
14
212,643