description
stringlengths
171
4k
code
stringlengths
94
3.98k
normalized_code
stringlengths
57
4.99k
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() m = list(s) ch = s.split("@") if len(s) < 3: print("No solution") elif s.count("@") == 0 or s[0] == "@" or s[len(s) - 1] == "@": print("No solution") else: test = True for i in range(1, len(ch) - 1): if len(ch[i]) < 2: test = False break if test == False: ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING IF FUNC_CALL VAR STRING NUMBER VAR NUMBER STRING VAR BIN_OP FUNC_CALL VAR VAR NUMBER STRING EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CAL...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() result, res, last, case, k = "", "", "", 0, 0 for i, x in enumerate(s): if last == "": if x == "@": print("No solution") k = 1 break else: res += x elif x == "@": if case == 1: print("No solution") k = 1 ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR STRING STRING STRING NUMBER NUMBER FOR VAR VAR FUNC_CALL VAR VAR IF VAR STRING IF VAR STRING EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER VAR VAR IF VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR VAR IF VAR NUMBER VAR VAR VAR...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() if "@" not in s: print("No solution") exit() if s[0] == "@" or s[-1] == "@": print("No solution") exit() s = s.split("@") for i in s: if i == "": print("No solution") exit() ans = [] s1 = s[0] for i in s[1:-1]: if len(i) == 1: print("No solution") exit...
ASSIGN VAR FUNC_CALL VAR IF STRING VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF VAR NUMBER STRING VAR NUMBER STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING FOR VAR VAR IF VAR STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR VAR NUMBER FOR VAR VAR...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() a = [] b = [] x = 0 if s[0] == chr(64) or s[-1] == chr(64): x += 1 else: for i in range(len(s)): if s[i] == chr(64): a.append(i) if len(a) == 1: b.append(s) elif len(a) == 0: x += 1 else: for i in range(1, len(a)): if a[i] - a[i - 1...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR NUMBER IF VAR NUMBER FUNC_CALL VAR NUMBER VAR NUMBER FUNC_CALL VAR NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR ...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
def solution(): s = input() if "@" not in s: return "No solution" mas = s.split("@") if len(mas[0]) < 1 or len(mas[-1]) < 1: return "No solution" front = mas[0] back = mas[-1] mas = mas[1 : len(mas) - 1] for i in range(len(mas)): if len(mas[i]) < 2: re...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR IF STRING VAR RETURN STRING ASSIGN VAR FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER NUMBER RETURN STRING ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = str(input()) if s[0] == "@" or s[-1] == "@" or "@" not in s: print("No solution") else: ans = [] n = len(s) l = [] for i in range(n): if s[i] == "@": l.append(i) lenl = len(l) f = 0 for i in range(lenl - 1): if l[i + 1] - l[i] <= 2: f = 1 ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER STRING VAR NUMBER STRING STRING VAR EXPR FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP V...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() l = len(s) f = 0 s1 = "" s2 = "" ff = 0 list1 = [] for i in range(l): if s[i] != "@": if ff == 0: s1 += s[i] else: s2 += s[i] list1.append(s1 + "@" + s2) s1 = "" s2 = "" ff = 0 elif s1 and ff == 0: ff = 1...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF VAR NUMBER VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR STRING VAR ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR N...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input().split("@") b = True t = len(s) if t < 2: b = False for i in range(t): if i == 0 or i == t - 1: if len(s[i]) < 1: b = False elif len(s[i]) < 2: b = False if b: for i in range(t): if 0 != i and i != t - 1: print("%s,%s@" % (s[i][0:1], s[i][1 : le...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR NUMBER VAR BIN_OP VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUMBER IF VAR FOR VAR FUNC_CALL VAR VAR IF N...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() try: exit = s[::-1] exit = len(exit) - exit.index("@") - 1 except ValueError: print("No solution") else: if s[0] != "@" and s[len(s) - 1] != "@" and len(s) > 2: mas = [] res = "" t = True for i in range(len(s)): res = res + s[i] if s[i]...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR STRING NUMBER VAR EXPR FUNC_CALL VAR STRING IF VAR NUMBER STRING VAR BIN_OP FUNC_CALL VAR VAR NUMBER STRING FUNC_CALL VAR VAR NUMBER ASSIGN VAR LIST ASSIGN VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
import sys def input(): return sys.stdin.readline().strip() def iinput(): return int(input()) def tinput(): return input().split() def rinput(): return map(int, tinput()) def rlinput(): return list(rinput()) address = input() str = "" i = 0 ans = [] n = len(address) flag = False while i ...
IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR FUNC_CALL...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
import sys def input(): return sys.stdin.readline().strip() def iinput(): return int(input()) def rinput(): return map(int, sys.stdin.readline().strip().split()) def get_list(): return list(map(int, sys.stdin.readline().strip().split())) mod = int(1000000000.0) + 7 s = input() l = len(s) ans =...
IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN V...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
def main(): string = input() comps = string.split("@") ans = [] if "@" not in string: print("No solution") return for i in range(len(comps)): if i == 0 or i == len(comps) - 1: if len(comps[i]) < 1: print("No solution") return ...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR LIST IF STRING VAR EXPR FUNC_CALL VAR STRING RETURN FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR NUMBER VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR STRING RETURN IF FUNC_CALL VAR VAR VAR NUMBER EXPR...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = ("z" + input() + "z").split("@") for i in s: if len(i) < 2 or len(s) < 2: print("No solution") exit() s[-1] = s[-1][:-1] r = "" for i in range(len(s) - 1): r += s[i][1:] + "@" + s[i + 1][0] + "," r = r[:-1] + s[-1][1:] print(r)
ASSIGN VAR FUNC_CALL BIN_OP BIN_OP STRING FUNC_CALL VAR STRING STRING FOR VAR VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR NUMBER VAR NUMBER NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP VAR VAR...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() ans = s.split("@") f = [] for i in ans: f.append(len(i)) flag = 0 for p in range(1, len(f) - 1): if f[p] <= 1: flag = 1 break if f[0] <= 0: flag = 1 if f[-1] < 1: flag = 1 if s.count("@") == 0: flag = 1 if flag == 1: print("No solution") else: res = list(s) y ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR VAR NUMBER ASSIGN VAR NUMBER IF VAR NUMBER NUMBER ASSIGN VAR NUMBER IF VAR NUMBER NUMBER ASSIGN VAR NUMBER IF FU...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() t = [] k = 0 y = 1 while 1: a = s.find("@", k + 1) if a < 0: break r = s[k : a + 2] if r.count("@") == 0 or r[0] == "@" or r[-1] == "@": y = 0 t += [r] k = a + 2 if t and s[k:].count("@") == 0: t[-1] += s[k:] p = "" for i in t: p += i print(["No solution", ","...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE NUMBER ASSIGN VAR FUNC_CALL VAR STRING BIN_OP VAR NUMBER IF VAR NUMBER ASSIGN VAR VAR VAR BIN_OP VAR NUMBER IF FUNC_CALL VAR STRING NUMBER VAR NUMBER STRING VAR NUMBER STRING ASSIGN VAR NUMBER VAR LIST VAR ASSIGN VAR BIN_OP VAR NUMBER IF...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
def main(): s = input().split("@") ans = "" itr = 0 if len(s) < 2 or len(s[0]) < 1 or len(s[-1]) < 1: print("No solution") return for i in range(1, len(s) - 1): if len(s[i]) < 2: print("No solution") return ans = s[0] + "@" + s[1][0] for i in r...
FUNC_DEF ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR STRING ASSIGN VAR NUMBER IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING RETURN FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL ...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() x = "" c = True if s[0] == "@" or s[len(s) - 1] == "@" or s.count("@") == 0: print("No solution") else: i = 1 l = 0 m = s.split("@") x += m[0] while i < len(m): if i == len(m) - 1: x += "@" + m[i] elif len(m[i]) < 2: c = False break...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR NUMBER IF VAR NUMBER STRING VAR BIN_OP FUNC_CALL VAR VAR NUMBER STRING FUNC_CALL VAR STRING NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING VAR VAR NUMBER WHILE VAR FUNC_CALL VAR VAR IF VAR BIN_OP FUNC_CALL VAR VA...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() prev = 0 lis = [] start = 0 flag = 0 for i in range(len(s)): if s[i] == "@" and prev == 0: if i - prev <= 0: flag = 1 break prev = i elif s[i] == "@": if i - prev > 2: lis.append(s[start : prev + 2]) start = prev + 2 ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR BIN_OP VAR NUMBER ASSIGN VAR...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
t = 1 def goodIx(arr): for i in range(1, len(arr)): if arr[i] - arr[i - 1] == 1 or arr[i] - arr[i - 1] == 2: return False return True while t > 0: s = input() ix = [i for i, ltr in enumerate(s) if ltr == "@"] if 0 in ix or len(s) - 1 in ix or len(ix) == 0: print("No s...
ASSIGN VAR NUMBER FUNC_DEF FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR NUMBER NUMBER BIN_OP VAR VAR VAR BIN_OP VAR NUMBER NUMBER RETURN NUMBER RETURN NUMBER WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR STRING IF NUMBER VAR BIN_OP FUNC_CALL VA...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
a, v = input().split("@"), [] if len(a) == 1 or not a[0] or not a[-1]: print("No solution") exit() for i in range(1, len(a) - 1): if len(a[i]) < 2: print("No solution") exit() else: v.append("{}@{}".format(a[i - 1], a[i][0])) a[i] = a[i][1:] v.append("{}@{}".format(a[-2],...
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR STRING LIST IF FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL STRING ...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
line = input() line = "#" + line + "#" nAts = line.count("@") ansLine = "" nEmails = 0 atEncountered = 0 for i, char in enumerate(line): if char != "#": ansLine += char if char == "@": atEncountered += 1 if i > 0 and line[i - 1] == "@": if ( line[i] != "@" and...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP STRING VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR FUNC_CALL VAR VAR IF VAR STRING VAR VAR IF VAR STRING VAR NUMBER IF VAR NUMBER VAR BIN_OP VAR NUMBER STRING IF VAR VAR STRING VAR BIN_OP VAR NUMBER STRING...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() if s.count("@") == 0: print("No solution") elif s[0] == "@" or s[-1] == "@": print("No solution") else: cnt = s[:3].count("@") f = 0 for i in range(3, len(s)): if cnt >= 2: f = 1 break cnt += bool(s[i] == "@") - bool(s[i - 3] == "@") if cnt...
ASSIGN VAR FUNC_CALL VAR IF FUNC_CALL VAR STRING NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER STRING VAR NUMBER STRING EXPR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR NUMBER STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN VAR NUMBER VAR BIN_OP FUNC_CALL VAR VAR VAR STRI...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() a = list(s.split("@")) ans = "" for i in range(1, len(a) - 1): if len(a[i]) <= 1: print("No solution") exit() if len(a[0]) == 0 or len(a[len(a) - 1]) == 0 or "@" not in s: print("No solution") exit() j = 0 for i in range(len(s)): if s[i] == "@": ans += s[j : i + 2] + ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR STRING FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER S...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
a = input() a = a + "1" s = "" l = 0 k = "" if a[0] == "@" or a[-2] == "@": print("No solution") else: for i in range(len(a)): if a[i] == "@" and a[i + 2] == "@": print("No solution") l = 2 break elif a[i] == "@" and a[i + 1] == "@": print("No solu...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR STRING ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR STRING IF VAR NUMBER STRING VAR NUMBER STRING EXPR FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR BIN_OP VAR NUMBER STRING EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER IF VAR VAR STRIN...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
def main(): email = input() if len(email) < 3 or email.count("@") == 0: print("No solution") return if len(email) == 3: if email.count("@") != 1 or email[1] != "@": print("No solution") return pos = [] for i in range(0, len(email)): if email[i]...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR STRING NUMBER EXPR FUNC_CALL VAR STRING RETURN IF FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR STRING NUMBER VAR NUMBER STRING EXPR FUNC_CALL VAR STRING RETURN ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR STRING EXPR F...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() n = len(s) ans = [] x = "" c = 0 for i in range(n): if i != n - 1: if s[i + 1] != "@": x = x + s[i] elif c == 0: x = x + s[i] c = 1 else: ans.append(x) x = "" x = x + s[i] c = 1 else: ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST ASSIGN VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR BIN_OP VAR NUMBER IF VAR BIN_OP VAR NUMBER STRING ASSIGN VAR BIN_OP VAR VAR VAR IF VAR NUMBER ASSIGN VAR BIN_OP VAR VAR VAR ASSIGN VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR STRIN...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input().split("@") n = len(s) - 1 for i in range(1, n): if len(s[i]) < 2: s = False break s[i] = s[i][0] + "," + s[i][1:] if n > 0 and s and s[0] and s[n]: print("@".join(s)) else: print("No solution")
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR NUMBER STRING VAR VAR NUMBER IF VAR NUMBER VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR EXPR FUNC...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
k = input() l = [] for i in range(len(k)): if k[i] == "@": l.append(i) if 0 in l or len(k) - 1 in l: print("No solution") else: flag = 0 for i in range(len(l) - 1): if abs(l[i] - l[i + 1]) <= 2: flag = 1 break if flag == 0: ans = k[0] for i in ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING EXPR FUNC_CALL VAR VAR IF NUMBER VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR BIN_OP VAR VAR VAR BIN_OP VAR NUM...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() l = len(s) i = 0 t = "" j = 0 lis = [] if len(s) <= 2: print("No solution") exit() while i < l - 1: if s[i] == "@": t += "@" + s[i + 1] i += 1 j = i lis.append(t) t = "" else: t += s[i] i += 1 if len(lis) == 0: print("No solution") ...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR LIST IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR WHILE VAR BIN_OP VAR NUMBER IF VAR VAR STRING VAR BIN_OP STRING VAR BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR VAR EXPR FUNC_C...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
data = input().split("@") if len(data) == 1 or len(data[0]) == 0 or len(data[-1]) == 0: print("No solution") exit(0) for chunk in data[1:-1]: if len(chunk) < 2: print("No solution") exit(0) if len(data) == 2: print(data[0] + "@" + data[1]) exit(0) ans = [(data[i][1:] + "@" + data[i +...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER FOR VAR VAR NUMBER NUMBER IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER IF FUNC_CALL VAR VAR NUMBER ...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() if s.count("@") == 0 or s[0] == "@" or s[-1] == "@": print("No solution") exit() a = [] x = "" n = 0 for i in range(len(s)): x += s[i] if n == 1: x += "," if s[i] == "@": n = 1 else: n = 0 a = " ".join(x.split(",")).split() for i in range(len(a)): if "@" n...
ASSIGN VAR FUNC_CALL VAR IF FUNC_CALL VAR STRING NUMBER VAR NUMBER STRING VAR NUMBER STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR IF VAR NUMBER VAR STRING IF VAR VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
from sys import exit, stdin, stdout addresses = stdin.readline().strip() if addresses[0] == "@" or addresses[-1] == "@" or addresses.find("@") == -1: print("No solution") exit(0) splits = addresses.split("@") solution = "" for split in splits[1:-1]: split_len = len(split) if split_len == 0 or split_len...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER STRING VAR NUMBER STRING FUNC_CALL VAR STRING NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR STRING FOR VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR IF VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
a = input() lista = [] for i in range(0, len(a)): if a[i] == "@": lista.append(i) d = 0 cadena = "" contador = 0 boleano = True if len(lista) >= 1: b = int(lista[contador]) + 2 if int(lista[0]) == 0 or len(a) == 2 or a[-1] == "@": print("No solution") else: if len(lista) % 2 == 0...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR STRING EXPR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER IF FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
def s(): a = input() if a[0] == "@" or a[-1] == "@": return False a = a.split("@") if len(a) == 2: print(*a, sep="@") return True if len(a) == 1 or min(list(len(i) for i in a[1:-1])) < 2: return False print(a[0], end="") for i in a[1:-1]: print("@", i[...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR IF VAR NUMBER STRING VAR NUMBER STRING RETURN NUMBER ASSIGN VAR FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR STRING RETURN NUMBER IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR NUMBER NUMBER NUMBER RETURN NUMBER EXPR FUNC_CA...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
strings, found = input().split("@"), False if len(strings[0]) == 0 or len(strings[-1]) == 0 or len(strings) == 1: found = True for i in range(1, len(strings) - 1): if len(strings[i]) < 2: found = True else: strings[i] = strings[i][0] + "," + strings[i][1:] if not found: print("@".join(st...
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR STRING NUMBER IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR NUMBER ST...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
from sys import stdout a = input() c = list(a.split("@")) while "" in c: c.remove("") if a.count("@") == 0: exit(print("No solution")) if a.count("@") != len(c) - 1: exit(print("No solution")) if any(len(i) == 1 for i in c[1 : len(c) - 1]): exit(print("No solution")) stdout.write(c[0] + "@") for i in r...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING WHILE STRING VAR EXPR FUNC_CALL VAR STRING IF FUNC_CALL VAR STRING NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR STRING IF FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR STRING IF FUNC_CALL VAR FUNC_CALL VAR VAR NUMB...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() ind = 0 l = [] r = "" if "@" in s and len(s) > 2 and s[-1] != "@": for i in range(len(s)): if s[i] == "@": if ind == i or s[i + 1] == "@": r = "No solution" break else: if "@" in s[i + 2 : len(s)]: l.appe...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR STRING IF STRING VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF VAR VAR VAR BIN_OP VAR NUMBER STRING ASSIGN VAR STRING IF STRING VAR BIN_OP VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR V...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
a = input().split("@") n = len(a) b = [] if n >= 2: for i in range(n): if len(a[i]) > int(i != 0 and i != n - 1): if i != 0 and i != n - 1: b.append(a[i - 1][min(1, i - 1) :] + "@" + a[i][0]) elif i == n - 1: b.append(a[i - 1][min(1, i - 1) :] + "@" + ...
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST IF VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR NUMBER VAR BIN_OP VAR NUMBER IF VAR NUMBER VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP VA...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
s = input() n = len(s) ans = [] nosol = False for i in range(n): if s[i] == "@": ans.append(i) for i in range(1, len(ans)): if ans[i] - ans[i - 1] > 2: pass else: nosol = True break if s[0] == "@" or s[-1] == "@": nosol = True if len(ans) == 0: nosol = True if nosol =...
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER IF VAR NUMBER STRING VAR NUMBER STRING ASSIGN VAR NUM...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
a = input().split("@") ans = a[0] if len(a[0]) == 0 or len(a) <= 1 or len(a[-1]) == 0: print("No solution") exit() for u in range(1, len(a) - 1): if len(a[u]) > 1: ans += "@" + a[u][0] + "," + a[u][1:] else: print("No solution") exit() print(ans + "@" + a[-1])
ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR NUMBER IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER VAR BIN_OP BIN_OP BIN_OP S...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
import sys def fail(): print("No solution") sys.exit() result = [] s = input().strip() if "@" not in s: fail() n = len(s) start = 0 pos = 0 while True: while pos < n and s[pos] != "@": pos += 1 if pos == n: result[-1] += s[start:] break if pos == start or pos + 1 == n...
IMPORT FUNC_DEF EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL FUNC_CALL VAR IF STRING VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE NUMBER WHILE VAR VAR VAR VAR STRING VAR NUMBER IF VAR VAR VAR NUMBER VAR VAR IF VAR VAR BIN_OP VAR NUMBE...
Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administrator in «Bersoft» company. He keeps a list of email addresses of the company's staff. This list is as a large string, where all addresses are written in arbitrary order...
from sys import stdin, stdout def cf31B(): from sys import stdin, stdout inp = list(stdin.readline().strip().split("@")) flag = True if len(inp) >= 2: if len(inp[0]) == 0 or len(inp[-1]) == 0: flag = False if flag: for i in range(1, len(inp) - 1): ...
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR NUMBER IF FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER IF VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUM...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
__T = int(input()) for _ in range(__T): n = int(input()) k = n // 2 if n == 1: print("a") elif n % 2 == 0: print("a" * k + "b" + "a" * (k - 1)) else: print("a" * k + "bc" + "a" * (k - 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): x = int(input()) if x == 1: print("a") elif x % 2 == 0: print("a" * (x // 2) + "b" + "a" * (x // 2 - 1)) else: print("a" * (x // 2) + "b" + "a" * (x // 2 - 1) + "c")
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_O...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n == 1: print("a") else: check = True if (n - 1) % 2 == 0: check = False q = (n - 2) // 2 s = "a" * q s += "b" w = "a" * (q + 1) if check == False: s += "c" s += ...
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER IF BIN_OP BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP STRING VAR VAR STRING ASSIGN VAR BIN_OP STRING BIN_O...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def sol(): n = int(input()) if n == 1: print("x") elif n % 2: print("x" * (n // 2) + "yz" + "x" * (n // 2 - 1)) else: print("x" * (n // 2) + "y" + "x" * (n // 2 - 1)) t = int(input()) for i in range(t): sol()
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) ans = "" if n % 2 == 1: ans += "c" n -= 1 ans += "a" * (n // 2) ans += "b" ans += "a" * (n // 2 - 1) if n == 0: print("a") continue print(ans)
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING IF BIN_OP VAR NUMBER NUMBER VAR STRING VAR NUMBER VAR BIN_OP STRING BIN_OP VAR NUMBER VAR STRING VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys input = sys.stdin.readline t = int(input()) for j in range(t): n = int(input()) ans = [] if n == 2: print("ab") continue if n % 2 == 0: ans1 = [] for i in range(n // 2): ans1.append("a") ans.extend(ans1) ans.append("b") ans....
IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR EXPR ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
T = int(input()) for t in range(T): n = int(input()) x = n // 2 print("a" * x + "bc"[: n - x - max(0, x - 1)] + "a" * max(0, x - 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP BIN_OP VAR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER BIN_OP STRING FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys def rl(): return sys.stdin.readline().strip() def rl_types(types): str_list = [x for x in sys.stdin.readline().strip().split(" ")] return [types[i](str_list[i]) for i in range(len(str_list))] def pr(something): sys.stdout.write(str(something) + "\n") def pra(array): sys.stdout.wri...
IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING RETURN FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_DEF EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR STRING FUNC_DEF EXPR FUNC_CALL VAR BIN_OP FUNC_CALL STRING FUNC_CALL VAR VAR VAR V...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for i in [0] * t: n = int(input()) if n % 2: print("c" * int(n > 1) + "a" * (n // 2 - 1) + "b" + "a" * (n // 2)) else: print("a" * (n // 2 - 1) + "b" + "a" * (n // 2))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR BIN_OP LIST NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING FUNC_CALL VAR VAR NUMBER BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER STRING BIN_OP STRING BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n == 1: print("a") elif n % 2 == 0: m = "a" * ((n - 2) // 2) print(f"a{m}b{m}") else: m = "a" * ((n - 3) // 2) print(f"a{m}bc{m}")
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING VAR STRING VAR ASSIGN VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for tc in range(t): n = int(input()) if n == 1: print("a") continue m = n // 2 res = [] for i in range(m): res.append("a") res.append("y") if n % 2: res.append("x") for i in range(m - 1): res.append("a") print("".join(res))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING FOR VA...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
from sys import stdin input = stdin.buffer.readline def func(): if n == 1: print("a") else: s = "a" * (n // 2) if n & 1: s += "bc" else: s += "b" s += "a" * (n // 2 - 1) print(s) for _ in range(int(input())): n = int(input()) f...
ASSIGN VAR VAR FUNC_DEF IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER VAR STRING VAR STRING VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) while t: n = int(input()) s = "" if n == 1: print("a") t -= 1 continue if n % 2 == 0: s += int(n / 2) * "a" + "b" + int(n / 2 - 1) * "a" else: s += int(n / 2) * "a" + "bc" + int(n / 2 - 1) * "a" print(s) t -= 1
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING VAR NUMBER IF BIN_OP VAR NUMBER NUMBER VAR BIN_OP BIN_OP BIN_OP FUNC_CALL VAR BIN_OP VAR NUMBER STRING STRING BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER STRING VAR ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for i in " " * int(input()): n = int(input()) c = n % 2 n = n - n % 2 print("a" * (n // 2) + "b" * [0, 1][n > 0] + "a" * (n // 2 - 1) + "c" * c)
FOR VAR BIN_OP STRING FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER BIN_OP STRING LIST NUMBER NUMBER VAR NUMBER BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys from sys import stdin tt = int(stdin.readline()) for loop in range(tt): n = int(stdin.readline()) if n == 1: print("a") elif n % 2 == 0: fi = n // 2 sc = n // 2 - 1 a = ["a"] * fi a.append("b") for j in range(sc): a.append("a") ...
IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP LIST STRING VAR EXPR FUNC_CALL VAR STRING FOR VAR F...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n == 1: print("a") elif n == 2: print("ab") elif n % 2 == 0: xx = n // 2 print("a" * xx + "b" + "a" * (xx - 1)) else: n -= 1 xx = n // 2 print("a" * xx + "b" + "a" * (xx - 1) + "c")
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER VAR ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def solve(n, i): if n <= 6: res = "" for j in range(n): res += chr(i + j + ord("a")) return res a = chr(i + ord("a")) b = chr(i + 1 + ord("a")) if n % 3 == 0: c = a + a + b d = b + b + a s = solve((n - 6) // 3, i + 2) return "".join([s,...
FUNC_DEF IF VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR STRING RETURN VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for t in range(int(input())): n = int(input()) if n == 1: print("a") continue elif n == 2: print("ab") continue half = n // 2 if n % 2: print("a" * (half - 1) + "b" + "a" * half + "c") else: print("a" * (half - 1) + "b" + "a" * half)
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING VAR STRI...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for _ in range(t): n = int(input()) if n == 1: print("a") elif n == 2: print("ab") elif n == 3: print("abc") elif n % 2 == 0: print("a" * (n // 2) + "b" + "a" * (n // 2 - 1)) else: print("a" * (n // 2) + "bc" + "a" * (n // 2 - 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys input = sys.stdin.readline def main(): t = int(input()) for _ in range(t): n = int(input()) top = [] if n == 1: print("a") continue if n == 2: print("ab") continue if n == 3: print("abc") ...
IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n <= 26: print("abcdefghijklmnopqrstuvwxyz"[:n]) continue x = n - 1 - (n % 2 == 1) print("a" * (x // 2) + "bc"[: 1 + n % 2] + "a" * (x // 2 + 1))
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP STRING BIN_OP B...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n <= 5: print("abcde"[:n]) else: print("a" * (n // 2 - 1) + "bc"[: 1 + n % 2] + "a" * (n // 2))
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER STRING BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP STRING BIN_OP VAR NUMBER
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n == 1: print("a") elif n % 2: print("a" * (n // 2 - 1) + "b" + "a" * (n // 2) + "c") else: print("a" * (n // 2 - 1) + "b" + "a" * (n // 2))
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER STRING BIN_OP STRING BIN_OP VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_O...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def shift(s, start): return "".join([chr(ord(c) + start) for c in s]) def ans(n, start): if n == 0: return "" if n == 1: return shift("a", start) elif n == 2: return shift("ab", start) elif n == 3: return shift("abc", start) elif n == 4: return shift("ab...
FUNC_DEF RETURN FUNC_CALL STRING FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR VAR VAR FUNC_DEF IF VAR NUMBER RETURN STRING IF VAR NUMBER RETURN FUNC_CALL VAR STRING VAR IF VAR NUMBER RETURN FUNC_CALL VAR STRING VAR IF VAR NUMBER RETURN FUNC_CALL VAR STRING VAR IF VAR NUMBER RETURN FUNC_CALL VAR STRING VAR IF VAR NUMBER R...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
te = int(input()) while te: te -= 1 t = int(input()) s = "abcdefghijklmnopqrstuvwxyz" if t <= 26: print(s[:t]) else: ans = "a" * (t // 2) + "b" + "a" * (t // 2 - 1) ans = ans + "c" * (t % 2) print(ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR BIN_OP STRING BIN_OP VAR NUMBE...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) print( "a" * (n // 2) + "b" + "a" * max(0, n // 2 - 1) if n % 2 == 0 or n == 1 else "a" * (n // 2) + "bc" + "a" * (n // 2 - 1) )
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
n = int(input()) for i in range(n): a = int(input()) if a == 1: print("a") elif a % 2 == 0: print("a" * (a // 2), end="") print("b", end="") print("a" * (a - (a // 2 + 1))) else: print("a" * ((a - 1) // 2), end="") print("b", end="") print("a" * (a...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP VAR NUMBER STRING EXPR FUNC_CALL VAR STRING STRING EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP VAR BIN_OP BIN_OP...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys LI = lambda: list(map(int, sys.stdin.readline().split())) MI = lambda: map(int, sys.stdin.readline().split()) SI = lambda: sys.stdin.readline().strip("\n") II = lambda: int(sys.stdin.readline()) for _ in range(II()): n = II() if n == 1: print("a") continue if n % 2: n -= ...
IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP V...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) while t > 0: n = int(input()) ans = "a" * int(n / 2) + "b" + "a" * int(n / 2 - 1) if n % 2 == 1: ans += "c" if n == 1: ans = "a" print(ans) t -= 1
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING FUNC_CALL VAR BIN_OP VAR NUMBER STRING BIN_OP STRING FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER IF BIN_OP VAR NUMBER NUMBER VAR STRING IF VAR NUMBER ASSIGN VAR STRING EXPR FUNC_CALL V...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
from sys import * ws = lambda: map(int, stdin.readline().strip().split()) li = lambda: list(map(int, stdin.readline().strip().split())) mod = 1000000007 def ncr(n, r, p): num = den = 1 for i in range(r): num = num * (n - i) % p den = den * (i + 1) % p return num * pow(den, p - 2, p) % p ...
ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR RETURN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) print( "a" if n == 1 else "a" * (n // 2) + ("bc" if n % 2 else "b") + "a" * (n // 2 - 1) )
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER STRING BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER BIN_OP VAR NUMBER STRING STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for _ in range(t): n = int(input()) if n == 1: print("a") else: lhs = "a" * (n // 2) pivot = "b" * (n % 2) lead = "c" rhs = "a" * (n // 2 - 1) print(lhs + pivot + lead + rhs)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER ASSIGN VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL ...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
te = int(input()) while te: te -= 1 t = int(input()) s = "abcdefghijklmnopqrstuvwxyz" if t <= 26: print(s[:t]) elif t % 2 == 0: print("a" * (t // 2) + "b" + "a" * (t // 2 - 1)) else: print("a" * ((t - 1) // 2) + "b" + "a" * ((t - 1) // 2 - 1) + "c")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR VAR VAR IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL V...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys input = sys.stdin.buffer.readline for _ in range(int(input())): n = int(input()) if n == 1: ans = "a" elif n % 2 == 0: k = n // 2 ans = "a" * k + "b" + "a" * (k - 1) else: k = (n - 1) // 2 ans = "a" * k + "bc" + "a" * (k - 1) print(ans)
IMPORT ASSIGN VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NU...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def rl(): return [int(w) for w in input().split()] for _ in range(int(input())): n = rl()[0] if n == 1: print("a") elif n == 2: print("ab") elif n == 3: print("abc") elif n % 2 == 0: k = (n - 1) // 2 + 1 print("a" * k + "b" + "a" * (k - 1)) elif n % ...
FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys alp = "abcdefghijklmnopqrstuvwxyz" for i in range(int(input())): n = int(sys.stdin.readline()) if n < 20: print(alp[0:n]) else: if n % 2 == 1: ans = "a" * (n // 2) + "b" + "a" * (n // 2 - 1) + "c" else: ans = "a" * (n // 2) + "b" + "a" * (n // 2 - ...
IMPORT ASSIGN VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR VAR NUMBER VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER STRING ASSIGN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
from sys import stdin input = stdin.readline for _ in range(int(input())): n = int(input()) ext = n % 2 + 1 lw = (n - ext) // 2 if n < 5: print("abcde"[:n]) continue print("a" * lw + "bc"[:ext] + "a" * (lw + 1))
ASSIGN VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR STRING VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING VAR BIN_OP STRING BIN_OP VAR NU...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
from sys import stdin input = stdin.readline MX = int(200000.0 + 5) MOD = int(1000000000.0 + 7) def main(): test = int(input()) for _ in range(test): n = int(input()) if n == 1: ans = "a" else: m = n // 2 ans = "a" * m ans += "b" ...
ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR BIN_OP NUMBER NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP STRING VAR VAR STRING...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def solve(n): if n == 1: print("a") return print("a" * (n // 2) + "b" + "a" * (n // 2 - 1) + "c" * (n % 2)) return for _ in range(int(input())): solve(int(input()))
FUNC_DEF IF VAR NUMBER EXPR FUNC_CALL VAR STRING RETURN EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP STRING BIN_OP VAR NUMBER RETURN FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) def oddStr(): n = int(input()) if n > 1: s = "a" * int(n / 2) s += "b" s += "a" * (int(n / 2) - 1) if n % 2 != 0: s += "c" else: s = "a" print(s) for i in range(t): oddStr()
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR BIN_OP STRING FUNC_CALL VAR BIN_OP VAR NUMBER VAR STRING VAR BIN_OP STRING BIN_OP FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER IF BIN_OP VAR NUMBER NUMBER VAR STRING ASSIGN VAR STRING EXPR FUNC_CALL VAR VAR FOR VAR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for _ in range(t): s = int(input()) if s % 2 == 0: n = (s - 2) // 2 ans = "b" * n + "a" + "b" * (n + 1) elif s == 1: ans = "a" else: n = (s - 3) // 2 ans = "b" * n + "a" + "c" + "b" * (n + 1) print(ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER IF VAR NUMBER ASSIGN VAR STRING ASSIGN VAR BIN_OP BIN_OP VAR NU...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys input = sys.stdin.buffer.readline def solve_tc(): n = int(input()) if n & 1: if n == 1: return "b" return "x" * (n // 2) + "ui" + "x" * (n // 2 - 1) else: return "x" * (n // 2) + "i" + "x" * (n // 2 - 1) t = int(input()) for _ in range(t): sys.stdout.w...
IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR NUMBER IF VAR NUMBER RETURN STRING RETURN BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER RETURN BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUM...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for laskjkljfsd in range(t): n = int(input()) if n % 2: if n == 1: print("a") else: print("a" * (n // 2) + "bc" + "a" * (n // 2 - 1)) else: print("a" * (n // 2) + "b" + "a" * (n // 2 - 1))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF BIN_OP VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n == 1: print("a") else: k = n // 2 print("a" * k + "b" + "a" * (k - 1) + ("c" if n % 2 != 0 else ""))
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER BIN_OP VAR NUMBER NUMBER STRING STRING
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
T = int(input()) for _ in range(T): n = int(input()) if n == 1: print("a") elif n % 2 == 0: x = n // 2 ans = ["a"] * x + ["b"] + ["a"] * (x - 1) print(*ans, sep="") else: x = n // 2 ans = ["a"] * x + ["b", "c"] + ["a"] * (x - 1) print(*ans, sep="")
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP LIST STRING VAR LIST STRING BIN_OP LIST STRING BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for _ in range(t): n = int(input()) if n == 1: print("a") continue ans = "a" * (n // 2) if n % 2 == 1: ans += "bc" else: ans += "b" ans += "a" * (n // 2 - 1) print(ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER NUMBER VAR STRING VAR STRING VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys input = sys.stdin.readline t = int(input()) while t > 0: n = int(input()) if n == 1: s = "a" else: s = "a" * (n // 2) if n % 2 != 0: s += "bc" else: s += "b" s += "a" * (n // 2 - 1) print(s) t -= 1
IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER NUMBER VAR STRING VAR STRING VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR VAR N...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) s = "abcdefghijklmnopqrstuvwxyz" if n < 27: print(s[:n]) else: if n % 2 == 0: k = n // 2 ans = "" for i in range(n): if i == k: ans = ans + "a" else: ...
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR VAR VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR BIN_OP VAR STRING ASSIGN VAR BIN_OP VAR STRING AS...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
from sys import stdin input = stdin.readline def answer(): ans, x = "", n // 2 if n & 1 == 0: ans = "a" * x + "b" + "a" * (x - 1) else: if n == 1: return "a" ans = "a" * x + "b" + "c" + "a" * (x - 1) return ans for T in range(int(input())): n = int(input()) ...
ASSIGN VAR VAR FUNC_DEF ASSIGN VAR VAR STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING VAR STRING BIN_OP STRING BIN_OP VAR NUMBER IF VAR NUMBER RETURN STRING ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP STRING VAR STRING STRING BIN_OP STRING BIN_OP VAR NUMBER RETURN VAR FOR VAR FUN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) for i in range(t): y = "" n = int(input()) if n == 1: print("a") elif n == 2: print("ab") else: if n % 2 != 0: for i in range(n - 1): if i == n // 2: y = y + "bc" else: y = y ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING IF BIN_OP VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER IF VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR STR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
T = int(input()) for _ in range(T): n = int(input()) A = [] if n == 1: print("a") continue A.append("a" * (n // 2)) if n % 2 == 0: A.append("b") else: A.append("bc") A.append("a" * (n // 2 - 1)) print("".join(A))
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST IF VAR NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
T = int(input()) for t in range(T): N = int(input()) ans = "a" * (N // 2) + "b" + "a" * (N // 2 - 1) if N & 1 and N != 1: ans += "c" print(ans)
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER IF BIN_OP VAR NUMBER VAR NUMBER VAR STRING EXPR FUNC_CALL VAR VAR
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys tokens = "".join(sys.stdin.readlines()).split()[::-1] def next(): return tokens.pop() def nextInt(): return int(next()) def nextFloat(): return float(next()) def getIntArray(n): return [nextInt() for _ in range(n)] def getFloatArray(n): return [nextFloat() for _ in range(n)] ...
IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL STRING FUNC_CALL VAR NUMBER FUNC_DEF RETURN FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VA...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
def TestCase(): n = int(input()) if n == 1: print("a") else: s = "a" * (n // 2) if n & 1: s += "bc" else: s += "b" s += "a" * (n // 2 - 1) print(s) t = int(input()) for _ in range(t): TestCase()
FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP STRING BIN_OP VAR NUMBER IF BIN_OP VAR NUMBER VAR STRING VAR STRING VAR BIN_OP STRING BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUN...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
for _ in range(int(input())): n = int(input()) if n < 26: ans = "" for i in range(n): ans += chr(ord("a") + i) elif n % 2 == 0: ans = "a" * (n // 2) + "b" + "a" * (n // 2 - 1) else: ans = "a" * (n // 2 - 1) + "b" + "a" * (n // 2 - 2) + "cde" print(ans)
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR STRING VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING BIN_OP VAR NUMBER STRING BIN_OP STRING BIN_OP BIN_OP VAR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
z = "".join(chr(x) for x in range(ord("a"), ord("z") + 1)) for _ in range(int(input())): n = int(input()) if n <= 26: print(z[:n]) elif n % 2 == 0: m = "a" * ((n - 12) // 2) print(f"a{m}bcdaa{m}ddccbb") else: m = "a" * ((n - 9) // 2) print(f"a{m}bcaa{m}ccbb")
ASSIGN VAR FUNC_CALL STRING FUNC_CALL VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR STRING NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR VAR VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP STRING BIN_OP BIN_OP VAR...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
import sys int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline...
IMPORT ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CAL...
You are given an integer n. Find any string s of length n consisting only of English lowercase letters such that each non-empty substring of s occurs in s an odd number of times. If there are multiple such strings, output any. It can be shown that such string always exists under the given constraints. A string a is a ...
t = int(input()) while t: t -= 1 n = int(input()) if n < 20: ans = "" for i in range(97, 97 + n): ans += chr(i) print(ans) continue if n % 2 == 0: mid = "b" k = n - 1 l1 = k // 2 l2 = k - l1 else: mid = "bc" ...
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR NUMBER BIN_OP NUMBER VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR ...