message
stringlengths
2
59.7k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
37
108k
cluster
float64
20
20
__index_level_0__
int64
74
217k
Provide tags and a correct Python 3 solution for this coding contest problem. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In other words, at the end of every second, a panel t...
instruction
0
20,491
20
40,982
Tags: constructive algorithms, greedy, math Correct Solution: ``` t=int(input()) for i in range(t): n=int(input()) if n==1: print(9) elif n==2: print(98) elif n>=3: a=[9,8,9] for i in range(n-3): a.append(i%10) for i in range(n): print(a[i]...
output
1
20,491
20
40,983
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,492
20
40,984
Yes
output
1
20,492
20
40,985
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,493
20
40,986
Yes
output
1
20,493
20
40,987
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,494
20
40,988
Yes
output
1
20,494
20
40,989
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,495
20
40,990
Yes
output
1
20,495
20
40,991
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,496
20
40,992
No
output
1
20,496
20
40,993
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,497
20
40,994
No
output
1
20,497
20
40,995
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,498
20
40,996
No
output
1
20,498
20
40,997
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0. Every second, the digit shown by each panel increases by 1. In oth...
instruction
0
20,499
20
40,998
No
output
1
20,499
20
40,999
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,612
20
41,224
Tags: brute force, math Correct Solution: ``` a, b, n = map(int, input().split()) out = 0 for i in range(-1000, 1001): x = (i ** n) if a * x == b: print(i) out = 1 break if out != 1: print('No solution') ```
output
1
20,612
20
41,225
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,613
20
41,226
Tags: brute force, math Correct Solution: ``` a,b,n=map(int,input().split()) for x in range(-1000,1001): if a*x**n==b: exit(print(x)) print('No solution') ```
output
1
20,613
20
41,227
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,614
20
41,228
Tags: brute force, math Correct Solution: ``` import math wej = [int(i) for i in input().split()] a = wej[0] b = wej[1] n = wej[2] zliczenie = 0 for i in range(-1000, 1001): if a*i**n == b: print(i) zliczenie += 1 break if zliczenie == 0: print("No solution") ```
output
1
20,614
20
41,229
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,615
20
41,230
Tags: brute force, math Correct Solution: ``` a,b,n = map(int,input().split()) for x in range(1000,-1001,-1): if a*x**n==b: print(x) break else: print('No solution') # Fri Oct 16 2020 17:49:47 GMT+0300 (Москва, стандартное время) ```
output
1
20,615
20
41,231
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,616
20
41,232
Tags: brute force, math Correct Solution: ``` A,B,n=map(int,input().split()) if(A==0 and B==0): print(5) elif(A==0): print("No solution") elif((B/A)%1!=0): print("No solution") else: v=B//A if(v<0): x=-1 else: x=1 v=pow(abs(v),1/n) vv=round(v) if(abs(vv-v)>(10**(...
output
1
20,616
20
41,233
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,617
20
41,234
Tags: brute force, math Correct Solution: ``` a,b,n = map(int,input().split()) ans = "No solution" if a == 0 and b == 0: ans =5 elif a == 0 and b!= 0: ans elif a != 0 and b == 0: ans = 0 elif b%a != 0: ans else: a = b / a if a < 0 : a = abs(a) b = 0 for i in range(1001): ...
output
1
20,617
20
41,235
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,618
20
41,236
Tags: brute force, math Correct Solution: ``` import math def nthRoot(Base, n): return math.pow(Base, (1.0 / n)) container = list(map(float, input().split())) A = container[0] B = container[1] n = int(container[2]) helper = 0.0 if (A == 0 and B == 0): helper = 0 elif (A == 0 and B != 0) or (B / A < 0 and n...
output
1
20,618
20
41,237
Provide tags and a correct Python 3 solution for this coding contest problem. A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself. The total income A of his kingdom during 0-th year is known, as well as the total income ...
instruction
0
20,619
20
41,238
Tags: brute force, math Correct Solution: ``` import math def is_Integer(val): if math.ceil(val) - X < 0.000000001: return True, math.ceil(X) elif X - math.floor(X) < 0.000000001: return True, math.floor(X) else: return False, X A, B, n = [int(i) for i in input().split()] ns = 'N...
output
1
20,619
20
41,239
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,066
20
42,132
"Correct Solution: ``` import sys def arabic(s): if s == "I": return 1 elif s == "V": return 5 elif s == "X": return 10 elif s == "L": return 50 elif s == "C": return 100 elif s == "D": return 500 elif s == "M": return 1000 else: ...
output
1
21,066
20
42,133
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,067
20
42,134
"Correct Solution: ``` import sys for line in sys.stdin: roman = list(line) roman.pop() for i in range(len(roman)): if roman[i] == 'I': roman[i] = 1 elif roman[i] == 'V': roman[i] = 5 elif roman[i] == 'X': roman[i] = 10 elif roman[i] == 'L'...
output
1
21,067
20
42,135
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,068
20
42,136
"Correct Solution: ``` def r_a(x) : if x == 'I' : return 1 elif x == 'V' : return 5 elif x == 'X' : return 10 elif x == 'L' : return 50 elif x == 'C' : return 100 elif x == 'D' : return 500 elif x == 'M' : return 1000 while True : ...
output
1
21,068
20
42,137
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,069
20
42,138
"Correct Solution: ``` def Roman_numerals(x): if x=='I': return 1 elif x=='V': return 5 elif x=='X': return 10 elif x=='L': return 50 elif x=='C': return 100 elif x=='D': return 500 elif x=='M': return 1000 while True: try: s=0 string=input() for i in range(len(string)): tmp_now =Rom...
output
1
21,069
20
42,139
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,070
20
42,140
"Correct Solution: ``` def r2n(i): if i == "I": return 1 elif i == "V": return 5 elif i == "X": return 10 elif i == "L": return 50 elif i == "C": return 100 elif i == "D": return 500 elif i == "M": return 1000 while(1): try: ...
output
1
21,070
20
42,141
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,071
20
42,142
"Correct Solution: ``` while 1: try: s=input() ans=0 for i in range(len(s)-1): if s[i]=="M":ans+=1000 elif s[i]=="D": if s[i+1]=="M":ans-=500 else:ans+=500 elif s[i]=="C": if s[i+1]=="M" or s[i+1]=="D":ans-=1...
output
1
21,071
20
42,143
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,072
20
42,144
"Correct Solution: ``` import sys r={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000} for e in sys.stdin: a=0 n=[r[c]for c in e.strip()] for i in range(len(n)): if i+1<len(n)and n[i]<n[i+1]:a-=n[i] else:a+=n[i] print(a) ```
output
1
21,072
20
42,145
Provide a correct Python 3 solution for this coding contest problem. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arabic numerals | Roman numerals | Arabic numerals | Roman n...
instruction
0
21,073
20
42,146
"Correct Solution: ``` t = {"I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000} while 1: try: s = [t[i] for i in input()] except: break i = 0 while i < len(s) - 1: if s[i] < s[i + 1]: s[i + 1] = s[i + 1] - s[i] s.pop(i) i += 1 print(sum(s)) `...
output
1
21,073
20
42,147
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,074
20
42,148
Yes
output
1
21,074
20
42,149
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,075
20
42,150
Yes
output
1
21,075
20
42,151
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,076
20
42,152
Yes
output
1
21,076
20
42,153
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,077
20
42,154
Yes
output
1
21,077
20
42,155
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,078
20
42,156
No
output
1
21,078
20
42,157
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,079
20
42,158
No
output
1
21,079
20
42,159
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,080
20
42,160
No
output
1
21,080
20
42,161
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Counting was a difficult task in ancient Rome. The Arabic numerals 0,1,2,3,…, 9 have not yet been disseminated. Instead, the following symbols were used: Arabic numerals | Roman numerals | Arab...
instruction
0
21,081
20
42,162
No
output
1
21,081
20
42,163
Provide a correct Python 3 solution for this coding contest problem. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions are non-negative integer numbers and the special symbol "...
instruction
0
21,095
20
42,190
"Correct Solution: ``` OVER = 10000 def factor(): global w, pos if buf[pos] == '(': pos += 1 f, v1 = calc() if not f: return [f, 0] pos += 1 elif buf[pos] == 'i': pos += 1 v1 = complex(0, 1) else: v1 = 0 while pos < w and buf[pos].isdigit(): v1 = 10*v1 + int(buf[pos]) pos += 1 if v1 > OVER...
output
1
21,095
20
42,191
Provide a correct Python 3 solution for this coding contest problem. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions are non-negative integer numbers and the special symbol "...
instruction
0
21,096
20
42,192
"Correct Solution: ``` # AOJ 1102: Calculation of Expressions # Python3 2018.7.14 bal4u OVER = 10000 def factor(): global w, pos if buf[pos] == '(': pos += 1 f, v1 = calc() if not f: return [f, 0] pos += 1 elif buf[pos] == 'i': pos += 1 v1 = complex(0, 1) else: v1 = 0 while pos < w and buf[pos].is...
output
1
21,096
20
42,193
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions a...
instruction
0
21,097
20
42,194
No
output
1
21,097
20
42,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions a...
instruction
0
21,098
20
42,196
No
output
1
21,098
20
42,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions a...
instruction
0
21,099
20
42,198
No
output
1
21,099
20
42,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Write a program to calculate values of arithmetic expressions which may involve complex numbers. Details of the expressions are described below. In this problem, basic elements of expressions a...
instruction
0
21,100
20
42,200
No
output
1
21,100
20
42,201
Provide a correct Python 3 solution for this coding contest problem. The time was 3xxx, and the highly developed civilization was in a stagnation period. Historians decided to learn the wisdom of the past in an attempt to overcome this situation. What I paid attention to was the material left by the genius of the earl...
instruction
0
21,127
20
42,254
"Correct Solution: ``` from itertools import product import time def ok(s): if '(+' in s or '(-' in s or '(*' in s or '++' in s or '+-' in s or '-+' in s \ or '--' in s or '**' in s or '*+' in s or '*-' in s: return False if '(' in s or ')' in s: dic={} count=-1 for c in s: ...
output
1
21,127
20
42,255
Provide a correct Python 3 solution for this coding contest problem. The time was 3xxx, and the highly developed civilization was in a stagnation period. Historians decided to learn the wisdom of the past in an attempt to overcome this situation. What I paid attention to was the material left by the genius of the earl...
instruction
0
21,128
20
42,256
"Correct Solution: ``` import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int...
output
1
21,128
20
42,257
Provide a correct Python 3 solution for this coding contest problem. The time was 3xxx, and the highly developed civilization was in a stagnation period. Historians decided to learn the wisdom of the past in an attempt to overcome this situation. What I paid attention to was the material left by the genius of the earl...
instruction
0
21,129
20
42,258
"Correct Solution: ``` #!usr/bin/env python3 from collections import defaultdict from collections import deque from heapq import heappush, heappop import sys import math import bisect import random def LI(): return list(map(int, sys.stdin.readline().split())) def I(): return int(sys.stdin.readline()) def LS():return li...
output
1
21,129
20
42,259
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,298
20
42,596
Tags: greedy Correct Solution: ``` for _ in range(int(input())): n = int(input()) ans = n//2 if n%2==1: print("7"+"1"*((n-3)//2)) else: print("1"*(n//2)) ```
output
1
21,298
20
42,597
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,299
20
42,598
Tags: greedy Correct Solution: ``` cases = int(input()) while cases: cases -= 1 n = int(input()) if n % 2 == 0: ans = "1" * (n//2) else: ans = "7" + (n-3)//2 * "1" print(ans) ```
output
1
21,299
20
42,599
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,300
20
42,600
Tags: greedy Correct Solution: ``` T = int(input()) greedyMap = { 2:'1', 3:'7', 4:'4', 5:'5', 6:'9', 7:'8'} for i in range(T): n = int(input()) result = "" numOfOnes = n // 2; rem = n % 2; result += "1" * numOfOnes; if rem == 1: result = '7' + "1" * (numOfOnes -1 ) print(resul...
output
1
21,300
20
42,601
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,301
20
42,602
Tags: greedy Correct Solution: ``` for _ in range(int(input())): n = int(input()) if n==2: print(1) elif n==3: print(7) else: ans1 = str(1)*(n//2) x = n-3 ans2 = str(7)+str(1)*(x//2) if len(ans1)==len(ans2): print(ans2) else: ...
output
1
21,301
20
42,603
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,302
20
42,604
Tags: greedy Correct Solution: ``` t = int(input()) for i in range(t): n = int(input()) int_part = n//2 ost = n - int_part*2 number = '' for i in range(int_part-1): number += '1' if ost==0: number += '1' else: number = '7' + number print(number) ```
output
1
21,302
20
42,605
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,303
20
42,606
Tags: greedy Correct Solution: ``` t=int(input()) for q in range(t): n=int(input()) if n%2==0: ones='1'*(n//2) print(ones) else: ones='1'*(n//2-1) ones='7'+ones print(ones) ```
output
1
21,303
20
42,607
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,304
20
42,608
Tags: greedy Correct Solution: ``` n = int(input()) for i in range(n): kek = int(input()) lol = kek // 2 if kek % 2: print("7" + "1" * (lol - 1)) else: print("1" * lol) ```
output
1
21,304
20
42,609
Provide tags and a correct Python 3 solution for this coding contest problem. You have a large electronic screen which can display up to 998244353 decimal digits. The digits are displayed in the same way as on different electronic alarm clocks: each place for a digit consists of 7 segments which can be turned on and o...
instruction
0
21,305
20
42,610
Tags: greedy Correct Solution: ``` def lastIndex(array,element): i = len(array) - 1 while(i >= 0): if(array[i] == element): return i i = i - 1 return -1 t = int(input()) for _ in range(t): v = int(input()) array = [6,2,5,5,4,5,6,3,7,6] ...
output
1
21,305
20
42,611