buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const long long MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) // cout << fixed << setpreci...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const long long MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) // cout << fixed << setpreci...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
140
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #def...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #def...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
162
from collections import deque from heapq import heapify,heappop,heappush,heappushpop from copy import copy,deepcopy from itertools import product,permutations,combinations,combinations_with_replacement from collections import defaultdict,Counter from bisect import bisect_left,bisect_right # from math import gcd,ceil,fl...
from collections import deque from heapq import heapify,heappop,heappush,heappushpop from copy import copy,deepcopy from itertools import product,permutations,combinations,combinations_with_replacement from collections import defaultdict,Counter from bisect import bisect_left,bisect_right # from math import gcd,ceil,fl...
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 662, 12, 206, 0, 70], ["-", 0, 1, 0, 662, 12, 206, 206, 664, 17, 33], ["-", 0, 1, 0, 662, 12, 206, 206, 664, 28, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 206, 0, 73], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
516
n = int(input()) if n == 1: print('a') exit() lst = ['a'] for i in range(n-1): new_lst = [] for string in lst: num = ord(string[-1]) for j in range(ord('a'), num+2): new_lst.append(string+chr(j)) lst = new_lst for string in lst: print(string)
n = int(input()) if n == 1: print('a') exit() lst = ['a'] for i in range(n-1): new_lst = [] for string in lst: num = ord(sorted(string)[-1]) for j in range(ord('a'), num+2): new_lst.append(string+chr(j)) lst = new_lst for string in lst: print(string)
[["+", 12, 652, 3, 4, 0, 206, 51, 652, 63, 22], ["+", 3, 4, 0, 206, 51, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 206, 51, 652, 3, 4, 0, 25]]
5
98
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, N - 1, 0) #define RREPS(i, n) RFOR(i, N, 1) #define int long...
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, N - 1, 0) #define RREPS(i, n) RFOR(i, N, 1) #define int long...
[["-", 0, 41, 64, 74, 51, 23, 0, 16, 31, 22], ["+", 0, 41, 64, 74, 51, 23, 0, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 23, 0, 41, 75, 22], ["+", 0, 2, 3, 4, 0, 23, 0, 41, 75, 22]]
1
262
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <functional> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> using ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <functional> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> using ...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
228
N = int(input()) def standard_string(N, st): if len(st) == N: print(st) elif st == "": standard_string(N, "a") else: for i in range(97, ord(st[-1])+ 2): st += chr(i) standard_string(N, st) st = st[:-1] standard_string(N, "")
N = int(input()) def standard_string(N, st): if len(st) == N: print(st) elif st == "": standard_string(N, "a") else: for i in range(97, ord(max(st))+ 2): st += chr(i) standard_string(N, st) st = st[:-1] standard_string(N, "")
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
90
from string import ascii_lowercase n = int(input()) def f(l): if len(l)==n: print("".join([ascii_lowercase[i] for i in l])) return for i in range(l[-1]+2): f(l+[i]) f([0])
from string import ascii_lowercase n = int(input()) def f(l): if len(l)==n: print("".join([ascii_lowercase[i] for i in l])) return for i in range(max(l)+2): f(l+[i]) f([0])
[["+", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 17, 33], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 28, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25...
5
74
import sys from itertools import product sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n = int(input()) def dfs(s, num): if len(s) == n: print(s) return for i in range(num + 1): t = s + chr(97 + i) dfs(t,...
import sys from itertools import product sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n = int(input()) def dfs(s, num): if len(s) == n: print(s) return for i in range(num + 1): t = s + chr(97 + i) dfs(t,...
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
108
#include <iostream> using namespace std; int N; void next(string base, int num, int cs) { if (num == N) { cout << base << endl; return; } for (int i = 0; i < cs + 1; i++) { char c = 'a' + i; int ncs = cs > i + i ? cs : i + 1; next(base + c, num + 1, ncs); } } int main() { cin >> N; ne...
#include <iostream> using namespace std; int N; void next(string base, int num, int cs) { if (num == N) { cout << base << endl; return; } for (int i = 0; i < cs + 1; i++) { char c = 'a' + i; int ncs = cs > i ? cs : i + 1; next(base + c, num + 1, ncs); } } int main() { cin >> N; next("...
[["-", 49, 50, 51, 41, 15, 16, 12, 16, 17, 72], ["-", 49, 50, 51, 41, 15, 16, 12, 16, 12, 22]]
1
114
import sys sys.setrecursionlimit(10 ** 6) def create_li(li): if len(li) >= n: lis.append(li) return p = li[-1] for i in range(1, p + 2): cp = li[:] cp.append(i) # print(cp) create_li(cp) lis = [] n = int(input()) pre = [1] create_li(pre) lis.sort() al = ["a","b","c","d","e","f","g","h"...
import sys sys.setrecursionlimit(10 ** 6) def create_li(li): if len(li) >= n: lis.append(li) return p = max(li) for i in range(1, p + 2): cp = li[:] cp.append(i) # print(cp) create_li(cp) lis = [] n = int(input()) pre = [1] create_li(pre) lis.sort() al = ["a","b","c","d","e","f","g","h...
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 662, 12, 206, 0, 70], ["-", 0, 1, 0, 662, 12, 206, 206, 664, 17, 33], ["-", 0, 1, 0, 662, 12, 206, 206, 664, 28, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 206, 0, 73], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
185
import sys sys.setrecursionlimit(10**7) n = int(input()) def dfs(s): if len(s) == n: print(s) else: for x in map(chr, range(97, ord(s[-1])+2)): dfs(s+x) dfs("a")
import sys sys.setrecursionlimit(10**7) n = int(input()) def dfs(s): if len(s) == n: print(s) else: for x in map(chr, range(97, ord(max(s))+2)): dfs(s+x) dfs("a")
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
74
import sys sys.setrecursionlimit(10**7) n = int(input()) ls = [] def dfs(s): if len(s) == n: ls.append(s) return 0 else: for x in map(chr, range(97, ord(s[-1])+2)): dfs(s+x) dfs("a") ls.sort() for x in ls: print(x)
import sys sys.setrecursionlimit(10**7) n = int(input()) ls = [] def dfs(s): if len(s) == n: ls.append(s) return 0 else: for x in map(chr, range(97, ord(max(s))+2)): dfs(s+x) dfs("a") ls.sort() for x in ls: print(x)
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
96
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int n; void dfs(string s, char mx) { if (s.size() == n) { cout << s << endl; return; } for (char c = 'a'; c <= mx + 1; ++c) { string t = s; t += c; dfs(t, c); } } int main() ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int n; void dfs(string s, char mx) { if (s.size() == n) { cout << s << endl; return; } for (char c = 'a'; c <= mx + 1; ++c) { string t = s; t += c; dfs(t, max(mx, c)); } } in...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
115
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define rep(i, n) \ ; \ for (long long i = 0; i < (n); i++) using ll = long long; using P = pair<long long, long lon...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define rep(i, n) \ ; \ for (long long i = 0; i < (n); i++) using ll = long long; using P = pair<long long, long lon...
[["+", 0, 52, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 103, 0, 104], ["+", 8, 9, 0, 43, 49, 50, 51, 103, 0, 125]]
1
205
#include <bits/stdc++.h> using namespace std; int fact(int x) { int ans = 1; for (int i = 1; i <= x; i++) { ans *= i; } return ans; } int main() { vector<string> al{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"}; int N; cin >> N; vector<string> ans(N); int maxi = fact(N); vector<vector<i...
#include <bits/stdc++.h> using namespace std; int fact(int x) { int ans = 1; for (int i = 1; i <= x; i++) { ans *= i; } return ans; } int main() { vector<string> al{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"}; int N; cin >> N; vector<string> ans(N); int maxi = fact(N); vector<vector<i...
[["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
544
def num_to_str(n): return chr(97 + n) def str_to_num(s): return ord(s) - 97 def dfs(s,m,n,N,ans): if n == N: ans.append(s) return for i in range(m+2): dfs(s+num_to_str(i),max(m,i),n+1,N,ans) def main(): N = int(input()) ans = [] dfs('a',0,1,N,ans) ans.sort() ...
def num_to_str(n): return chr(97 + n) def str_to_num(s): return ord(s) - 97 def dfs(s,m,n,N,ans): if n == N: ans.append(s) return for i in range(m+2): dfs(s+num_to_str(i),max(m,i),n+1,N,ans) def main(): N = int(input()) ans = [] dfs('a',0,1,N,ans) ans.sort() ...
[["+", 0, 656, 0, 14, 8, 196, 0, 7, 0, 88], ["+", 0, 656, 0, 14, 8, 196, 0, 7, 31, 22], ["+", 0, 656, 0, 14, 8, 196, 0, 7, 0, 267], ["+", 0, 656, 0, 14, 8, 196, 0, 7, 12, 22], ["+", 0, 656, 0, 14, 8, 196, 0, 7, 0, 102], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
136
import string alphabet = string.ascii_lowercase n = int(input()) def DFS(before,keta): num = 0 if keta == n: print(before) return for i in before: num = max(num,alphabet.index(i))+1 for j in range(num+1): DFS(before+alphabet[j],keta+1) DFS("",0)
import string alphabet = string.ascii_lowercase n = int(input()) def DFS(before,keta): num = 0 if keta == n: print(before) return for i in before: num = max(num,alphabet.index(i)) num += 1 for j in range(num+1): DFS(before+alphabet[j],keta+1) DFS("a",1)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 14, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 612]]
5
86
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, int> pli; typedef pair<int, int> pii; #define rep(i, a, b) for (ll i = a; i < b; i++) #define qrep(q...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, int> pli; typedef pair<int, int> pii; #define rep(i, a, b) for (ll i = a; i < b; i++) #define qrep(q...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
831
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; #define rep(i, a, b) for (ll i = a; i < b; i++) const int max_n = 1e5; const ll mod = 1e9 + 7; const ll INF = 1LL << ...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; #define rep(i, a, b) for (ll i = a; i < b; i++) const int max_n = 1e5; const ll mod = 1e9 + 7; const ll INF = 1LL << ...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
294
n = int(input()) def dfs(s,mx): if len(s)==n: print(s) return None for i in range(ord('a'),(mx+1)+1): dfs(s+chr(i),max(mx,i)) dfs('',ord('a'))
n = int(input()) def dfs(s,mx): if len(s)==n: print(s) return None for i in range(ord('a'),mx+1+1): dfs(s+chr(i),max(mx,i)) dfs('',ord('a')-1)
[["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
79
n=int(input()) ans=[] def dfs(i,c,d): if i==n: ans.append(c) return for j in range(0,d+1): dfs(i+1,c+chr(97+j),d+(i==d)) dfs(0,"",0) print("\n".join(ans))
n=int(input()) ans=[] def dfs(i,c,d): if i==n: ans.append(c) return for j in range(0,d+1): dfs(i+1,c+chr(97+j),d+(j==d)) dfs(0,"",0) print("\n".join(ans))
[["-", 3, 4, 0, 657, 12, 23, 0, 666, 0, 22], ["+", 3, 4, 0, 657, 12, 23, 0, 666, 0, 22]]
5
89
n = int(input()) s = ['a']*(n) #print(''.join(s)) def dfs(x,alp): if x == n: print(''.join(s)) return for i in range(alp+1): #print(x,alp,i) s[x] = chr(i+ord("a")) dfs(x+1,min(i+1,alp+1)) #print(alp) dfs(0,0)
n = int(input()) s = ['a']*(n) #print(''.join(s)) def dfs(x,alp): if x == n: print(''.join(s)) return for i in range(alp+1): #print(x,alp,i) s[x] = chr(i+ord("a")) dfs(x+1,max(i+1,alp)) #print(alp) dfs(0,0)
[["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
95
#include <bits/stdc++.h> using namespace std; template <typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl template <typename T> void trace(T *a, int s, int n) { for (int i = s; i < n; i++) { cout << a[i] << " "; } cout << endl; } typedef lo...
#include <bits/stdc++.h> using namespace std; template <typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl template <typename T> void trace(T *a, int s, int n) { for (int i = s; i < n; i++) { cout << a[i] << " "; } cout << endl; } typedef lo...
[["-", 0, 1, 0, 2, 3, 4, 0, 41, 75, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 75, 22]]
1
230
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) ll n; void dfs(string s) { if (s.size() == n) { cout << s << endl; return; } char mn = 'a'; rep(i, 0, s.size()) { mn = min(mn, s[i]); } for (char i = 'a';...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) ll n; void dfs(string s) { if (s.size() == n) { cout << s << endl; return; } char mx = 'a'; rep(i, 0, s.size()) { mx = max(mx, s[i]); } for (char i = 'a';...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4,...
1
144
N = int(input()) ans_list = ["a"] # 生成元の初期状態 (N = 1 の答え) alphabet = [chr(ord("a") + i) for i in range(N)] # 使用するアルファベット for i in range(N - 1): ans_list = [ans + x for ans in ans_list for x in alphabet[:len(ans) + 1]] for ans in ans_list: print(ans)
N = int(input()) ans_list = ["a"] # 生成元の初期状態 (N = 1 の答え) alphabet = [chr(ord("a") + i) for i in range(N)] # 使用するアルファベット for i in range(N - 1): ans_list = [ans + x for ans in ans_list for x in alphabet[:len(set(ans)) + 1]] for ans in ans_list: print(ans)
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
82
def examA(): L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51] K = I() ans = L[K-1] print(ans) return def examB(): H, W = LI() if H==1 or W==1: print(1) return ans = H*W//2 + (H*W)%2 print(ans) return def ex...
def examA(): L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51] K = I() ans = L[K-1] print(ans) return def examB(): H, W = LI() if H==1 or W==1: print(1) return ans = H*W//2 + (H*W)%2 print(ans) return def ex...
[["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
1,483
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> #include <iomanip> using namespace std; #define rep(i, x) for (int i = 0; i < x; i++) #define SORT(x) sort(x.begin(), x.end()) #define FIND(x, target) ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> #include <iomanip> using namespace std; #define rep(i, x) for (int i = 0; i < x; i++) #define SORT(x) sort(x.begin(), x.end()) #define FIND(x, target) ...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
317
#include <bits/stdc++.h> using namespace std; int n; void dfs(string s, char c) { if (s.length() == n) { cout << s << endl; return; } for (char chr = 'a'; chr <= c + 1; ++chr) { dfs(s + chr, chr); } } int main() { cin >> n; dfs("a", 'a'); return 0; }
#include <bits/stdc++.h> using namespace std; int n; void dfs(string s, char c) { if (s.length() == n) { cout << s << endl; return; } for (char chr = 'a'; chr <= c + 1; ++chr) { dfs(s + chr, max(c, chr)); } } int main() { cin >> n; dfs("a", 'a'); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
93
#include <bits/stdc++.h> using namespace std; #define ll long long #define fw(p) for (int w = 0; w < (p); w++) #define fx(p) for (int x = 0; x < (p); x++) #define fy(p) for (int y = 0; y < (p); y++) #define fz(p) for (int z = 0; z < (p); z++) #define fyg(p, g) for (int y = (g); y < (p); y++) #define fzg(p, g) for (int...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fw(p) for (int w = 0; w < (p); w++) #define fx(p) for (int x = 0; x < (p); x++) #define fy(p) for (int y = 0; y < (p); y++) #define fz(p) for (int z = 0; z < (p); z++) #define fyg(p, g) for (int y = (g); y < (p); y++) #define fzg(p, g) for (int...
[["-", 0, 2, 3, 4, 0, 41, 15, 16, 12, 22], ["+", 3, 4, 0, 41, 15, 16, 12, 16, 31, 22], ["+", 3, 4, 0, 41, 15, 16, 12, 16, 17, 33], ["+", 3, 4, 0, 41, 15, 16, 12, 16, 12, 13]]
1
264
N = gets.to_i strs = (0..N).map{ [] } strs[0] = [""] Chars = [""] + "abcdefghijklmn".split("") N.times{ (0...N).reverse_each{ |i| ss = strs[i] strs[i] = (1..i).flat_map{ |j| ss.map{ |s| s + Chars[j] } } strs[i+1] += ss.map{ |s| s + Chars[i+1] } } } puts strs[1..-1]
N = gets.to_i strs = (0..N).map{ [] } strs[0] = [""] Chars = [""] + "abcdefghijklmn".split("") N.times{ (0...N).reverse_each{ |i| ss = strs[i] strs[i] = (1..i).flat_map{ |j| ss.map{ |s| s + Chars[j] } } strs[i+1] += ss.map{ |s| s + Chars[i+1] } } } puts strs[1..-1].flatten.sort!
[["+", 0, 652, 3, 4, 0, 652, 486, 652, 17, 131], ["+", 0, 652, 3, 4, 0, 652, 486, 652, 735, 22], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
128
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
615
#include <iostream> #include <string> using namespace std; int N; void dfs(char a = 'a', string b = "") { if (b.size() == N) cout << b << endl; else { for (char i = 'a'; i < a; i++) dfs(a, b + i); dfs(a + 1, a + b); } } int main() { cin >> N; dfs(); }
#include <iostream> #include <string> using namespace std; int N; void dfs(char a = 'a', string b = "") { if (b.size() == N) cout << b << endl; else { for (char i = 'a'; i < a; i++) dfs(a, b + i); dfs(a + 1, b + a); } } int main() { cin >> N; dfs(); }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
98
n = int(input()) before = ["0"] for i in range(n-1): next = [] for elem in before: m = 1 for j in range(len(elem)): m = max(m, int(elem[j])) for j in range(m+1): next.append(elem+str(j)) before = next[:] before.sort() d = {"0":"a", "1":"b", "2":"c", "3":"d",...
n = int(input()) before = ["0"] for i in range(n-1): next = [] for elem in before: m = 1 for j in range(len(elem)): m = max(m, int(elem[j])+1) for j in range(m+1): next.append(elem+str(j)) before = next[:] before.sort() d = {"0":"a", "1":"b", "2":"c", "3":"d...
[["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
219
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int n; void dfs(string s, char mx) { if (s.size() == n) { cout << s << endl; return; } for (char c = 'a'; c <= mx + 1; c++) { string t = s; t += c; dfs(t, max(mx, c)); } } int main() { cin >> n...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int n; void dfs(string s, char mx) { if (s.size() == n) { cout << s << endl; return; } for (char c = 'a'; c <= mx + 1; c++) { string t = s; t += c; dfs(t, max(mx, c)); } } int main() { cin >> n...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
112
import sys sys.setrecursionlimit(4100000) N = int(input()) def dfs(i,s): if len(s) == N: return print(s) for x in range(97,i + 1): t = s + chr(x) dfs(x + 1,t) dfs(ord("a"),"")
import sys sys.setrecursionlimit(4100000) N = int(input()) def dfs(i,s): if len(s) == N: return print(s) for x in range(97,i + 1): t = s + chr(x) dfs(max(x + 1,i),t) dfs(ord("a"),"")
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
77
N = int(input()) dp = [[] for _ in range(N)] dp[0].append('a') for i in range(1, N): for strings in dp[i-1]: j = 97 while j <= ord(strings[-1])+1: nextstr = strings nextstr += chr(j) dp[i].append(nextstr) j += 1 dp[N-1].sort() for strings in dp[N-1...
N = int(input()) dp = [[] for _ in range(N)] dp[0].append('a') for i in range(1, N): for strings in dp[i-1]: j = 97 while j <= ord(max(strings))+1: nextstr = strings nextstr += chr(j) dp[i].append(nextstr) j += 1 dp[N-1].sort() for strings in dp[N-...
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
114
def getStr(vars): if len(vars)==N: print(getPrintStr(vars)) return vars.append(0) for i in range(0,vars[-2]+2): vars[-1] = i #print(":", i, vars) getStr(vars) del vars[-1] return def getPrintStr(vars): ret = "" for i in range(len(vars)): ...
def getStr(vars): if len(vars)==N: print(getPrintStr(vars)) return vars.append(0) for i in range(0,max(vars)+2): vars[-1] = i #print(":", i, vars) getStr(vars) del vars[-1] return def getPrintStr(vars): ret = "" for i in range(len(vars)): ...
[["+", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 17, 33], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 28, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25...
5
111
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int lnth; cin >> lnth; int cntlnth = 0; string bas = "abcdefghij"; string st = "aaaaaaaaaa"; // while(cntlnth<lnth){ for (int a = 0; a <= 0; a++) { st[cntlnth] = bas[a]; if (cntlnth == lnth - 1) co...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int lnth; cin >> lnth; int cntlnth = 0; string bas = "abcdefghij"; string st = "aaaaaaaaaa"; // while(cntlnth<lnth){ for (int a = 0; a <= 0; a++) { st[cntlnth] = bas[a]; if (cntlnth == lnth - 1) co...
[["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22]]
1
801
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
254
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* clang-format off */ #define MOD 1000000007 #define INF 1000000000 #define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define __DEBUG__ #ifdef __DEBUG__ #define CH_P(a) cout <<"check_point("<<#a<<"...
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* clang-format off */ #define MOD 1000000007 #define INF 1000000000 #define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() #define __DEBUG__ #ifdef __DEBUG__ #define CH_P(a) cout <<"check_point("<<#a<<"...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
226
N = int(input()) a_num = 97 def dfs(s, n, cnt): #s: 現在の文字列, n: 残りの文字数, cnt: 現在の文字列の最大の値 if n == 0: print(s) return for i in range(cnt+2): if i == cnt+1: dfs(s+chr(a_num+i), n-1, cnt+i) else: dfs(s+chr(a_num+i), n-1, cnt) dfs("a", N-1, 0)
N = int(input()) a_num = 97 def dfs(s, n, cnt): #s: 現在の文字列, n: 残りの文字数, cnt: 現在の文字列の最大の値 if n == 0: print(s) return for i in range(cnt+2): if i == cnt+1: dfs(s+chr(a_num+i), n-1, cnt+1) else: dfs(s+chr(a_num+i), n-1, cnt) dfs("a", N-1, 0)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
99
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, b, e) for (intmax_t i = (b), i##_limit = (e); i < i##_limit; ++i) #define reps(i, b, e) ...
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, b, e) for (intmax_t i = (b), i##_limit = (e); i < i##_limit; ++i) #define reps(i, b, e) ...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
966
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int n; void dod(string s, char c) { if (s.length() == n) { cout << s << endl; return; } char d = c + 1; int z = d - 'a'; rep(i, z) { string ss = s; char x = 'a' + i; ss ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int n; void dod(string s, char c) { if (s.length() == n) { cout << s << endl; return; } char d = c + 1; int z = d - 'a'; rep(i, z) { string ss = s; char x = 'a' + i; ss ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
140
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define INF 10000000000000000LL #define ll long long const long long inf = 1e18 + 44; const int MAX = 3e5 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 1e6 + 9; const int MAX_A = 71; const int LN = 20; const double eps = 1e-1; using ...
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define INF 10000000000000000LL #define ll long long const long long inf = 1e18 + 44; const int MAX = 3e5 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 1e6 + 9; const int MAX_A = 71; const int LN = 20; const double eps = 1e-1; using ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 103, 0, 104], ["+", 0, 7, 10, 43, 49, 50, 51, 103, 0, 125]]
1
245
n = int(input()) ans = [] def dfs(A): if len(A) == n: ans.append(''.join(A)) return for i in range(len(A)+1): v = chr(i+ord('a')) A.append(v) dfs(A) A.pop() dfs([]) ans.sort() for i in range(len(ans)): print(ans[i])
n = int(input()) ans = [] def dfs(A): if len(A) == n: ans.append(''.join(A)) return for i in range(len(set(A))+1): v = chr(i+ord('a')) A.append(v) dfs(A) A.pop() dfs([]) ans.sort() for i in range(len(ans)): print(ans[i])
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
108
n = int(input()) L = [0]*n for i in range(n): L[i] = chr(i+ord('a')) #print(L)_ ans = [] def dfs(A): if len(A) == n: ans.append(''.join(A)) return for v in L[0:len(A)+1]: A.append(v) dfs(A) A.pop() dfs([]) ans.sort() for i in range(len(ans)): print(ans[i])
n = int(input()) L = [0]*n for i in range(n): L[i] = chr(i+ord('a')) #print(L)_ ans = [] def dfs(A): if len(A) == n: ans.append(''.join(A)) return for v in L[0:len(set(A))+1]: A.append(v) dfs(A) A.pop() dfs([]) ans.sort() for i in range(len(ans)): print(ans[i])...
[["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
129
from collections import deque def dfs(q): if len(q)==N: print(''.join(q)) return for i in range(min(26, ord(q[-1])-ord('a')+2)): q.append(alpha[i]) dfs(q) q.pop() N = int(input()) alpha = 'abcdefghijklmnopqrstuvwxyz' dfs(deque(['a']))
from collections import deque def dfs(q): if len(q)==N: print(''.join(q)) return for i in range(min(26, ord(max(q))-ord('a')+2)): q.append(alpha[i]) dfs(q) q.pop() N = int(input()) alpha = 'abcdefghijklmnopqrstuvwxyz' dfs(deque(['a']))
[["+", 31, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 31, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 31, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25...
5
100
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; using vs ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; using vs ...
[["+", 63, 118, 28, 69, 341, 342, 0, 2, 63, 22], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 24], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 21], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 22], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 25]]
1
306
N = int(input()) def func(x): if len(x) == N: print("".join(x)) return last = ord(x[-1]) - ord("a") + 1 if x else 0 for i in range(min(26, last) + 1): x.append(chr(ord("a") + i)) func(x) x.pop() func([])
N = int(input()) def func(x): if len(x) == N: print("".join(x)) return last = ord(max(x)) - ord("a") + 1 if x else 0 for i in range(min(26, last) + 1): x.append(chr(ord("a") + i)) func(x) x.pop() func([])
[["+", 31, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 31, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 31, 657, 31, 652, 3, 4, 0, 206, 0, 73], ["+", 31, 652, 3, 4, 0, 652, 3, 4, 0, 25...
5
101
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int, int> P; int INF = 1e9 + 7; int mod = 1e9 + 7; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int N; void dfs(string S, char a) { if (S.size() == N) { cout << S << endl; return; } for (char i = 'a'; i <= a; i++) { ...
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int, int> P; int INF = 1e9 + 7; int mod = 1e9 + 7; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int N; void dfs(string S, char a) { if (S.size() == N) { cout << S << endl; return; } for (char i = 'a'; i <= a; i++) { ...
[["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
166
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #in...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #in...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
434
from copy import copy n = int(input()) data = ["a"] * n ans = [] def print_str(ans, data, i): if i == n: return ans.append("".join(data)) mx = max(data[i] for i in range(n)) while ord(data[i]) + 1 <= ord(mx) + 2: s = copy(data) ans.append("".join(data)) print_str(ans, s...
from copy import copy n = int(input()) data = ["a"] * n ans = ["".join(data)] def print_str(ans, data, i): if i == n: return ans.append("".join(data)) mx = max(data[i] for i in range(n)) while ord(data[i]) + 1 <= ord(mx) + 2: s = copy(data) ans.append("".join(data)) pri...
[["+", 12, 634, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 12, 634, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 662, 12, 634, 0, 652, 63, 319, 0, 131], ["+", 0, 662, 12, 634, 0, 652, 63, 319, 319, 22], ["+", 0, 662, 12, 634, 0, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 634, 0, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 634, 0, 65...
5
186
import itertools #再帰関数のときのRE予防 import sys sys.setrecursionlimit(312467) N = int(input()) List = [] def dfs(S): List.append(S) if len(S) < N: for i in range(ord("a"), ord(S[len(S)-1])+2): dfs(S+[chr(i)]) return dfs(["a"]) for i in List: if len(i) == N: print("".join(i)) elif len(i) > N...
import itertools #再帰関数のときのRE予防 import sys sys.setrecursionlimit(312467) N = int(input()) List = [] def dfs(S): List.append(S) if len(S) < N: for i in range(ord("a"), ord(max(S))+2): dfs(S+[chr(i)]) return dfs(["a"]) for i in List: if len(i) == N: print("".join(i)) elif len(i) > N: ...
[["-", 0, 657, 31, 652, 3, 4, 0, 206, 51, 22], ["-", 0, 657, 31, 652, 3, 4, 0, 206, 0, 70], ["-", 3, 4, 0, 206, 206, 657, 31, 652, 63, 22], ["+", 0, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["-", 31, 652, 3, 4, 0, 206, 206, 657, 17, 33], ["-", 31, 652, 3, 4, 0, 206, 206, 657, 12, 612], ["-", 0, 657, 31, 652, 3, 4, 0, 206, ...
5
123
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define ll long long #define IO ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define ll long long #define IO ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
196
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**9) N = int(input()) def main(s, o, n): n += 1 if n == N: print(s) else: for i in range(97, o + 2): main(s + chr(i), i, n) main("a", 97, 0)
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**9) N = int(input()) def main(s, o, n): n += 1 if n == N: print(s) else: for i in range(97, o + 2): main(s + chr(i), max(o, i), n) main("a", 97, 0)
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
78
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator impor...
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator impor...
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
278
def solve(ans, p, n): if len(p) == n: s = "" for v in p: s += chr(ord("a")+v) ans.append(s) return for v in range(p[-1]+2): p.append(v) solve(ans, p, n) p.pop() return def main(): n = int(input()) ans = [] p = [0] solve(ans...
def solve(ans, p, n): if len(p) == n: s = "" for v in p: s += chr(ord("a")+v) ans.append(s) return for v in range(max(p)+2): p.append(v) solve(ans, p, n) p.pop() return def main(): n = int(input()) ans = [] p = [0] solve(an...
[["+", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 17, 33], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 28, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25...
5
135
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
297
import sys sys.setrecursionlimit(1000000) n=int(input()) def dfs(s,x): if len(s)==n: print(s) else: for i in range(x): dfs(s+chr(ord("a")+i),i+1) dfs(s+chr(ord("a")+x),x+1) dfs("a",1)
import sys sys.setrecursionlimit(1000000) n=int(input()) def dfs(s,x): if len(s)==n: print(s) else: for i in range(x): dfs(s+chr(ord("a")+i),x) dfs(s+chr(ord("a")+x),x+1) dfs("a",1)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
94
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
1,169
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
[["+", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 17, 33], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 28, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25...
5
419
n = int(input()) alp = [chr(i) for i in range(97, 97+26)] def dfs(i): if i == 1: return [("a", 1)] else: ret = [] for i in dfs(i-1): nowstr, nowmax = i for j in range(nowmax+1): ret.append((nowstr+alp[j], max(j,nowmax))) return ret ans =...
n = int(input()) alp = [chr(i) for i in range(97, 97+26)] def dfs(i): if i == 1: return [("a", 1)] else: ret = [] for i in dfs(i-1): nowstr, nowmax = i for j in range(nowmax+1): ret.append((nowstr+alp[j], max(j+1,nowmax))) return ret ans...
[["+", 0, 660, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 660, 0, 652, 3, 4, 0, 657, 12, 612]]
5
129
#include <bits/stdc++.h> using namespace std; void func(char *st, int i, int n, char last) { // base case if (i == n) { st[i] = '\0'; cout << st << "\n"; return; } // recursive case for (char j = 'a'; j <= last + 1; j++) { st[i] = j; func(st, i + 1, n, j); } } int main() { int n; ...
#include <bits/stdc++.h> using namespace std; void func(char *st, int i, int n, char last) { // base case if (i == n) { st[i] = '\0'; cout << st << "\n"; return; } // recursive case for (char j = 'a'; j <= last + 1; j++) { st[i] = j; func(st, i + 1, n, max(j, last)); } } int main() { ...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
127
import sys sys.setrecursionlimit(10 ** 8) n = int(input()) alp = "abcdefghijklmnopqrstuvwxyz" permutations = [] def dfs(a, size): if len(a) == size: global permutations permutations.append(a) return for i in range(1, a[-1] + 2): dfs(a + [i], size) dfs([1], n) for i in permutati...
import sys sys.setrecursionlimit(10 ** 8) n = int(input()) alp = "abcdefghijklmnopqrstuvwxyz" permutations = [] def dfs(a, size): if len(a) == size: global permutations permutations.append(a) return for i in range(1, max(a) + 2): dfs(a + [i], size) dfs([1], n) for i in permutat...
[["+", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 17, 33], ["-", 3, 4, 0, 657, 31, 206, 206, 664, 28, 612], ["-", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25...
5
112
#include <bits/stdc++.h> #include <iostream> using namespace std; long long n; void dfs(string s, char lim) { if (s.size() == n) { cout << s << endl; return; } for (char i = 'a'; i <= lim + 1; i++) { string hoge; hoge.push_back(i); dfs(s + hoge, i); } } int main() { cin >> n; dfs("a...
#include <bits/stdc++.h> #include <iostream> using namespace std; long long n; void dfs(string s, char lim) { if (s.size() == n) { cout << s << endl; return; } for (char i = 'a'; i <= lim + 1; i++) { string hoge; hoge.push_back(i); dfs(s + hoge, max(i, lim)); } } int main() { cin >> n...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
103
def dfs(i,sent): if len(sent)==N: print(sent) return if i>N: return for j in range(i+1): dfs(max(i,j),sent+chara[j]) return N=int(input()) chara=["a","b","c","d","e","f","g","h","i","j"] chara=chara[:N] dfs(1,"a")
def dfs(i,sent): if len(sent)==N: print(sent) return if i>N: return for j in range(i+1): dfs(max(i,j+1),sent+chara[j]) return N=int(input()) chara=["a","b","c","d","e","f","g","h","i","j"] chara=chara[:N] ans=[] dfs(1,"a")
[["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 206, 0, 73], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70]]
5
120
from itertools import combinations_with_replacement N = int(input()) C = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] DP = [set() for _ in range(N)] DP[0].add((1, 'a')) for i in range(1, N): for num, s in DP[i-1]: for j in range(num): DP[i].add((num, s + C[j])) DP[i].add((num + 1...
from itertools import combinations_with_replacement N = int(input()) C = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] DP = [set() for _ in range(N)] DP[0].add((1, 'a')) for i in range(1, N): for num, s in DP[i-1]: for j in range(num): DP[i].add((num, s + C[j])) DP[i].add((num + 1...
[["+", 36, 36, 0, 656, 0, 7, 31, 684, 0, 22], ["+", 36, 36, 0, 656, 0, 7, 31, 684, 0, 21], ["-", 36, 36, 0, 656, 0, 7, 31, 684, 0, 21], ["-", 36, 36, 0, 656, 0, 7, 31, 684, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
188
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define int ll const ll MOD = 1000000007; const ll INF_LL = (ll)1000000007 * 1000000007; const int INF_INT = (int)1000000007; const double PI = 3.14159265358979323846; const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define int ll const ll MOD = 1000000007; const ll INF_LL = (ll)1000000007 * 1000000007; const int INF_INT = (int)1000000007; const double PI = 3.14159265358979323846; const int dx[4] = {1, 0, -1, 0...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 103, 0, 104], ["+", 0, 7, 10, 43, 49, 50, 51, 103, 0, 125]]
1
524
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 998244353; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 998244353; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
501
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const int inf = 1e9; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, b, a) for (int i = a - 1; i >= b; i--) using Graph = vector<vector<int>>; using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const int inf = 1e9; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, b, a) for (int i = a - 1; i >= b; i--) using Graph = vector<vector<int>>; using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
268
n = int(input()) def dfs(s, mx): if len(s) == n: print(s) else: for i in range(0, mx +1): c = chr(ord('a')+i) dfs(s+c, mx +1) if i == mx else dfs(s+c, mx) df('', 0)
n = int(input()) def dfs(s, mx): if len(s) == n: print(s) else: for i in range(0, mx +1): c = chr(ord('a')+i) dfs(s+c, mx +1) if i == mx else dfs(s+c, mx) dfs('', 0)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22]]
5
85
import queue n = int(input()) alp = "abcdefghijklmn" q = queue.Queue() q.put("a") while not q.empty(): qi = q.get() if len(qi) == n: print(qi) elif len(qi) < n: idx = alp.index(qi[-1]) for i in range(idx+2): q.put(qi+alp[i])
import queue n = int(input()) alp = "abcdefghijklmn" q = queue.Queue() q.put("a") while not q.empty(): qi = q.get() if len(qi) == n: print(qi) elif len(qi) < n: idx = alp.index(max(qi)) for i in range(idx+2): q.put(qi+alp[i])
[["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 70], ["-", 12, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 12, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 73], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
98
import sys from collections import deque readline = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 8) INF = float('inf') MOD = 10 ** 9 + 7 def main(): N = int(readline()) if N==1: print('a') exit() d = deque(['a']) ans = [] while d: s = d.popleft() last = ord(...
import sys from collections import deque readline = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 8) INF = float('inf') MOD = 10 ** 9 + 7 def main(): N = int(readline()) if N==1: print('a') exit() d = deque(['a']) ans = [] while d: s = d.popleft() last = ord(...
[["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 70], ["-", 12, 652, 3, 4, 0, 206, 206, 664, 17, 33], ["-", 12, 652, 3, 4, 0, 206, 206, 664, 28, 612], ["-", 0, 662, 12, 652, 3, 4, 0, 206, 0, 73], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
165
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; n--; vector<string> now{"a"}; while (n--) { vector<string> next; for (auto const &s : now) { int c = *max_element(s.begin(), s.end()) - 'a'; for (int i = 0; i < c + 1; i++) { next.push_back(s + (char)(i...
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; n--; vector<string> now{"a"}; while (n--) { vector<string> next; for (auto const &s : now) { int c = *max_element(s.begin(), s.end()) - 'a'; for (int i = 0; i <= c + 1; i++) { next.push_back(s + (char)(...
[["-", 0, 338, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 338, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 12, 74, 51, 23, 0, 16, 12, 74, 0, 24], ["+", 51, 23, 0, 16, 12, 74, 39, 77, 39, 40], ["+", 12, 74, 51, 23, 0, 16, 12, 74, 0, 25]]
1
153
#include <algorithm> #include <iostream> #include <vector> void dfs(uint32_t N, std::string str = "", uint32_t last = 0) { if (str.size() == N) { std::cout << str << std::endl; return; } for (uint32_t i = 0; i <= last; i++) dfs(N, str + static_cast<char>('a' + i), std::min(i + 1, last + 1)); retu...
#include <algorithm> #include <iostream> #include <vector> void dfs(uint32_t N, std::string str = "", uint32_t last = 0) { if (str.size() == N) { std::cout << str << std::endl; return; } for (uint32_t i = 0; i <= last; i++) dfs(N, str + static_cast<char>('a' + i), std::max(i + 1, last)); return; ...
[["-", 0, 2, 3, 4, 0, 2, 63, 343, 141, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 343, 141, 22], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
124
#include <algorithm> #include <cmath> #include <cstring> #include <deque> #include <iomanip> //cout << fixed << setprecision(15) << x << endl; #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; const ll INF = 1e9 + 6; const ll MOD = 1e9 + 7; ...
#include <algorithm> #include <cmath> #include <cstring> #include <deque> #include <iomanip> //cout << fixed << setprecision(15) << x << endl; #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; const ll INF = 1e9 + 6; const ll MOD = 1e9 + 7; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
162
import sys import re import math import collections import decimal import bisect import itertools import fractions import functools import copy import heapq import decimal import statistics import queue sys.setrecursionlimit(10000001) INF = 10 ** 10 MOD = 10 ** 9 + 7 ni = lambda: int(sys.stdin.readline()) ns = lambda...
import sys import re import math import collections import decimal import bisect import itertools import fractions import functools import copy import heapq import decimal import statistics import queue sys.setrecursionlimit(10000001) INF = 10 ** 10 MOD = 10 ** 9 + 7 ni = lambda: int(sys.stdin.readline()) ns = lambda...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 31, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 15, 666, 0, 657, 31, 652, 3, 4, ...
5
259
n = int(input()) w = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] s = {} s["a"] = 0 ans = [s] for i in range(2, n+1): new_s = {} for t in s.items(): for j in range(1, i): if t[0][-1] == w[j-1]: for k in range(i): new_s[t[0] + w[k]] = max(t[1], k...
n = int(input()) w = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] s = {} s["a"] = 0 ans = [s] for i in range(2, n+1): new_s = {} for t in s.items(): for j in range(1, i): if t[0][-1] == w[j-1]: for k in range(t[1] + 2): new_s[t[0] + w[k]] = max(...
[["-", 64, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 51, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 206, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]...
5
183
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> llP; ll mod(ll a, ll b) { ll ret = a % b; if (ret < 0) ret += b; return ret; } ll modpow(ll a, ll b, ll c) { ll res = 1; while (b > 0) { if (b & 1) res = mod(r...
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> llP; ll mod(ll a, ll b) { ll ret = a % b; if (ret < 0) ret += b; return ret; } ll modpow(ll a, ll b, ll c) { ll res = 1; while (b > 0) { if (b & 1) res = mod(r...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 26, 11, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 26, 11, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46]]
1
269
n=int(input()) from collections import deque d=deque(['a']) c=[chr(i) for i in range(97, 97+26)] ans=set([]) while d: y=d.pop() if len(y)==n: ans.add(y) now=c.index(y[-1]) for z in range(min(now+2,n+1)): if z>-1 and len(y)<n: d.append(y+c[z]) for z in sorted(list(ans)): print(z)
n=int(input()) from collections import deque d=deque(['a']) c=[chr(i) for i in range(97, 97+26)] ans=set([]) while d: y=d.pop() if len(y)==n: ans.add(y) now=c.index(sorted(y)[-1]) for z in range(min(now+2,n+1)): if z>-1 and len(y)<n: d.append(y+c[z]) for z in sorted(list(ans)): print(z)
[["+", 12, 652, 3, 4, 0, 206, 51, 652, 63, 22], ["+", 3, 4, 0, 206, 51, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 206, 51, 652, 3, 4, 0, 25]]
5
140
#include <iostream> using namespace std; int main(void) { long long a, b, c; cin >> a >> b >> c; long long r = c - a - b; if (r < 0) { cout << "no" << endl; } else { r *= r; long long l = 4 * a * b; if (l < r) { cout << "Yes" << endl; } else { cout << "No" << endl; } }...
#include <iostream> using namespace std; int main(void) { long long a, b, c; cin >> a >> b >> c; long long r = c - a - b; if (r < 0) { cout << "No" << endl; } else { r *= r; long long l = 4 * a * b; if (l < r) { cout << "Yes" << endl; } else { cout << "No" << endl; } }...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
102
#include <bits/stdc++.h> #define pf printf #define sc(x) scanf("%d", &x); #define scs(x) scanf("%s", x); #define scl(x) scanf("%lld", &x); #define rep(i, s, e) for (int i = s; i <= e; ++i) #define dep(i, s, e) for (int i = s; i >= e; --i) typedef long long ll; using namespace std; int main() { ll a, b, c; scl(a); ...
#include <bits/stdc++.h> #define pf printf #define sc(x) scanf("%d", &x); #define scs(x) scanf("%s", x); #define scl(x) scanf("%lld", &x); #define rep(i, s, e) for (int i = s; i <= e; ++i) #define dep(i, s, e) for (int i = s; i >= e; --i) typedef long long ll; using namespace std; int main() { ll a, b, c; scl(a); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
142
a,b,c=map(int,input().split(' ')) if 4*a*b>(c-(a+b))**2 or a+b>c: print('No') else: print('Yes')
a,b,c=map(int,input().split(' ')) if 4*a*b>=(c-(a+b))**2 or a+b>c: print('No') else: print('Yes')
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 667, 20]]
5
60
a,b,c = map(int,input().split()) d = 4 * a * b e = (c - a - b) * (c - a - b) if d < e or (c - a - b) < 0: print("Yes") else: print("No")
a,b,c = map(int,input().split()) d = 4 * a * b e = (c - a - b) * (c - a - b) if d < e and 0 < (c - a - b): print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 18], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 667, 18], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
71
#include <bits/stdc++.h> using namespace std; const long double EPS = 1e-13; int main() { unsigned long long a, b, c; cin >> a >> b >> c; if (c - a - b < 0) { cout << "No"; } else { if ((c - a - b) * (c - a - b) > 4 * a * b) { cout << "Yes"; } else { cout << "No"; } } return 0...
#include <bits/stdc++.h> using namespace std; const long double EPS = 1e-13; int main() { long long a, b, c; cin >> a >> b >> c; if (c - a - b < 0) { cout << "No"; } else { if ((c - a - b) * (c - a - b) > 4 * a * b) { cout << "Yes"; } else { cout << "No"; } } return 0; }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87]]
1
101
import java.util.Scanner; public class Main { public static void main(final String[] args) { Scanner s = new Scanner(System.in); long a = s.nextLong(), b = s.nextLong(), c = s.nextLong(); long z = c - a - b; long y = 4 * a * b; if (z * z > y) { System.out.println("Yes"); } else { ...
import java.util.Scanner; public class Main { public static void main(final String[] args) { Scanner s = new Scanner(System.in); long a = s.nextLong(), b = s.nextLong(), c = s.nextLong(); long z = c - a - b; long y = 4 * a * b; if (z > 0 && z * z > y) { System.out.println("Yes"); } else...
[["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 98], ["+", 15, 15, 0, 16, 12, 16, 31, 16, 31, 22]]
3
114
#include <bits/stdc++.h> using namespace std; #define rep(i, a) for (int i = 0; i < a; i++) #define pd(a, n) \ for (int i = 0; i < n; i++) \ cout << a[i] << ((i == n - 1) ? "\n" : " "); ...
#include <bits/stdc++.h> using namespace std; #define rep(i, a) for (int i = 0; i < a; i++) #define pd(a, n) \ for (int i = 0; i < n; i++) \ cout << a[i] << ((i == n - 1) ? "\n" : " "); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
140
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define mod 1000000007 #define iP pair<int, int> #define gcd(a, b) __gcd(a, b) #define lcm(a, b) a *b / __gcd(a, b) #define pb push_back #define inf 1e15 #define mod1 998244353 #define rep(i, a, n) for (int i = a; i < n; i++)...
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define mod 1000000007 #define iP pair<int, int> #define gcd(a, b) __gcd(a, b) #define lcm(a, b) a *b / __gcd(a, b) #define pb push_back #define inf 1e15 #define mod1 998244353 #define rep(i, a, n) for (int i = a; i < n; i++)...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
338
import sys sr = lambda: sys.stdin.readline().rstrip() ir = lambda: int(sr()) lr = lambda: list(map(int, sr().split())) def resolve(): a, b, c = lr() if a+b-c > 0: print('No') if (a+b-c)**2 > 4*a*b: print('Yes') else: print('No') resolve()
import sys sr = lambda: sys.stdin.readline().rstrip() ir = lambda: int(sr()) lr = lambda: list(map(int, sr().split())) def resolve(): a, b, c = lr() if a+b-c > 0: print('No') elif (a+b-c)**2 > 4*a*b: print('Yes') else: print('No') resolve()
[["-", 0, 656, 0, 14, 8, 196, 0, 57, 0, 121], ["+", 0, 14, 8, 196, 0, 57, 75, 665, 0, 683]]
5
109
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify from math import gcd from copy import deepcopy import math import queue import numpy as np #import sympy as syp(素因数分解とか) Mod = 1000000007 import sys sys.setrecursi...
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify from math import gcd from copy import deepcopy import math import queue import numpy as np #import sympy as syp(素因数分解とか) Mod = 1000000007 import sys sys.setrecursi...
[["+", 0, 652, 3, 4, 0, 41, 0, 679, 17, 355], ["+", 3, 4, 0, 41, 0, 679, 12, 666, 0, 22], ["+", 3, 4, 0, 41, 0, 679, 12, 666, 667, 47], ["+", 0, 41, 0, 679, 12, 666, 0, 657, 31, 22], ["+", 0, 41, 0, 679, 12, 666, 0, 657, 17, 72], ["+", 0, 41, 0, 679, 12, 666, 0, 657, 12, 22]]
5
406
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repa(i, a, n) for (int i = (a); i < (n); i++) #define rrep(i, n) for (int i = n; i >= 0; i--) #define rrepa(i, a, n) for (int i = n; i >= (a); i--) #define all(a) (a).begin(), (a).end() #define MOD 1000000007 #define...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repa(i, a, n) for (int i = (a); i < (n); i++) #define rrep(i, n) for (int i = n; i >= 0; i--) #define rrepa(i, a, n) for (int i = n; i >= (a); i--) #define all(a) (a).begin(), (a).end() #define MOD 1000000007 #define...
[["-", 0, 57, 64, 1, 0, 11, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 11, 12, 5, 0, 6]]
1
210
#include <cmath> #include <iostream> using namespace std; int main() { unsigned long long a, b, c; cin >> a >> b >> c; c = c - a - b; if (c < 0) { cout << "No" << endl; return 0; } c *= c; if (4 * a * b < c) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <cmath> #include <iostream> using namespace std; int main() { long long a, b, c; cin >> a >> b >> c; c = c - a - b; if (c < 0) { cout << "No" << endl; return 0; } c *= c; if (4 * a * b < c) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87]]
1
93
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> using namespace std; struct Memo { int fact = 0; int fact_inv = 0; int inv = 0; }; class Combination { private: int m_module = 1000000007; vector<struct Memo> memo; public: int ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> using namespace std; struct Memo { int fact = 0; int fact_inv = 0; int inv = 0; }; class Combination { private: int m_module = 1000000007; vector<struct Memo> memo; public: int ...
[["+", 15, 23, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 15, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 41, 15, 23, 0, 16, 31, 16, 17, 18], ["+", 0, 41, 15, 23, 0, 16, 31, 16, 12, 22], ["+", 12, 23, 0, 41, 15, 23, 0, 16, 17, 98]]
1
490
import math a,b,c = map(int,input().split()) if (a+b-c) ** 2 - 4 * a * b > 0: print("Yes") else: print("No")
import math a,b,c = map(int,input().split()) if (a+b-c) ** 2 - 4 * a * b > 0 and a+b < c: print("Yes") else: print("No") # print((a+b-c) ** 2 - 4 * a * b )
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 31, 22], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 17, 72], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 12, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 18], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22]]
5
53
# -*- coding: utf-8 -*- import sys import math debug = False def log(text): if debug: print(text) def parse_input(lines_as_string = None): global debug lines = [] if lines_as_string is None: debug = False # for line in sys.stdin: # lines.append(line) lin...
# -*- coding: utf-8 -*- import sys import math debug = False def log(text): if debug: print(text) def parse_input(lines_as_string = None): global debug lines = [] if lines_as_string is None: debug = False # for line in sys.stdin: # lines.append(line) lin...
[["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 656, 0, 14, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121]]
5
222
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = std::int_fast64_t; using std::cerr; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, T...
#include <bits/stdc++.h> using namespace std::literals::string_literals; using i64 = std::int_fast64_t; using std::cerr; using std::cin; using std::cout; using std::endl; template <typename T> std::vector<T> make_v(size_t a) { return std::vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, T...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
206
a, b, c = [int(n) for n in input().split()] l = 4 * a * b r = (c - a - b) ** 2 if c <= a + b and l < r: print('Yes') else: print('No')
a, b, c = [int(n) for n in input().split()] l = 4 * a * b r = (c - a - b) ** 2 if c > a + b and l < r: print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 667, 19], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 667, 47]]
5
65
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; typedef pair<ll, ll> pl; typedef queue<ll> ql; typedef set<ll> sl; typedef vector<ll> vl; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define rep2(i, n) for (ll i = 1; i <= ll(n); i++) //#define rep(i, k, n) for(ll i = ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; typedef pair<ll, ll> pl; typedef queue<ll> ql; typedef set<ll> sl; typedef vector<ll> vl; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define rep2(i, n) for (ll i = 1; i <= ll(n); i++) //#define rep(i, k, n) for(ll i = ...
[["+", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
238
#include "bits/stdc++.h" #include <algorithm> #include <random> #include <unordered_set> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef unsigned long long ull; using namespace std; #define vll vector<vector<long long>> #define vl vector<long long> #define vi vector<int> #define vii vector<v...
#include "bits/stdc++.h" #include <algorithm> #include <random> #include <unordered_set> #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef unsigned long long ull; using namespace std; #define vll vector<vector<long long>> #define vl vector<long long> #define vi vector<int> #define vii vector<v...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
1,640