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 <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
#include <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15...
1
176
if len(slist) ==2: if len(set(slist)) ==1: print(1,2) exit() else: print("-1 -1") exit() else: for i in range(1,len(slist)-1): if len(set(slist[i-1:i+2])) !=3: print(i,3) exit() print("-1 -1")
s = input() slist = list(s) if len(slist) ==2: if len(set(slist)) ==1: print(1,2) exit() else: print("-1 -1") exit() else: for i in range(1,len(slist)-1): if len(set(slist[i-1:i+2])) !=3: print(i,i+2) exit() print("-1 -1")
[["+", 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, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 0, 1,...
5
91
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; #define dump(x) cerr << #x << "=" << x << endl using P = pair<int, int>; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (i == s.size() - 2) { if (s.at(i) == s.at(i...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) typedef long long ll; #define dump(x) cerr << #x << "=" << x << endl using P = pair<int, int>; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (i == s.size() - 2) { if (s.at(i) == s.at(i...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25]...
1
178
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; template <typename T> using lim = numeric_limits<T>; int arr[26]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); for (int i = 0; i < 26; i++) arr[i] = -1; string s; cin >> s; int n = s.size(); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; template <typename T> using lim = numeric_limits<T>; int arr[26]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); for (int i = 0; i < 26; i++) arr[i] = -1; string s; cin >> s; int n = s.size(); ...
[["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
203
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; for (int i = 0; i <= s.size() - 2; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } } for (int i = 0; i <= s.size() - 3; i++) { if (s[i] == s[i + 2]) { ...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; int N = (int)s.size(); for (int i = 0; i <= N - 2; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } } for (int i = 0; i <= N - 3; i++) { if (s[i] == s...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 24], ["+", 0, 43, 49, 50, 51, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 25], ["+", 49, 50, 51, 74, 51, 2, 63, 118, 28, 22], ["+", 49, 50,...
1
147
S = input() N = len(S) Ans = [-1,-1] for i in range(N-1): if S[i]==S[i+1]: Ans = [i,i+1] break for i in range(N-2): if S[i]==S[i+2] and S[i]!=S[i+1]: Ans = [i,i+2] break print(Ans[0]+1,Ans[1]+1)
S = input() N = len(S) Ans = [-1,-1] # 1-indexedであることに注意。。。 for i in range(N-1): if S[i]==S[i+1]: Ans = [i+1,i+2] break for i in range(N-2): if S[i]==S[i+2] and S[i]!=S[i+1]: Ans = [i+1,i+3] break print(Ans[0],Ans[1])
[["+", 0, 1, 0, 662, 12, 634, 0, 657, 17, 72], ["+", 0, 1, 0, 662, 12, 634, 0, 657, 12, 612], ["-", 0, 1, 0, 662, 12, 634, 0, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
114
package main import ( "bufio" "fmt" "os" ) var sc = bufio.NewScanner(os.Stdin) func Scanner() string { sc.Scan() return sc.Text() } func main() { buf := make([]byte, 0) sc.Buffer(buf, 1000000007) sc.Split(bufio.ScanWords) s := Scanner() l, r := -1, -1 for i := 0; i < len(s)-2; i++ { if s[i] == s[i+1] {...
package main import ( "bufio" "fmt" "os" ) var sc = bufio.NewScanner(os.Stdin) func Scanner() string { sc.Scan() return sc.Text() } func main() { buf := make([]byte, 0) sc.Buffer(buf, 1000000007) sc.Split(bufio.ScanWords) s := Scanner() l, r := -1, -1 for i := 0; i < len(s)-2; i++ { if s[i] == s[i+1] {...
[["+", 64, 196, 0, 436, 12, 432, 0, 16, 17, 72], ["+", 64, 196, 0, 436, 12, 432, 0, 16, 12, 433], ["-", 64, 196, 0, 436, 12, 432, 0, 16, 12, 433], ["-", 64, 196, 0, 436, 12, 432, 0, 16, 17, 33], ["+", 36, 36, 36, 36, 36, 36, 0, 434, 0, 165]]
7
222
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; using ll = long lon...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; using ll = long lon...
[["+", 31, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 31, 16, 31, 16, 31, 16, 12, 23, 0, 25], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ...
1
510
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F(i, a, b) for (int i = (a); i <= (b); i++) #define D(i, a, b) for (int i = (a); i >= (b); i--) #define R(i, a, b) for (int i = (a); i < (b); i++) #define N 500000 #define ALL(vt) vt.begin(), vt.end() void solve(string s) { int n = s.length()...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define F(i, a, b) for (int i = (a); i <= (b); i++) #define D(i, a, b) for (int i = (a); i >= (b); i--) #define R(i, a, b) for (int i = (a); i < (b); i++) #define N 500000 #define ALL(vt) vt.begin(), vt.end() void solve(string s) { int n = s.length()...
[["-", 64, 1, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 64, 1, 0, 16, 31, 16, 31, 16, 12, 13], ["-", 64, 9, 0, 57, 64, 1, 0, 16, 12, 13], ["+", 64, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 13], ["-", 0, 57, 75, 76, 0, 1, 0, 16, 12, 22], ["+", 0, 57,...
1
230
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int l = -1, r = -1; for (int i = 0; i < s.length(); ++i) { if (s[i] == s[i + 1]) { l = i; r = i + 1; break; } ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int l = -1, r = -1; for (int i = 0; i < s.length(); ++i) { if (s[i] == s[i + 1]) { l = i; r = i + 1; break; } ...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 16, 31...
1
155
#include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n) for (ll i = s; i <= n; i++) int main() { string s; cin >> s; rep(i, 0, s.size()) { if ((i != s.size() - 1) && s[i] == s[i + 1]) { cout << i + 1 << " " <...
#include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n) for (ll i = s; i <= n; i++) int main() { string s; cin >> s; rep(i, 0, s.size()) { if ((i != s.size() - 1) && s[i] == s[i + 1]) { cout << i + 1 << " " <...
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+",...
1
159
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; for (int i = 0; i < s.size() - 2; ++i) { char a = s[i], b = s[i + 1], c = s[i + 2]; if (a == b) { cout << i + 1 << " " << i + 2 << endl; return 0; } else if (a == c) { cout << i + 1 << " " << i + 3 <<...
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; if (s[0] == s[1]) { cout << "1 2" << endl; return 0; } for (int i = 0; i < s.size() - 2; ++i) { char a = s[i], b = s[i + 1], c = s[i + 2]; if (a == b) { cout << i + 1 << " " << i + 2 << endl; return...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, ...
1
159
#include <iostream> #include <string.h> using namespace std; int main() { char s[100000]; int n, a = -10; cin >> s; n = strlen(s); for (int i = 0; i < n; i++) if (s[i] == s[i + 1]) a = i; if (a != -10) cout << a + 1 << " " << a + 2; else { for (int i = 0; i < n; i++) if (s[i] == ...
#include <iostream> #include <string.h> using namespace std; int main() { char s[100000]; int n, a = -10; cin >> s; n = strlen(s); for (int i = 0; i < n; i++) if (s[i] == s[i + 1]) a = i; if (a != -10) cout << a + 1 << " " << a + 2; else { for (int i = 0; i < n; i++) if (s[i] == ...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 75, 76, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 17, 151], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 57, 75, 76, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 75, 7...
1
148
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n) for (ll i = s; i <= n; i++) int main() { string s; cin >> s; rep(i, 0, s.size()) { if (s[i] == s[i + 1]) { cout << i << " " << i +...
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, s, n) for (ll i = s; i < n; i++) #define repe(i, s, n) for (ll i = s; i <= n; i++) int main() { string s; cin >> s; rep(i, 0, s.size()) { if (s[i] == s[i + 1]) { cout << i + 1 << " " <<...
[["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13]...
1
143
#include "bits/stdc++.h" using namespace std; vector<int> v[26]; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { v[s[i] - 'a'].emplace_back(i + 1); } for (int i = 0; i < 26; ++i) { if (v[i].size() < 2) continue; for (int j = 1; j < v[i].size(); ++j) { int a = v...
#include "bits/stdc++.h" using namespace std; vector<int> v[26]; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { v[s[i] - 'a'].emplace_back(i + 1); } for (int i = 0; i < 26; ++i) { if (v[i].size() < 2) continue; for (int j = 1; j < (int)v[i].size(); ++j) { int...
[["+", 8, 9, 0, 7, 15, 16, 12, 74, 0, 24], ["+", 0, 7, 15, 16, 12, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 7, 15, 16, 12, 74, 0, 25], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
176
/* ... . xdM*"""*+"9M xM" "M MP" "M ,M/|, \`4 n" /|/. .\ \\``4 d) <~!-' \^`\ ` n M" \ M. !: uu< ; M@ @ !$$...
/* ... . xdM*"""*+"9M xM" "M MP" "M ,M/|, \`4 n" /|/. .\ \\``4 d) <~!-' \^`\ ` n M" \ M. !: uu< ; M@ @ !$$...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 64, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 64, ...
1
147
def search_unblanced_position(char_str): for i in range(len(char_str)-1): if s[i] == s[i+1]: return i+1,i+2 for i in range(len(char_str)-2): if s[i] == s[i+2]: return i+1,i+3 return -1,-1 s = input() print (search_unblanced_position(s))
def search_unblanced_position(char_str): for i in range(len(char_str)-1): if s[i] == s[i+1]: return i+1,i+2 for i in range(len(char_str)-2): if s[i] == s[i+2]: return i+1,i+3 return -1,-1 s = input() a,b = search_unblanced_position(s) print (a,b)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 65...
5
92
#include <bits/stdc++.h> #define FOR(I, X, Y) for (int(I) = (X); (I) < (Y); (I)++) #define REP(I, X, Y) for (int(I) = (Y)-1; (I) >= (X); (I)--) #define ALL(X) (X).begin(), (X).end() #define INF 1000000007 #define LINF 1000000000000000007 typedef long long ll; using namespace std; int main() { string s; cin >> s; ...
#include <bits/stdc++.h> #define FOR(I, X, Y) for (int(I) = (X); (I) < (Y); (I)++) #define REP(I, X, Y) for (int(I) = (Y)-1; (I) >= (X); (I)--) #define ALL(X) (X).begin(), (X).end() #define INF 1000000007 #define LINF 1000000000000000007 typedef long long ll; using namespace std; int main() { string s; cin >> s; ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
169
#include <bits/stdc++.h> using namespace std; string s; int main(void) { // Here your code ! cin >> s; for (int i = 0; i < s.size(); ++i) { if (i + 1 < s.size()) { if (s[i] == s[i + 1]) { printf("%d %d\n", i + 1, i + 1 + 1); return 0; } } if (i + 2 < s.size()) { i...
#include <bits/stdc++.h> using namespace std; string s; int main(void) { // Here your code ! cin >> s; for (int i = 0; i < s.size(); ++i) { if (i + 1 < s.size()) { if (s[i] == s[i + 1]) { printf("%d %d\n", i + 1, i + 1 + 1); return 0; } } if (i + 2 < s.size()) { i...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0...
1
146
import numpy as np s = [ord(a)-ord('a') for a in input()] n = len(s) if n == 2: if s[0] == s[1]: print('1 2') else: print('-1 -1') exit() cnt = np.array([0] * 26) cum = [cnt.copy()] for i, a in enumerate(s): cnt[a] += 1 cum.append(cnt.copy()) def is_check(cum, n): for i in [...
import numpy as np s = [ord(a)-ord('a') for a in input()] n = len(s) if n == 2: if s[0] == s[1]: print('1 2') else: print('-1 -1') exit() cnt = np.array([0] * 26) cum = [cnt.copy()] for i, a in enumerate(s): cnt[a] += 1 cum.append(cnt.copy()) def is_check(cum, n): i = 3 ...
[["-", 0, 656, 0, 14, 8, 196, 0, 7, 0, 88], ["-", 0, 656, 0, 14, 8, 196, 0, 7, 0, 267], ["-", 0, 14, 8, 196, 0, 7, 12, 634, 0, 70], ["-", 0, 14, 8, 196, 0, 7, 12, 634, 0, 612], ["-", 0, 14, 8, 196, 0, 7, 12, 634, 0, 21], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 14, 8, 196, 0, 7, 12, 634, 0, 73], ["-", 0, 656...
5
203
#include <bits/stdc++.h> using namespace std; bool unbalanced(const string &str) { int counts[26] = {}; for (char ch : str) counts[ch - 'a']++; for (int i = 0; i < 26; ++i) if (2 * counts[i] > str.size()) return true; return false; } void solve(string s) { if (s.size() == 2 && s[0] == s[1]) { ...
#include <bits/stdc++.h> using namespace std; bool unbalanced(const string &str) { int counts[26] = {}; for (char ch : str) counts[ch - 'a']++; for (int i = 0; i < 26; ++i) if (2 * counts[i] > str.size()) return true; return false; } void solve(string s) { if (s.size() == 2 && s[0] == s[1]) { ...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["+", 31, 16,...
1
224
#include <bits/stdc++.h> using namespace std; #define inf 1e9 #define ll long long #define M 1000000007 #define P pair<int, int> string s; int c[30]; int f, g; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { if (i > 1 && s[i] == s[i - 1]) { f = i; g = i + 1; break; } if ...
#include <bits/stdc++.h> using namespace std; #define inf 1e9 #define ll long long #define M 1000000007 #define P pair<int, int> string s; int c[30]; int f = -1, g = -1; int main() { cin >> s; for (int i = 0; i < s.size(); i++) { if (i > 0 && s[i] == s[i - 1]) { f = i; g = i + 1; break; ...
[["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
141
#include <bits/stdc++.h> #define ll long long using namespace std; char s[100100]; int main() { while (~scanf("%s", s)) { int len = strlen(s); int n = len; int F = 0; for (int i = 0; i < len - 2; i++) { if (s[i] == s[i + 1]) { printf("%d %d\n", i + 1, i + 2); F = 1; bre...
#include <bits/stdc++.h> #define ll long long using namespace std; char s[100100]; int main() { while (~scanf("%s", s)) { int len = strlen(s); int n = len; int F = 0; for (int i = 0; i < len - 2; i++) { if (s[i] == s[i + 1]) { printf("%d %d\n", i + 1, i + 2); F = 1; bre...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 8, 9, 0, 57, 15, 339, 51, 91, 28, 22], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, ...
1
206
// finish date: 2018/02/02 #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define FOR(i, a, b) for (int(i) = a; (i) < (b); (i)++) #define rep(i, n) FOR(i, 0, n) #define ll long long ...
// finish date: 2018/02/02 #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define FOR(i, a, b) for (int(i) = a; (i) < (b); (i)++) #define rep(i, n) FOR(i, 0, n) #define ll long long ...
[["+", 0, 57, 64, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+",...
1
344
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back #define mp make_pair typedef long long ll; typedef pair<int, int> pint; int main() { string s; cin >> s; rep(i, s.size() - 2) { if (s[i] == s[i + 1]) { ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back #define mp make_pair typedef long long ll; typedef pair<int, int> pint; int main() { string s; cin >> s; rep(i, s.size() - 1) { if (s[i] == s[i + 1]) { ...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 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, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+...
1
158
s = input() tc = [ chr(i)*2 for i in range(ord('a'), ord('z')+1) ] + [ chr(i)+chr(j)+chr(i) for i in range(ord('a'), ord('z')+1) for j in range(ord('a'), ord('z')+1)] for i in tc: if i in s: t = i break else: t = 0 if t == 0: x=y=-1 for i in range(len(s)-len(t)+1): if s[i:i+len(t)] == t: ...
s = input() tc = [ chr(i)*2 for i in range(ord('a'), ord('z')+1) ] + [ chr(i)+chr(j)+chr(i) for i in range(ord('a'), ord('z')+1) for j in range(ord('a'), ord('z')+1)] x=y=-1 t = "0" for i in tc: if i in s: t = i for i in range(len(s)-len(t)+1): if s[i:i+len(t)] == t: x = i+1 y = i+len(t) print(x,...
[["+", 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, 662, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 662, 0, 32], ["+", 0, 1, 0, 662, 12, 662, 12, 664, 17, 33], ["+", 0, 1, 0, 662, 12, 662, 12, 664, 28, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 654]...
5
177
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.length() - 1; ++i) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2; return 0; } } for (int i = 0; i < s.length() - 2; ++i) { if (s[i] == s[i + 2]) { cout << i + 1 << " ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.length() - 1; ++i) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2; return 0; } } for (int i = 0; i < s.length() - 2; ++i) { if (s[i] == s[i + 2]) { cout << i + 1 << " ...
[["+", 0, 1, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9,...
1
132
// start of jonathanirvings' template v3.0.3 (BETA) #include <bits/stdc++.h> using namespace std; /** using std::max; using std::swap; using std::abs; using std::priority_queue; using std::queue; using std::bitset; using std::make_tuple; using std::istream; using std::ostream; using std::fixed; using std::greater; us...
// start of jonathanirvings' template v3.0.3 (BETA) #include <bits/stdc++.h> using namespace std; /** using std::max; using std::swap; using std::abs; using std::priority_queue; using std::queue; using std::bitset; using std::make_tuple; using std::istream; using std::ostream; using std::fixed; using std::greater; us...
[["+", 0, 124, 0, 42, 0, 356, 0, 42, 0, 95], ["+", 0, 124, 0, 42, 0, 356, 0, 42, 0, 45], ["+", 0, 42, 0, 11, 31, 2, 63, 118, 28, 22], ["+", 0, 42, 0, 11, 31, 2, 63, 118, 17, 131], ["+", 0, 42, 0, 11, 31, 2, 63, 118, 119, 120], ["+", 0, 42, 0, 11, 31, 2, 3, 4, 0, 24], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1...
1
2,455
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <stdio.h> #include <string> #include <utility> #include <vector> #define ALL(g) (g).begin(), (g).end() #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n)...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <stdio.h> #include <string> #include <utility> #include <vector> #define ALL(g) (g).begin(), (g).end() #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n)...
[["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 64, 9, 0, 57, 64, 9, 0, 37, 0, 13], ["+", 64, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46], ["+", 64, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9,...
1
227
<?php fscanf(STDIN, "%s", $string); $length = strlen($string); $co_1 = -1; $co_2 = -1; for ($i = 0; $i < $length - 1; ++$i) { if ($string[$i] == $string[$i + 1]) { $co_1 = $i; $co_2 = $i + 1; } } for ($i = 0; $i < $length - 2; ++$i) { if ($string[$i] == $string[$i + 2]) { $co_1 = $i;...
<?php fscanf(STDIN, "%s", $string); $length = strlen($string); $co_1 = -1; $co_2 = -1; for ($i = 0; $i < $length - 1; ++$i) { if ($string[$i] == $string[$i + 1]) { $co_1 = $i; $co_2 = $i + 1; } } for ($i = 0; $i < $length - 2; ++$i) { if ($string[$i] == $string[$i + 2]) { $co_1 = $i;...
[["-", 15, 23, 0, 16, 31, 16, 31, 606, 0, 141], ["+", 15, 23, 0, 16, 31, 16, 31, 606, 0, 141], ["-", 15, 23, 0, 16, 12, 16, 31, 606, 0, 141], ["+", 15, 23, 0, 16, 12, 16, 31, 606, 0, 141], ["+", 36, 36, 0, 493, 0, 57, 8, 9, 0, 45], ["+", 36, 36, 0, 493, 0, 57, 8, 9, 0, 46], ["+", 0, 493, 0, 57, 75, 76, 8, 9, 0, 45], ["...
6
193
#!/usr/bin/env python3 # -*- coding: utf-8 -*- s = input() def search(s): for i in range(len(s)-1): if s[i] == s[i+1]: return i+1, i+2 if s[i] == s[i+2]: return i+1, i+3 return -1, -1 if __name__ == "__main__": a, b = search(s) if a == -1: print("-1 -...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- s = input() def search(s): for i in range(len(s)-1): if s[i] == s[i+1]: return i+1, i+2 if len(s) > i+2 and s[i] == s[i+2]: return i+1, i+3 return -1, -1 if __name__ == "__main__": a, b = search(s) if a == -1: ...
[["+", 0, 57, 15, 679, 31, 666, 0, 652, 63, 22], ["+", 15, 679, 31, 666, 0, 652, 3, 4, 0, 24], ["+", 15, 679, 31, 666, 0, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 47], ["+", 0, 57, 15, 679, 31, 666, 0, 657, 31, 22], ["+", 0, 57, 15, 679, 31, 666, 0, 657, 17, 72], ["+", 0, 57, 15, 679, 31, 666, 0, ...
5
132
#include <stdio.h> #include <string.h> using namespace std; char str[123456]; int main(void) { scanf("%s", str); int n = strlen(str); for (int i = 1; i < n; ++i) { if (str[i - 1] == str[i]) { return 0 * printf("%d %d", i, i + 1); } } for (int i = 2; i < n; ++i) { if (str[i - 2] == str[i])...
#include <stdio.h> #include <string.h> using namespace std; char str[123456]; int main(void) { scanf("%s", str); int n = strlen(str); for (int i = 1; i < n; ++i) { if (str[i - 1] == str[i]) { return 0 * printf("%d %d", i, i + 1); } } for (int i = 2; i < n; ++i) { if (str[i - 2] == str[i])...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
139
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int location = 0; bool found = false; if (s.size() == 2) { cout << 1 << " " << 2 << endl; return 0; } for (int i = 0; i < s.length() - 2; i++) { if (s[i] == s[i + 1]) { location = i; found...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int location = 0; bool found = false; if (s.size() == 2 && s[0] == s[1]) { cout << 1 << " " << 2 << endl; return 0; } for (int i = 0; i < s.length() - 2; i++) { if (s[i] == s[i + 1]) { location ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 15, 339, 51, 16, 12, 16, 12, ...
1
208
#include <iostream> using namespace std; #include <algorithm> #include <stdio.h> #include <vector> #define _USE_MATH_DEFINES #include <cstdlib> #include <math.h> #include <string> int dx[8] = {1, 2, 1, 2, -1, -2, -1, -2}, dy[8] = {2, 1, -2, -1, -2, -1, 2, 1}; int main() { string s; cin >> s; for (int i = 0; i ...
#include <iostream> using namespace std; #include <algorithm> #include <stdio.h> #include <vector> #define _USE_MATH_DEFINES #include <cstdlib> #include <math.h> #include <string> int dx[8] = {1, 2, 1, 2, -1, -2, -1, -2}, dy[8] = {2, 1, -2, -1, -2, -1, 2, 1}; int main() { string s; cin >> s; for (int i = 0; i ...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151]]
1
195
#include <iostream> using namespace std; int main() { string str; cin >> str; int s = -1, e = -1; for (int i = 0; i < str.size() - 2; i++) { int a[27] = {0}; for (int k = 0; k < 3; k++) { int c = str[k + i] - 'a'; a[c]++; if (a[c] == 2) { s = i + 1; e = i + k + 1; ...
#include <iostream> using namespace std; int main() { string str; cin >> str; int s = -1, e = -1; for (int i = 0; i < str.size(); i++) { int a[29] = {0}; for (int k = 0; k < 3; k++) { if (k + i >= str.size()) { break; } int c = str[k + i] - 'a'; a[c]++; if (a[c] ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 7, 0, 25], ["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, ...
1
145
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <vect...
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <vect...
[["-", 31, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 31, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 31, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 12, 16, 12, 69, 341, 342,...
1
237
s = list(input()) alpha = [[0 for i in range(2)] for j in range(26)] def conv(t): if t == 'a': return 0 elif t == 'b': return 1 elif t == 'c': return 2 elif t == 'd': return 3 elif t == 'e': return 4 elif t == 'f': return 5 elif t == 'g': ...
s = list(input()) alpha = [[0 for i in range(2)] for j in range(26)] def conv(t): if t == 'a': return 0 elif t == 'b': return 1 elif t == 'c': return 2 elif t == 'd': return 3 elif t == 'e': return 4 elif t == 'f': return 5 elif t == 'g': ...
[["+", 8, 196, 0, 1, 0, 662, 31, 206, 206, 612], ["+", 8, 196, 0, 1, 0, 662, 31, 206, 0, 73], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 1, 0, 662, 31, 206, 51, 206, 51, 22], ["+", 0, 1, 0, 662, 31, 206, 51, 206, 0, 70], ["+", 0, 662, 31, 206, 51, 206, 206, 652, 6...
5
407
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; // vector<vector<int>> a(26, vector<int>(0)); // for(int i = 0; i < (int)s.size(); i++){ // a.at(s.at(i) - 'a').push_back(i); // } // for(int i = 0; i < 26; i++){ // for(int j = 0; j < (int)a.at(i).s...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; // vector<vector<int>> a(26, vector<int>(0)); // for(int i = 0; i < (int)s.size(); i++){ // a.at(s.at(i) - 'a').push_back(i); // } // for(int i = 0; i < 26; i++){ // for(int j = 0; j < (int)a.at(i).s...
[["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["-", 0, 16, 3...
1
176
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int C = s.size(); int D = 0; for (int i = 0; i < C - 2; i++) { if (s.at(i) == s.at(i + 1)) { cout << i + 1 << " " << i + 2 << endl; D++; break; } else if (s.at(i) == s.at(i + 2)) { cout << i + 1 <...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int C = s.size(); int D = 0; for (int i = 0; i < C - 2; i++) { if (s.at(i) == s.at(i + 1)) { cout << i + 1 << " " << i + 2 << endl; D++; break; } else if (s.at(i) == s.at(i + 2)) { cout << i + 1 <...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
185
s = str(input()) if len(s) == 2: if s[0] ==s[1]: start_ind =1 end_ind = 2 else: start_ind = -1 end_ind = -1 elif len(s)>2: for i in range(len(s)-2): par_str = s[i:i+3] if (par_str.count(par_str[0])>=2) | (par_str.count(par_str[1])>=2): st...
s = str(input()) if len(s) == 2: if s[0] ==s[1]: start_ind =1 end_ind = 2 else: start_ind = -1 end_ind = -1 elif len(s)>2: start_ind = -1 end_ind = -1 for i in range(len(s)-2): par_str = s[i:i+3] if (par_str.count(par_str[0])>=2) | (par_str.c...
[["+", 75, 665, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 664, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 664, 28, 612]]
5
133
S=gets.chomp L,R=-1,-1 S.size.times do |i| L,R=i+1,i+2 if S[i]==S[i+1] L,R=i+1,i+3 if S[i]==S[i+2] end puts '#{L} #{R}'
S=gets.chomp L,R=-1,-1 S.size.times do |i| L,R=i+1,i+2 if S[i]==S[i+1] L,R=i+1,i+3 if S[i]==S[i+2] end A=[L,R] puts A.join(' ')
[["+", 36, 36, 36, 36, 0, 493, 0, 662, 31, 743], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 70], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 743], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 21], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 73], ["+", 0, 493, 0, 652, 3, 4, 0, 652, ...
4
74
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= (b); --i) #define RI(i, n) FOR(i, 1, (n)) #define REP(i, n) FOR(i, 0, (n)-1) #define mini(a, b) a = min(a, b) #define maxi(a, b) a = max(a, b) #define mp make_pair #define p...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); ++i) #define FORD(i, a, b) for (int i = (a); i >= (b); --i) #define RI(i, n) FOR(i, 1, (n)) #define REP(i, n) FOR(i, 0, (n)-1) #define mini(a, b) a = min(a, b) #define maxi(a, b) a = max(a, b) #define mp make_pair #define p...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
285
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll table[1000][1000]; const ll mod = 1000000007; int main() { string s; cin >> s; int st = -1; int end = -1; for (int...
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll table[1000][1000]; const ll mod = 1000000007; int main() { string s; cin >> s; int st = -1; int end = -1; for (int...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, ...
1
190
#include <iostream> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size() - 2; i++) if (s[i] == s[i + 1] || s[i] == s[i + 2]) { cout << i + 1 << " " << i + 1 + (s[i] == s[i + 1] ? 1 : 2) << endl; return 0; } cout << -1 << " " << -1 << endl; return 0; }
#include <iostream> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size() - 1; i++) if (s[i] == s[i + 1] || s[i] == s[i + 2]) { cout << i + 1 << " " << i + 2 + (s[i] != s[i + 1]) << endl; return 0; } cout << -1 << " " << -1 << endl; return 0; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["-", 12, 16, 12, 23, 0, 41, 15, 16, 17, 60], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 79], ["-", 31, 16, 12, 16, 12, 23, 0, 41, 0, 101], ["-...
1
119
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> #define rep(X, N) for (ll X = 0; X < (N); X++) #define PI (acos(-1.0)) #define pback push_back #define mpair make_pair #define MODN 1000000007 #define ALL(V) (V).begin(), (V).end() #define CERR ...
#include <bits/stdc++.h> //#include <boost/multiprecision/cpp_int.hpp> #define rep(X, N) for (ll X = 0; X < (N); X++) #define PI (acos(-1.0)) #define pback push_back #define mpair make_pair #define MODN 1000000007 #define ALL(V) (V).begin(), (V).end() #define CERR ...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151]]
1
202
/**************************************************************** # @Author: iLovePKU_zbtxdy # @DateTime: 2020-01-27 14:25:45 # @Description: You build it. You run it # @More: Once lots of AC, try Brute-force,dynamic programming ****************************************************************/ #include <bits/st...
/**************************************************************** # @Author: iLovePKU_zbtxdy # @DateTime: 2020-01-27 14:25:45 # @Description: You build it. You run it # @More: Once lots of AC, try Brute-force,dynamic programming ****************************************************************/ #include <bits/st...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13]]
1
209
<?php fscanf(STDIN, "%s", $ss); $s = str_split($ss); $len = count($s); if ($len == 2) { echo '-1 -1'; return; } $list = [$s[0] => 1, $s[1] => 1]; for ($i = 2; $i < $len; $i++) { if (!isset($list[$s[$i]]) || $list[$s[$i]] == 0) { $list[$s[$i]] = 1; } elseif ($list[$s[$i]] == 1) { echo ($i...
<?php fscanf(STDIN, "%s", $ss); $s = str_split($ss); $len = count($s); if ($s[0] == $s[1]) { echo '1 2'; return; } if ($len == 2) { echo '-1 -1'; return; } $list = [$s[0] => 1, $s[1] => 1]; for ($i = 2; $i < $len; $i++) { if (!isset($list[$s[$i]]) || $list[$s[$i]] == 0) { $list[$s[$i]] = 1; ...
[["+", 15, 23, 0, 16, 31, 69, 0, 606, 0, 141], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 0, 70], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 0, 612], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 0, 73], ["+", 0, 493, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 15, 23, 0, 16, 12, 69, 0, 606, 0, 607], ["+", 15, 23, 0, 16, 12, 69, 0, 606, 0, 141], ["+...
6
189
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool flag = false; for (int i = 0; i < s.size() - 2; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } else if (s[i] == s[i + 2]) { cout << i + 1 << " " << i + 3 << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size() - 1; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } else if (i < s.size() - 2 && s[i] == s[i + 2]) { cout << i + 1 << " " << i + 3 << endl; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339,...
1
125
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
[["+", 64, 1, 0, 34, 31, 11, 12, 16, 17, 72], ["+", 64, 1, 0, 34, 31, 11, 12, 16, 12, 13], ["-", 64, 1, 0, 34, 12, 11, 12, 16, 12, 13], ["+", 64, 1, 0, 34, 12, 11, 12, 16, 12, 13], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], [...
1
217
#include <stdio.h> #include <string.h> int main(void) { char s[100000]; int l; int i, j; int n[26] = {}; int th; int num; scanf("%s", s); l = strlen(s); for (i = 2; i <= 2; i++) { th = i / 2 + 1; for (j = 0; j < 26; j++) { n[j] = 0; } for (j = 0; j < i; j++) { num = s...
#include <stdio.h> #include <string.h> int main(void) { char s[100000]; int l; int i, j; int n[26] = {}; int th; int num; scanf("%s", s); l = strlen(s); for (i = 2; i <= 2; i++) { th = i / 2 + 1; for (j = 0; j < 26; j++) { n[j] = 0; } for (j = 0; j < i; j++) { num = s...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 14, 8,...
1
440
#include <bits/stdc++.h> using namespace std; #define REP(i, a) for (int i = 0; i < (a); i++) #define ALL(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const long long LINF = 1e18; const long long MOD = 1e9 + 7; signed main() { string s; cin >> s; int n = s.size()...
#include <bits/stdc++.h> using namespace std; #define REP(i, a) for (int i = 0; i < (a); i++) #define ALL(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const long long LINF = 1e18; const long long MOD = 1e9 + 7; signed main() { string s; cin >> s; int n = s.size()...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151]]
1
268
S = input() # 2文字だった時の判定 if len(s) == 2: if s[0] == s[1]: print("1 2") else: print("-1 -1") # 2文字以上の時の判定 else: # 比較 for i in range(len(s) - 2): # 3文字比較すれば、アンバランスかわかる # 3文字全部ばらばらならOK # 1:2に別れたらアンバランス t = s[i:i + 3] # tの中で、1文字目の出現回数が1より上、もしくは、2文字目の...
import sys s = input() # 2文字だった時の判定 if len(s) == 2: if s[0] == s[1]: print("1 2") else: print("-1 -1") # 2文字以上の時の判定 else: # 比較 for i in range(len(s) - 2): # 3文字比較すれば、アンバランスかわかる # 3文字全部ばらばらならOK # 1:2に別れたらアンバランス t = s[i:i + 3] # tの中で、1文字目の出現回数が1より上...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+...
5
105
#include <bits/stdc++.h> #include <vector> using namespace std; int main(int argc, char const *argv[]) { string s; cin >> s; bool flag = false; for (unsigned int i = 0; i < s.size() - 1; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; flag = true; break; } } ...
#include <bits/stdc++.h> #include <vector> using namespace std; int main(int argc, char const *argv[]) { string s; cin >> s; for (unsigned int i = 0; i < s.size() - 1; i++) { if (s[i] == s[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } } for (unsigned int i = 0; i < s.siz...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0, ...
1
183
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i)) #define all(x) x.begin()...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i)) #define all(x) x.begin()...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 17, 131], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, ...
1
172
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int trans(char c) { if (c == 'a') return 0; if (c == 'b') return 1; if (c == 'c') return 2; if (c == 'd') return 3; if (c == 'e') return 4; if (c == 'f') return 5; if (c == 'g') r...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int trans(char c) { if (c == 'a') return 0; if (c == 'b') return 1; if (c == 'c') return 2; if (c == 'd') return 3; if (c == 'e') return 4; if (c == 'f') return 5; if (c == 'g') r...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]...
1
486
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string S; cin >> S; int N = S.size(); for (int i = 0; i < N - 1; i++) { if (S[i] == S[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } } for (int i = 0; i < N - 2; i++) { if (S[i] == S[i + 2...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string S; cin >> S; int N = S.size(); for (int i = 0; i < N - 1; i++) { if (S[i] == S[i + 1]) { cout << i + 1 << " " << i + 2 << endl; return 0; } } for (int i = 0; i < N - 2; i++) { if (S[i] == S[i + 2...
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+",...
1
139
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <limits> #include <numeric> #include <queue> #include <regex> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; int main() { string...
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <limits> #include <numeric> #include <queue> #include <regex> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; int main() { string...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
168
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> /*@@@@@@@@@@@@@@@@@@@@O:8:O@@@@@@@@@c cCCCco...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> /*@@@@@@@@@@@@@@@@@@@@O:8:O@@@@@@@@@c cCCCco...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
496
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]...
1
433
#include <bits/stdc++.h> using namespace std; // 0 1->codeforces #define LL "%lld" #define fi first #define se second #define pb push_back #define mp make_pair #define PN printf("\n") #define MODV 1000000007 #define MAXN 100007 typedef long long ll; typedef double dbl; typedef vector<int> vi; typedef pair<int, int> p...
#include <bits/stdc++.h> using namespace std; // 0 1->codeforces #define LL "%lld" #define fi first #define se second #define pb push_back #define mp make_pair #define PN printf("\n") #define MODV 1000000007 #define MAXN 100007 typedef long long ll; typedef double dbl; typedef vector<int> vi; typedef pair<int, int> p...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
276
#include <stdio.h> #include <string.h> int main(void) { char s[11111]; int dist[30][33333]; int alpha[33]; scanf("%s", s); int i, j; int len = strlen(s); for (i = 0; i < len; i++) { dist[s[i] - 'a'][alpha[s[i] - 'a']] = i + 1; alpha[s[i] - 'a']++; } int a = -1; int b = -1; for (i ...
#include <stdio.h> #include <string.h> char s[100005]; int dist[30][100005]; int alpha[30]; int main(void) { scanf("%s", s); int i, j; int len = strlen(s); for (i = 0; i < len; i++) { dist[s[i] - 'a'][alpha[s[i] - 'a']] = i + 1; alpha[s[i] - 'a']++; } int a = -1; int b = -1; for (i = 0; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["-", 0, 30, 0, 14, 49, 53, 54, 55, 0, 24], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["-", 0, 30, 0, 14, 49, 53, 54, 55, 0, 25], ["-", 36, 36, 0, 30, 0, 14, 8, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 36, 3...
0
249
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; const int maxn = 1e5 + 10; char s[maxn]; int main() { while (~scanf("%s", s)) {...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; const int maxn = 1e5 + 10; char s[maxn]; int main() { while (~scanf("%s", s)) {...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 147], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33]]
1
222
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) int ss[100001]; int dp[30]; string S; int main() { REP(i, 30) ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) int ss[100001]; int dp[30]; string S; int main() { REP(i, 30) ...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["+", 31...
1
370
#include <bits/stdc++.h> using namespace std; int main() { char a, b, c; int i = 2; int flag = 0; cin >> a; cin >> b; while (cin >> c) { if (b == c) { flag = 1; break; } else if (a == c) { flag = 2; break; } a = b; b = c; i++; } if (flag == 1) { cout ...
#include <bits/stdc++.h> using namespace std; int main() { char a, b, c; int i = 2; int flag = 0; cin >> a; cin >> b; if (a == b) { cout << 1 << ' ' << 2 << endl; return 0; } while (cin >> c) { if (b == c) { flag = 1; break; } else if (a == c) { flag = 2; break; ...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 16, 31...
1
156
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) //#define int long long typedef long long ll; using namespace std; string S; signed main() { cin >> S; rep(i, S.length() - 2) { string sub2 = S.substr(i, 2); if (sub2[0] == sub2[1]) { cout << i + 1 << " " << i + 2 << endl; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) //#define int long long typedef long long ll; using namespace std; string S; signed main() { cin >> S; rep(i, S.length() - 1) { string sub2 = S.substr(i, 2); if (sub2[0] == sub2[1]) { cout << i + 1 << " " << i + 2 << endl; ...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 1...
1
166
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <unordered_s...
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <unordered_s...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 15, 339, 51, 16, 12, 16, 12,...
1
349
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size() - 2; i++) { for (int j = i + 1; j <= i + 2; j++) { if (s[i] == s[j]) { printf("%d %d\n", i + 1, j + 1); return 0; } ...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size() - 1; i++) { for (int j = i + 1; j <= i + 2 && j < s.size(); j++) { if (s[i] == s[j]) { printf("%d %d\n", i + 1, j + 1); return 0; } } }...
[["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 98], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 18], ["+", 15, 16...
1
111
#pragma warning(disable : 4996) #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> us...
#pragma warning(disable : 4996) #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> us...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 51, 22], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 8, 9, 0, 9, 0, 57...
1
469
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(), b = sc.nextInt(); if (a * b <= 0) System.out.println("Zero"); else if (a > 0 && b > 0) System.out.println("Positive"); else System.out.prin...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextInt(), b = sc.nextInt(); if (a == 0 || b == 0 || a * b < 0) System.out.println("Zero"); else if (a > 0 && b > 0) System.out.println("Positive"); else ...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 15, 15, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 15, 0, 16, 31, 16, 31, 16, 17, 60], ["+", 15, 15, 0, 16, 31, 16, 31, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 106], ["+", 15, 15, 0, 16, 31, 16, 12, 16, 31...
3
129
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a > 0) { cout << "Positive" << endl; } else if (a <= 0 && b >= 0) { cout << "Zero" << endl; } else if (b < 0) { if ((b - a + 1) / 2 == 0) { cout << "Positive" << endl; } else { cout << "Negati...
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a > 0) { cout << "Positive" << endl; } else if (a <= 0 && b >= 0) { cout << "Zero" << endl; } else if (b < 0) { if ((abs(a) - abs(b) + 1) % 2 == 0) { cout << "Positive" << endl; } else { cout ...
[["-", 31, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["-", 31, 16, 31, 23, 0, 16, 31, 16, 17, 33], ["+", 31, 23, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 17, 33], ["+", 31, 23, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0...
1
104
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a <= 0 && b >= 0) cout << "Zero" << endl; else if (a < 0 && b < 0) { if ((b - a + 1) % 2 == 0) cout << "Positive" << endl; else cout << "Nagetive" << endl; } else cout << "Positive" << endl; retu...
#include <cstdio> #include <iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { //一正一负必有零; if (a <= 0 && b >= 0) cout << "Zero" << endl; //判断二者为负的情况; else if (a < 0) { if ((b - a + 1) % 2 == 0) cout << "Positive" << endl; else cout << "Neg...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 0, 57, 15, 3...
1
97
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; using namespace std; #define pi 3.14159265358979 int main() { ll a, b, ans = 1; cin >> a >> b; if (b > 0 && a < 0) ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; using namespace std; #define pi 3.14159265358979 int main() { ll a, b; cin >> a >> b; if (b >= 0 && a <= 0) cout ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, ...
1
115
package main import ( "bufio" "container/heap" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, initialBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } var d = []Position{{1...
package main import ( "bufio" "container/heap" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, initialBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } var d = []Position{{1...
[["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["-", 0, 435, 8, 196, 0, 57, 64, 196, 0, 165], ["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 0, 434, 0, 435, 8, 196, 0, 57, 0, 95], ["+", 8, 196, 0, 57, 75, 57, 64, 196, 0, 165], ["+", 0, 435, 8, 196, 0, 57, 75, 57, 0, 95], ["+", 8, 196, 0, 57, 75, 57, 75, 196, 0, 45...
7
1,854
#include <stdio.h> int main(void) { // Your code here! long int a, b; scanf("%ld %ld", &a, &b); if (a <= 0 && b >= 0) { printf("Zero\n"); } else if (a < 0 && b < 0) { if ((a - b) % 2 == 0) printf("Negative\n"); if ((a - b) % 2 == 1) printf("Positive\n"); } else if (a > 0 && b > 0) { ...
#include <stdio.h> int main(void) { // Your code here! long int a, b; scanf("%ld %ld", &a, &b); if (a <= 0 && b >= 0) { printf("Zero\n"); } else if (a < 0 && b < 0) { if ((b - a) % 2 == 0) printf("Negative\n"); if ((b - a) % 2 == 1) printf("Positive\n"); } else if (a > 0 && b > 0) { ...
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["-", 0, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 22]]
0
123
a, b=map(int,input().split()) if (a < 0 and 0 < b) or (a == 0 or b ==0): print("Zero") exit() elif 0 < a: print("Positive") exit() m = abs(a) if m % 2 == 0: print("Positive") else: print("Negative")
a, b=map(int,input().split()) if (a < 0 and 0 < b) or (a == 0 or b ==0): print("Zero") exit() elif 0 < a: print("Positive") exit() if (b -a+1) % 2 == 0: print("Positive") else: print("Negative")
[["-", 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, 652, 63, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 31, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 33], ["+", 15, 666, 0, 657, 31, 23, 0, 657, 17,...
5
87
a, b = map(int, input().split()) if a <= 0 and b >= 0: print("Zero") elif a < 0 and b < 0: if len(list(range(a, b+1))) % 2: print("Negative") else: print("Positive") else: print("Positive")
a, b = map(int, input().split()) if a <= 0 and b >= 0: print("Zero") elif a < 0 and b < 0: if (abs(a)-abs(b+1))%2: print("Negative") else: print("Positive") else: print("Positive")
[["-", 64, 196, 0, 57, 15, 657, 31, 652, 63, 22], ["-", 15, 657, 31, 652, 3, 4, 0, 652, 63, 22], ["-", 31, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 15, 657, 31, 23, 0, 657, 31, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 31, 23, 0, 657, 31, 652, 3, 4, 0, 25], [...
5
80
#include <bits/stdc++.h> using namespace std; int main(void) { long long A, B; cin >> A >> B; if (A == 0 || B == 0) { cout << "Zero" << endl; return 0; } if (A <= 0 && 0 <= B) { cout << "Zero" << endl; return 0; } if (A > 0 && B > 0) { cout << "Positive" << endl; return 0; } i...
#include <bits/stdc++.h> using namespace std; int main(void) { long long A, B; cin >> A >> B; if (A == 0 || B == 0) { cout << "Zero" << endl; return 0; } if (A <= 0 && 0 <= B) { cout << "Zero" << endl; return 0; } if (A > 0 && B > 0) { cout << "Positive" << endl; return 0; } i...
[["-", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 22]]
1
144
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; int64_t mod = 998244353; vector<int> getprime(int n) { vector<int> p(0); vector<bool> table(n + 1, 0); for (int i = 2; i <= n; i++) { if (tabl...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; int64_t mod = 998244353; vector<int> getprime(int n) { vector<int> p(0); vector<bool> table(n + 1, 0); for (int i = 2; i <= n; i++) { if (tabl...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 346, 3, 347, 0, 18], ["+", 51, 16, 31, 346, 3, 347, 0, 16, 31, 13], ["+", 51, 16, 31, 346, 3, 347, 0, 16, 17, 98], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 346, 3, 347, ...
1
250
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { ll a, b; cin >> a >> b; if (a > 0 && b > 0) { cout << "Positive" << endl; } if (a <= 0 && b >= 0) { cout << "Zero" << endl; } if (a < ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { ll a, b; cin >> a >> b; if (a > 0 && b > 0) { cout << "Positive" << endl; } if (a <= 0 && b >= 0) { cout << "Zero" << endl; } if ((a <...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24]]
1
138
def resolve(): ''' code here ''' a,b = [int(item) for item in input().split()] if a > 0: print('Positive') else: if a <= 0 and 0 <= b: print('Zero') else: cnt = a - b if cnt % 2 == 1: print('Posivite') else...
def resolve(): ''' code here ''' a,b = [int(item) for item in input().split()] if a > 0: print('Positive') else: if a <= 0 and 0 <= b: print('Zero') else: cnt = b - a + 1 if cnt % 2 == 0: print('Positive') ...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 75, 76, 8, 196, 0, 57, 15, 666, 0,...
5
94
#include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; #define dump(x) \ if (dbg) { \ cerr << #x << " = " << (x) << end...
#include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; #define dump(x) \ if (dbg) { \ cerr << #x << " = " << (x) << end...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, ...
1
490
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define int long long #define ld double #define fi first #define se second #define pb push_back #define pii pair<int, int> #define sz(x) ((long long)x.size()) #define a...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define int long long #define ld double #define fi first #define se second #define pb push_back #define pii pair<int, int> #define sz(x) ((long long)x.size()) #define a...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 45], ["+", 75, 76, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["-", 75, 76, 0, 9, 0, 43, 49, 50, 49, 22], ["-", 75,...
1
287
#include <bits/stdc++.h> #include <boost/integer/common_factor.hpp> #include <boost/integer/common_factor_rt.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/range/algorithm.hpp> #include <boost/range/numeric.hpp> using std::cin; using std::cout; using ...
#include <bits/stdc++.h> #include <boost/integer/common_factor.hpp> #include <boost/integer/common_factor_rt.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/range/algorithm.hpp> #include <boost/range/numeric.hpp> using std::cin; using std::cout; using ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, ...
1
946
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mod % using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll a, b; cin >> a >> b; ll ans; /* for(ll i = a; i <= b; i++){ ans *= i; }*/ if (a > 0 && b > 0) { ans = 1; } else if...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mod % using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll a, b; cin >> a >> b; ll ans; /* for(ll i = a; i <= b; i++){ ans *= i; }*/ if (a > 0 && b > 0) { ans = 1; } else if...
[["+", 31, 23, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 51, 16, 3...
1
186
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31,...
1
221
a, b = map(int, input().split()) if a <= 0 <= b: print("Zero") elif a < 0 and b < 0: subs = b - a + 1 if subs % 2 == 1: print("Negative") else: print("Positive")
a, b = map(int, input().split()) if a <= 0 <= b: print("Zero") elif b < 0: subs = b - a + 1 if subs % 2 == 1: print("Negative") else: print("Positive") else: print("Positive")
[["-", 0, 57, 75, 665, 15, 679, 31, 666, 0, 22], ["-", 0, 57, 75, 665, 15, 679, 31, 666, 667, 18], ["-", 0, 57, 75, 665, 15, 679, 31, 666, 0, 612], ["-", 0, 656, 0, 57, 75, 665, 15, 679, 17, 355], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 75, 665, 64, 196, 0, 57, 75, 76...
5
66
#include <bits/stdc++.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { int a, b; cin >> a >> b; if (a == 0) cout << "Zero"; else if (a < 0 && b >= 0) cout << "Zero"; else if (a > 0) cout << "Positive"; else cout << "Negative"; }
#include <bits/stdc++.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { int a, b; cin >> a >> b; if (a == 0) cout << "Zero"; else if (a < 0 && b >= 0) cout << "Zero"; else if (a > 0 || (b - a) % 2 == 1) cout << "Positive"; else cout <...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17...
1
82
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<string, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_std...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define all(x) (x).begin(), (x).end() #define endl "\n" using ll = long long; using P = pair<int, int>; using mp = map<string, int>; const int MOD = 1e9 + 7; const int INF = 1001001001; int main() { ios_base::sync_with_std...
[["+", 0, 9, 0, 57, 15, 339, 51, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 57, 15, 339, 51, 23, 0, 16, 17, 98], ["+", 15, 339, 51, 23, 0, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 23, 0, 16, 12, 16, 17, 18], ["+", 15, 339, 51, 23, 0, 16, 12, 16, 12, 13]...
1
175
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { long long a, b; cin >> a >> b; if (a <= 0 && 0 <= b) { cout << "Zero" << endl; } else if (0 < a) { cout << "Positive" << endl; } else { if ((a - b) % 2 == 1) { cout << "Positive" <<...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { long long a, b; cin >> a >> b; if (a * b <= 0) { cout << "Zero" << endl; } else if (a > 0) { cout << "Positive" << endl; } else if ((abs(a - b)) % 2 == 1) { cout << "Positive" << endl; ...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 3...
1
106
/// In The Name Of God #include <bits/stdc++.h> #define f first #define s second #define pb push_back #define pp pop_back #define mp make_pair #define sz(x) (int)x.size() #define sqr(x) ((x)*1ll * (x)) #define all(x) x.begin(), x.end() #define rep(i, l, r) for (int i = (l); i <= (r); i++) #define per(i, l, r) for ...
/// In The Name Of God #include <bits/stdc++.h> #define f first #define s second #define pb push_back #define pp pop_back #define mp make_pair #define sz(x) (int)x.size() #define sqr(x) ((x)*1ll * (x)) #define all(x) x.begin(), x.end() #define rep(i, l, r) for (int i = (l); i <= (r); i++) #define per(i, l, r) for ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 34, 31, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 34, 31, 16, 17, 151], ["+", 64, 1, 0, 34, 31, 16, 12, 5, 0, 62], ["+", 64,...
1
263
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(V) (V).begin(), (V).end() #define SORT(V) sort(ALL(V)) //小さい方からソート #define REV(V) reverse(ALL(V)) //リバース #define RSORT(V) ...
#pragma gcc optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(V) (V).begin(), (V).end() #define SORT(V) sort(ALL(V)) //小さい方からソート #define REV(V) reverse(ALL(V)) //リバース #define RSORT(V) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 8, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 1, ...
1
603
#include <bits/stdc++.h> using namespace std; long long a, b; int main() { scanf("%lld%lld", &a, &b); if (a > b) swap(a, b); if (a <= 0 && 0 <= b) printf("Zero"); if (0 < a && 0 < b) printf("Positive"); a = b - a; if (a & 1) printf("Positive"); else printf("Negative"); }
#include <bits/stdc++.h> using namespace std; long long a, b; int main() { scanf("%lld%lld", &a, &b); if (a > b) swap(a, b); if (a <= 0 && 0 <= b) { printf("Zero"); return 0; } if (0 < a && 0 < b) { printf("Positive"); return 0; } a = b - a; if (a & 1) printf("Positive"); else ...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 35], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
105
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)n; i++) #define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++) #define all(x) x.begin(), x.end() #define MOD 1000000007 // 1e9+7 using namespace std; typedef long long ll; typedef vector<bool> vecbool; typedef vector<int> vecint; t...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)n; i++) #define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++) #define all(x) x.begin(), x.end() #define MOD 1000000007 // 1e9+7 using namespace std; typedef long long ll; typedef vector<bool> vecbool; typedef vector<int> vecint; t...
[["+", 15, 339, 51, 16, 31, 16, 31, 2, 63, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 21], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+"...
1
199
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<double> vd; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int, int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pi...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<double> vd; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int, int> pii; typedef pair<double, double> pdd; typedef pair<ll, ll> pll; typedef vector<pi...
[["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", ...
1
578
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; bool sign = true; // Positive if (a < 0) { sign = sign != ((-a) % 2); } if (b + 1 < 0) { sign = sign != ((-b) % 2); } if (a <= 0 && b >= 0) { cout << "Zero" << endl; } else if (sign) { cout << "Positive" ...
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; bool sign = true; // Positive if (a < 0) { sign = sign != ((-a) % 2 == 1); } if (b + 1 < 0) { sign = sign != ((-(b + 1)) % 2 == 1); } if (a <= 0 && b >= 0) { cout << "Zero" << endl; } else if (sign) { cou...
[["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 60], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 13], ["+", 31, 16, 31, 23, 0, 91, 28, 23, 0, 24], ["+", 31, 23, 0, 91, 28, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 91, 28, 23, 0, 16, 12, 13], ["+", 12, 23, 0, 16, 31, 16, 31, 23, 0, 25]]
1
119
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> #pragma region Macros #define int long long #define double long double constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; #defin...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <string> #include <vector> #pragma region Macros #define int long long #define double long double constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; #defin...
[["+", 0, 16, 12, 16, 31, 16, 31, 2, 63, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 2, 63, 22], ["-", 51, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["-", 51, 16, 31, 23, 0, 16, 31, 16, 17, 60], ["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 106], ["-", 51, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["-", 51, 16, 31, 23, 0, 16, 12, 16, 17, 60]...
1
524
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a > 0 && b > 0) cout << "Positive" << endl; else if (a < 0 && b < 0) { if (b - a % 2 == 0) cout << "Negative" << endl; else cout << "Positive" << endl; } else cout << "Zero" << endl; return 0...
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a > 0 && b > 0) cout << "Positive" << endl; else if (a < 0 && b < 0) { if (b == a) cout << "Positive" << endl; else if ((b - a) % 2 == 0) cout << "Negative" << endl; else cout << "Positive" ...
[["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 17, 151], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64,...
1
93
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define ll long long #define vi vector<int> #define pi pair<int, int> #define pb push_back #define ppb pop_back #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tu...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define ll long long #define vi vector<int> #define pi pair<int, int> #define pb push_back #define ppb pop_back #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tu...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60...
1
212
a, b = map(int, input().split()) if a < 0 and b > 0: print("Zero") elif a > 0: print("Positive") elif b < 0 and a < 0: if abs(a) + abs(b) % 2 == 0: print("Negative") else: print("Positive")
a, b = map(int, input().split()) if a < 0 and b > 0: print("Zero") elif a > 0: print("Positive") elif b < 0 and a < 0: if (b - a + 1) % 2 != 0: print("Negative") else: print("Positive")
[["-", 0, 57, 15, 666, 0, 657, 31, 652, 63, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 31, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 33], ["-", 15, 666, 0, 657, 31, 652, 3, 4, 0, 25], ["-", 15, 666, 0, 657, 12, 657, 31, 652, 63, 22], ["-", 0, 657, 12, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 657, 12, 657, 31, 652, 3...
5
80
a,b = map(int,input().split()) if a > 0: print("Positive") elif (a == 0) or (a < 0 and b >= 0): print("Zero") else: if (b - a) % 2 == 0: print("NEgative") else: print("Positive")
a,b = map(int,input().split()) if a > 0: print("Positive") elif (a <= 0 and b >= 0): print("Zero") else: if (b - a) % 2 == 0: print("Negative") else: print("Positive")
[["-", 75, 665, 15, 679, 31, 23, 0, 666, 667, 60], ["-", 75, 665, 15, 679, 31, 23, 0, 666, 0, 612], ["-", 0, 57, 75, 665, 15, 679, 31, 23, 0, 25], ["-", 0, 656, 0, 57, 75, 665, 15, 679, 17, 354], ["-", 0, 57, 75, 665, 15, 679, 12, 23, 0, 24], ["-", 15, 679, 12, 23, 0, 679, 31, 666, 0, 22], ["-", 15, 679, 12, 23, 0, 679...
5
77