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> int main() { using namespace std; unsigned long N; cin >> N; unsigned long ans{0}; for (unsigned long i{0}, a; i < N; ++i) { cin >> a; ans += i & a & 1; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N; cin >> N; unsigned long ans{0}; for (unsigned long i{0}, a; i < N; ++i) { cin >> a; ans += ~i & a & 1; } cout << ans << endl; return 0; }
[["+", 0, 11, 12, 16, 31, 16, 31, 91, 17, 92]]
1
68
n,*A=$<.read.split.map &:to_i p n.times.count{|i|i%2==1&&A[i]%2==1}
n,*A=$<.read.split.map &:to_i p n.times.count{|i|i%2==0&&A[i]%2==1}
[["-", 196, 196, 8, 734, 0, 738, 31, 738, 12, 612], ["+", 196, 196, 8, 734, 0, 738, 31, 738, 12, 612]]
4
39
import sys from collections import defaultdict, deque, Counter import math # import copy from bisect import bisect_left, bisect_right # import heapq # sys.setrecursionlimit(1000000) # input aliases input = sys.stdin.readline getS = lambda: input().strip() getN = lambda: int(input()) getList = lambda: list(map(int, ...
import sys from collections import defaultdict, deque, Counter import math # import copy from bisect import bisect_left, bisect_right # import heapq # sys.setrecursionlimit(1000000) # input aliases input = sys.stdin.readline getS = lambda: input().strip() getN = lambda: int(input()) getList = lambda: list(map(int, ...
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612]]
5
466
import sys, io, os, re from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right from pprint import pprint from math import sin, cos, pi, radians, sqrt, floor, ceil from copy import copy, deepcopy from collections import deque from math import gcd from functools import reduce from itertool...
import sys, io, os, re from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right from pprint import pprint from math import sin, cos, pi, radians, sqrt, floor, ceil from copy import copy, deepcopy from collections import deque from math import gcd from functools import reduce from itertool...
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612]]
5
471
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int ans = 0; rep(i, n) { int a; cin >> a; if (i % 2 == 1 && a % 2 == 1) { ans++; } } cout << ans << endl; re...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int ans = 0; rep(i, n) { int a; cin >> a; if (i % 2 == 0 && a % 2 == 1) { ans++; } } cout << ans << endl; re...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
91
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, from, to) for (int i = from; i < (to); ++i) #define mp(x, y) make_pair(x, y) #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() using ll = long long; using vin = vector<int>; using vll = vector<ll>; using P = pair<int, ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, from, to) for (int i = from; i < (to); ++i) #define mp(x, y) make_pair(x, y) #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() using ll = long long; using vin = vector<int>; using vll = vector<ll>; using P = pair<int, ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
213
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 0; i < n; ++i) { int x; cin >> x; if (i % 2 == 1 and x % 2 == 1) { ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 0; i < n; ++i) { int x; cin >> x; if ((i + 1) % 2 == 1 and x % 2 == 1) { ans++; } } cout << ans << endl; }
[["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]]
1
77
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> a(N); int ans = 0; for (int i = 0; i < N; i++) { cin >> a[i]; if (i % 2 == 1 && a[i] % 2 == 1) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int N; cin >> N; vector<int> a(N); int ans = 0; for (int i = 0; i < N; i++) { cin >> a[i]; if ((i + 1) % 2 == 1 && a[i] % 2 == 1) ans++; } cout << ans << endl; return 0; }
[["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]]
1
86
// यथा चतुर्भिः कनकं परीक्ष्यते निघर्षणच्छेदनतापताडनैः। // तथा चतुर्भिः पुरुषः परीक्ष्यते त्यागेन शीलेन गुणेन कर्मणा॥ #include <bits/stdc++.h> using namespace std; #define lld long long int #define M 1000000007 #define fors(i, n) for (int i = 0; i < n; ++i) #define fore(i, a, b) for (int i = a; i <= b; ++i) #define fas...
// यथा चतुर्भिः कनकं परीक्ष्यते निघर्षणच्छेदनतापताडनैः। // तथा चतुर्भिः पुरुषः परीक्ष्यते त्यागेन शीलेन गुणेन कर्मणा॥ #include <bits/stdc++.h> using namespace std; #define lld long long int #define M 1000000007 #define fors(i, n) for (int i = 0; i < n; ++i) #define fore(i, a, b) for (int i = a; i <= b; ++i) #define fas...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
598
#include <deque> #include <iostream> #include <list> #include <random> #include <set> #include <unordered_map> #include <vector> using namespace std; using ll = long long; const int BIG = 100000007; int main() { ll n; cin >> n; ll cnt = 0; for (ll i = 0; i < n; ++i) { ll a; cin >> a; if (i % 2 == ...
#include <deque> #include <iostream> #include <list> #include <random> #include <set> #include <unordered_map> #include <vector> using namespace std; using ll = long long; const int BIG = 100000007; int main() { ll n; cin >> n; ll cnt = 0; for (ll i = 0; i < n; ++i) { ll a; cin >> a; if (i % 2 == ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
94
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools from collections import deque sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 DR = [1, -1, 0, 0] DC = [0, 0, 1, -1] def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(...
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools from collections import deque sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 DR = [1, -1, 0, 0] DC = [0, 0, 1, -1] def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(...
[["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 24], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 25]]
5
265
#include <bits/stdc++.h> using namespace std; typedef long long int lld; typedef pair<int, int> pi; typedef pair<lld, lld> pl; typedef vector<int> vit; typedef vector<vit> vitt; typedef vector<lld> vlt; typedef vector<vlt> vltt; typedef vector<pi> vpit; typedef vector<vpit> vpitt; typedef long double ld; #define x firs...
#include <bits/stdc++.h> using namespace std; typedef long long int lld; typedef pair<int, int> pi; typedef pair<lld, lld> pl; typedef vector<int> vit; typedef vector<vit> vitt; typedef vector<lld> vlt; typedef vector<vlt> vltt; typedef vector<pi> vpit; typedef vector<vpit> vpitt; typedef long double ld; #define x firs...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
299
n=int(input()) a=list(map(int,input().split())) ans=0 for i in range(n): if i%2==1: if a[i]%2==1: ans+=1 print(ans)
n=int(input()) a=list(map(int,input().split())) ans=0 for i in range(n): if i%2==0: if a[i]%2==1: ans+=1 print(ans)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
60
#include <bits/stdc++.h> using namespace std; #define SELECTER(_1, _2, _3, SELECT, ...) SELECT #define REP1(i, n) for (int i = 0; (i) < (n); (i)++) #define REP2(i, a, b) for (int i = (a); (i) < (b); (i)++) #define REP(...) SELECTER(__VA_ARGS__, REP2, REP1, )(__VA_ARGS__) #define MOD 1'000'000'007 template <class T> os...
#include <bits/stdc++.h> using namespace std; #define SELECTER(_1, _2, _3, SELECT, ...) SELECT #define REP1(i, n) for (int i = 0; (i) < (n); (i)++) #define REP2(i, a, b) for (int i = (a); (i) < (b); (i)++) #define REP(...) SELECTER(__VA_ARGS__, REP2, REP1, )(__VA_ARGS__) #define MOD 1'000'000'007 template <class T> os...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
256
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define all(x) (x).begin(), (x).end() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define all(x) (x).begin(), (x).end() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
194
import sys from math import ceil, floor, sqrt, sin, cos, pi from itertools import accumulate, permutations, combinations from math import gcd # 最大公約数 from collections import deque, Counter from operator import itemgetter from heapq import heappop,heappush sys.setrecursionlimit(10**7) def lcm(x, y): return ((x * y) // g...
import sys from math import ceil, floor, sqrt, sin, cos, pi from itertools import accumulate, permutations, combinations from math import gcd # 最大公約数 from collections import deque, Counter from operator import itemgetter from heapq import heappop,heappush sys.setrecursionlimit(10**7) def lcm(x, y): return ((x * y) // g...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
138
#include <bits/stdc++.h> using namespace std; using pll = pair<long long, long long>; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i]; int ans = 0; for (int i = 0; i < N; i++) { if (i % 2 == 1 && a[i] % 2 == 1) ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; using pll = pair<long long, long long>; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i]; int ans = 0; for (int i = 0; i < N; i++) { if (i % 2 == 0 && a[i] % 2 == 1) ans++; } cout << ans << endl; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
108
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() using namespace std; using ll = long long...
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() using namespace std; using ll = long long...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
212
#include <bits/stdc++.h> using namespace std; using ll = int64_t; #define rep(i, n) for (int i = 0; i < ((int)(n)); i++) // 0-indexed昇順 int main() { int N; cin >> N; int cnt = 0; rep(i, N) { int a; cin >> a; if (i % 2 == 1 && a % 2 == 1) cnt++; } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; using ll = int64_t; #define rep(i, n) for (int i = 0; i < ((int)(n)); i++) // 0-indexed昇順 int main() { int N; cin >> N; int cnt = 0; rep(i, N) { int a; cin >> a; if ((i + 1) % 2 == 1 && a % 2 == 1) cnt++; } cout << cnt << endl; }
[["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]]
1
75
import sys def input(): return sys.stdin.readline().strip() def I(): return int(input()) def LI(): return list(map(int, input().split())) def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def S(): return input() def LS(): return input().spl...
import sys def input(): return sys.stdin.readline().strip() def I(): return int(input()) def LI(): return list(map(int, input().split())) def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def S(): return input() def LS(): return input().spl...
[["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 24], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 25]]
5
182
#include "bits/stdc++.h" #define REP(i, num) for (ll i = 0; i < (num); ++i) #define FOR(i, c, num) for (ll(i) = (c); (i) < (num); ++(i)) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c...
#include "bits/stdc++.h" #define REP(i, num) for (ll i = 0; i < (num); ++i) #define FOR(i, c, num) for (ll(i) = (c); (i) < (num); ++(i)) #define LOOP(i) while (i--) #define ALL(c) c.begin(), c.end() #define PRINTALL(c) \ for (auto pitr = c.begin(); pitr != c...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
424
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int answer = 0; for (int i = 0; i < N; i++) { int A; cin >> A; if (i % 2 == 1 && A % 2 == 1) answer++; } cout << answer << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int answer = 0; for (int i = 1; i <= N; i++) { int A; cin >> A; if (i % 2 == 1 && A % 2 == 1) answer++; } cout << answer << endl; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
73
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define bug(x) cout << "zdongdebug1: " << x << endl; #define bug2(x, y) co...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
156
#include <bits/stdc++.h> using namespace std; #define all(n) begin(n), end(n) const long long INF = numeric_limits<long long>::max(); typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef unsigned long long ull; template <clas...
#include <bits/stdc++.h> using namespace std; #define all(n) begin(n), end(n) const long long INF = numeric_limits<long long>::max(); typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef unsigned long long ull; template <clas...
[["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]]
1
383
#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, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
176
ans=0 n=int(input()) for i,v in enumerate(list(map(int,input().split()))): if i%2 and v%2:ans+=1 print(ans)
ans=0 n=int(input()) for i,v in enumerate(list(map(int,input().split()))): if i%2==0 and v%2:ans+=1 print(ans)
[["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 612]]
5
51
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> #define SPBR(w, n) std::cout << (w + 1 == n ...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> #define SPBR(w, n) std::cout << (w + 1 == n ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
349
import java.io.*; import java.util.*; public class Main { private static FastReader in = new FastReader(System.in); private static PrintWriter out = new PrintWriter(System.out); private static final long MOD = (long)1e9 + 7; public static void main(String[] args) { solve(); out.flush(); } priva...
import java.io.*; import java.util.*; public class Main { private static FastReader in = new FastReader(System.in); private static PrintWriter out = new PrintWriter(System.out); private static final long MOD = (long)1e9 + 7; public static void main(String[] args) { solve(); out.flush(); } priva...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499]]
3
432
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.Scanner; class Main { stat...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.Scanner; class Main { stat...
[["-", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499]]
3
220
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 # import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 # MOD = 998244353 ...
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 # import numpy as np sys.setrecursionlimit(10000001) INF = 10 ** 16 MOD = 10 ** 9 + 7 # MOD = 998244353 ...
[["+", 0, 57, 15, 679, 31, 657, 31, 23, 0, 24], ["+", 15, 679, 31, 657, 31, 23, 0, 657, 17, 72], ["+", 15, 679, 31, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 57, 15, 679, 31, 657, 31, 23, 0, 25]]
5
155
/* vrrtll==???>;::::~~~~~~......`.`````````````````````...-?777!_.._?7u,~~~::::;>>??=lllttrrzu rtll==??>>;::::~~~~......`.`````````````````` ..J77!`````````...`..._T,~~~~:::;;>??==lttrrv tll=??>>;:::~~~~......``````````````````..J7^ ` `` ` `` .,```````...._4,.~~~::;;>>?===lttr l=???>;;::~~~......`````HTSu,.`` `..J7! ...
/* vrrtll==???>;::::~~~~~~......`.`````````````````````...-?777!_.._?7u,~~~::::;>>??=lllttrrzu rtll==??>>;::::~~~~......`.`````````````````` ..J77!`````````...`..._T,~~~~:::;;>??==lttrrv tll=??>>;:::~~~~......``````````````````..J7^ ` `` ` `` .,```````...._4,.~~~::;;>>?===lttr l=???>;;::~~~......`````HTSu,.`` `..J7! ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
974
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; // cout << setprecision(20) << int main() { ll N; cin >> N; vector<int> v(N + 1); ll count = 0; for (int i = 1; i <= N; ++i) { cin >> v[i]; if (v[i] % 2 == 1 && i % 2 == 0) count++; } cout << cou...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; // cout << setprecision(20) << int main() { ll N; cin >> N; vector<int> v(N + 1); ll count = 0; for (int i = 1; i <= N; ++i) { cin >> v[i]; if (v[i] % 2 == 1 && i % 2 == 1) count++; } cout << cou...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
96
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define debug(x) cerr << #x << ": " << (x) << endl #define INF (int)1e9 #define EPS (double)1e-9 #define MOD ((int)1e9 + 7) using namespace std; typedef long long llong; typedef vector<int> vi; typedef vector<...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define debug(x) cerr << #x << ": " << (x) << endl #define INF (int)1e9 #define EPS (double)1e-9 #define MOD ((int)1e9 + 7) using namespace std; typedef long long llong; typedef vector<int> vi; typedef vector<...
[["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 25]]
1
172
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String str[] =...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String str[] =...
[["+", 15, 15, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 499], ["+", 15, 15, 0, 16, 31, 16, 31, 23, 0, 25]]
3
153
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; constexpr char ln = '\n'; constexpr long long MOD = 1000000007LL; constexpr long long INF = 1001001001LL; constexpr long long LINF = 1001001001001001001; ...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; constexpr char ln = '\n'; constexpr long long MOD = 1000000007LL; constexpr long long INF = 1001001001LL; constexpr long long LINF = 1001001001001001001; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
236
/* vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう だけど面倒 vfillの範囲指定をできるようにしたい */ //#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") ////Optimization flags #pragma GCC //option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC //target("avx") //Enable AVX #pragma GCC optimize("Ofast") ...
/* vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう だけど面倒 vfillの範囲指定をできるようにしたい */ //#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") ////Optimization flags #pragma GCC //option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC //target("avx") //Enable AVX #pragma GCC optimize("Ofast") ...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
2,875
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int n, ans = 0; cin >> n; REP(i, n) { int tmp; cin >> tmp; if (i % 2) { if (tmp % 2) ans++; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int n, ans = 0; cin >> n; REP(i, n) { int tmp; cin >> tmp; if (!(i % 2)) { if (tmp % 2) ans++; } } cout << ans; }
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 25]]
1
72
N = int(input()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if i % 2 == 0: continue if A[i] % 2 == 1: cnt += 1 print(cnt)
N = int(input()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if i % 2 == 1: continue if A[i] % 2 == 1: cnt += 1 print(cnt)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
61
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef pair<ll, ll> P; typedef vector<P> vp; typedef vector<string> vs; typedef vector<bool> vb; const ll mod = 1e9 + 7; const ll inf = 1e16; #define rep(i, m, n) for (ll i = m; i < n; i++) #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef pair<ll, ll> P; typedef vector<P> vp; typedef vector<string> vs; typedef vector<bool> vb; const ll mod = 1e9 + 7; const ll inf = 1e16; #define rep(i, m, n) for (ll i = m; i < n; i++) #define...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
243
import sys input = sys.stdin.readline N = int(input()) A = [int(_) for _ in input().split()] answer = 0 for i, el in enumerate(A): if i & 1 and el & 1: answer += 1 print(answer)
import sys input = sys.stdin.readline N = int(input()) A = [int(_) for _ in input().split()] answer = 0 for i, el in enumerate(A): if not(i & 1) and el & 1: answer += 1 print(answer)
[["+", 8, 196, 0, 57, 15, 679, 31, 681, 0, 372], ["+", 0, 57, 15, 679, 31, 681, 28, 23, 0, 24], ["+", 0, 57, 15, 679, 31, 681, 28, 23, 0, 25]]
5
64
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define maxs(a, b) a = max(a, b) #define mins(a, b) a = min(a, b) using namespace std; typedef long long ll; typedef pa...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define maxs(a, b) a = max(a, b) #define mins(a, b) a = min(a, b) using namespace std; typedef long long ll; typedef pa...
[["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 25]]
1
182
#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 <bitset> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #in...
#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 <bitset> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #in...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
451
#include <bits/stdc++.h> using namespace std; // Define using ll = long long; using ull = unsigned long long; using ld = long double; template <class T> using pvector = vector<pair<T, T>>; template <class T> using rpriority_queue = priority_queue<T, vector<T>, greater<T>>; constexpr const ll dx[4] = {1, 0, -1, 0}; con...
#include <bits/stdc++.h> using namespace std; // Define using ll = long long; using ull = unsigned long long; using ld = long double; template <class T> using pvector = vector<pair<T, T>>; template <class T> using rpriority_queue = priority_queue<T, vector<T>, greater<T>>; constexpr const ll dx[4] = {1, 0, -1, 0}; con...
[["+", 12, 11, 12, 23, 0, 16, 31, 91, 17, 111], ["+", 12, 23, 0, 16, 31, 91, 28, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 91, 28, 23, 0, 25]]
1
717
def main(): n = int(input()) A=[int(i) for i in input().split()] res = 0 for i in range(1,n,2): if(A[i]%2==1): res+=1 print(res) if __name__ == '__main__': main()
def main(): n = int(input()) A=[int(i) for i in input().split()] res = 0 for i in range(0,n,2): if(A[i]%2==1): res+=1 print(res) if __name__ == '__main__': main()
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
75
#include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <tuple> #include <v...
#include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <tuple> #include <v...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
1,035
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue #import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i ...
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue #import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i ...
[["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 24], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 666, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 15, 679, 31, 666, 0, 657, 31, 23, 0, 25]]
5
555
#include <bits/stdc++.h> using namespace std; typedef long long ll; constexpr int Inf = 1000000010; constexpr ll INF = 1000000000000000000; constexpr ll MOD = 1000000007; const double PI = 3.1415926535897; typedef pair<int, int> P; template <typename T> T Pow(T a, T b) { T ret = 1; for (int i = 0; i < b; i++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; constexpr int Inf = 1000000010; constexpr ll INF = 1000000000000000000; constexpr ll MOD = 1000000007; const double PI = 3.1415926535897; typedef pair<int, int> P; template <typename T> T Pow(T a, T b) { T ret = 1; for (int i = 0; i < b; i++) { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
297
#include <bits/stdc++.h> using namespace std; const int N = 5e4 + 10; int n, ans[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int f = 0; f += x * x + y * ...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n, ans[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int f = 0; f += x * x + y * ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
170
from math import sqrt, floor N = int(input()) d = [0] * (N+1) k = floor(sqrt(N)) for x in range(1, k): for y in range(1, k): for z in range(1, k): c = x*x + y*y + z*z + x*y + y*z + z*x if 1 <= c <= N: d[c] += 1 for i in range(1, N): print(d[i])
from math import sqrt, floor N = int(input()) d = [0] * (N+1) k = floor(sqrt(N)) for x in range(1, k): for y in range(1, k): for z in range(1, k): c = x*x + y*y + z*z + x*y + y*z + z*x if 1 <= c <= N: d[c] += 1 for i in range(1, N+1): print(d[i])
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
119
import sys read = sys.stdin.read readlines = sys.stdin.readlines from collections import defaultdict def main(): n = int(input()) if n == 1: print(0) sys.exit() r = defaultdict(int) for i1 in range(1,33): for i2 in range(1,33): for i3 in range(1,33): t...
import sys read = sys.stdin.read readlines = sys.stdin.readlines from collections import defaultdict def main(): n = int(input()) if n == 1: print(0) sys.exit() r = defaultdict(int) for i1 in range(1,101): for i2 in range(1,101): for i3 in range(1,101): ...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
161
N = int(input()) ans = [0]*(N+1) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): n = pow(x,2) + pow(y,2) + pow(z,2) + x*y + y*z + z*x if n <= N: ans[n] += 1 for i in range(1,N): print(ans[i])
N = int(input()) ans = [0]*(N+1) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): n = pow(x,2) + pow(y,2) + pow(z,2) + x*y + y*z + z*x if n <= N: ans[n] += 1 for i in range(1,N+1): print(ans[i])
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
111
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, a[10010] = {0}, x, y, z; scanf("%d", &n); for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { k = x * x + y * y + z * z + x * y + x * z + y * z; if (k < 1005) a[k]++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k, a[10010] = {0}, x, y, z; scanf("%d", &n); for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { k = x * x + y * y + z * z + x * y + x * z + y * z; if (k <= 10000) a[k]++; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
159
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vec(2000, 0); for (int i = 1; i <= 15; ++i) { for (int j = 1; j <= 15; ++j) { for (int k = 1; k <= 15; ++k) { vec[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <= ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vec(100000, 0); for (int i = 1; i <= 99; ++i) { for (int j = 1; j <= 99; ++j) { for (int k = 1; k <= 99; ++k) { vec[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
131
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define endl "\n" #define goat() \ ios_base::sync_with_stdio(0); \ cout.tie(0); ...
#include <bits/stdc++.h> #include <unordered_map> using namespace std; #define endl "\n" #define goat() \ ios_base::sync_with_stdio(0); \ cout.tie(0); ...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
175
#include <iostream> #include <map> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int N; map<int, int> mp; int calc(int x, int y, int z) { int res = x * x + y * y + z * z + x * y + y * z + z * x; return res; } int main() { cin >> N; //初期化 for (int i = 1; i < 45; i++) { for (int j...
#include <iostream> #include <map> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int N; map<int, int> mp; int calc(int x, int y, int z) { int res = x * x + y * y + z * z + x * y + y * z + z * x; return res; } int main() { cin >> N; //初期化 for (int i = 1; i <= 100; i++) { for (int...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15, ...
1
173
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long u...
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long u...
[["-", 63, 118, 28, 69, 341, 342, 0, 16, 12, 22], ["+", 63, 118, 28, 69, 341, 342, 0, 16, 12, 13]]
1
1,102
#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 using ll = long long; const ll mod = 1e9 + 7; const int maxn = 1e6 + 5; const ll inf = 1e18; using pt = pair<pair<ll, ll>, char>; int n; ll x[...
#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 using ll = long long; const ll mod = 1e9 + 7; const int maxn = 1e6 + 5; const ll inf = 1e18; using pt = pair<pair<ll, ll>, char>; int n; ll x[...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
1,348
#include <bits/stdc++.h> #pragma GCC optimize(2) #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define X first #define Y second #defin...
#include <bits/stdc++.h> #pragma GCC optimize(2) #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> #define X first #define Y second #defin...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
1,625
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb emplace_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #defi...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb emplace_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #defi...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 91, 17, 111], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["-", 0, 16, 31, 16, 31, 23, 0, 91, 17, 111], ["-", 51, 16, 12, 23, 0, 16, 31, 16, 17, 98], ["+", 0, 16, 31, 16, 31, 74, 51, 66, 17, 67], ["+", 31, 16, 31, 74, 51, 66, 28, 66, 17, 67]...
1
1,756
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #inc...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #inc...
[["-", 8, 9, 0, 43, 49, 50, 49, 352, 0, 67], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
1
655
/* vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう だけど面倒 vfillの範囲指定をできるようにしたい */ //#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") ////Optimization flags #pragma GCC //option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC //target("avx") //Enable AVX #pragma GCC optimize("Ofast") ...
/* vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう だけど面倒 vfillの範囲指定をできるようにしたい */ //#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") ////Optimization flags #pragma GCC //option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC //target("avx") //Enable AVX #pragma GCC optimize("Ofast") ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
3,482
from collections import defaultdict from bisect import * def solve(): ans = float('inf') N = int(input()) L_y = defaultdict(lambda: [-float('inf'),float('inf')]) R_y = defaultdict(lambda: [-float('inf'),float('inf')]) U_x = defaultdict(lambda: [-float('inf'),float('inf')]) D_x = defaultdict(lambda: [-float(...
from collections import defaultdict from bisect import * def solve(): ans = float('inf') N = int(input()) L_y = defaultdict(lambda: [-float('inf'),float('inf')]) R_y = defaultdict(lambda: [-float('inf'),float('inf')]) U_x = defaultdict(lambda: [-float('inf'),float('inf')]) D_x = defaultdict(lambda: [-float(...
[["+", 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, 206, 0, 73], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 662, 12, 657, 12, 206, 206, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 206, 0, 73]]
5
843
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; int n; vector<vector<long long>> points; void rotate() { for (auto &p : points) { int nx = p[1]; int ny = 202020 - p[0]; p[0] = nx; p[1] = ny; p[2]++; p[2] %= 4; } } signed main() { ios::sync_with_stdio(false); cin.t...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; int n; vector<vector<long long>> points; void rotate() { for (auto &p : points) { int nx = p[1]; int ny = 200005 - p[0]; p[0] = nx; p[1] = ny; p[2]++; p[2] %= 4; } } signed main() { ios::sync_with_stdio(false); cin.t...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13]]
1
580
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) using namespace std; typedef long long ll; typedef pair<ll, int> P; const ll INF = 1e18; ll base = 200005; int main() { ll n; cin >> n; vector<vector<ll>> U(400010); vector<vector<ll>> D(400010); vector<vector<ll>> L(400010); vector<vec...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) using namespace std; typedef long long ll; typedef pair<ll, int> P; const ll INF = 1e18; ll base = 200005; int main() { ll n; cin >> n; vector<vector<ll>> U(400010); vector<vector<ll>> D(400010); vector<vector<ll>> L(400010); vector<vec...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
1,487
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(x) (x).begin(), (x).end() const int N = 200200; const int MAXN = 600600; int ans = 59408656; int n; vector<int> on0[MAXN][4]; vector<int> on1[MAXN][4]; vector<int> on2[MAXN][4]; vector<int> on3[MAXN][4]; int Upd(vector<int> a, vector...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(x) (x).begin(), (x).end() const int N = 200200; const int MAXN = 600600; int ans = 59408656; int n; vector<int> on0[MAXN][4]; vector<int> on1[MAXN][4]; vector<int> on2[MAXN][4]; vector<int> on3[MAXN][4]; int Upd(vector<int> a, vector...
[["-", 28, 69, 28, 69, 341, 342, 0, 16, 12, 22], ["+", 28, 69, 28, 69, 341, 342, 0, 16, 12, 22]]
1
611
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; const int long long INF = 1e8; // 0:up, 1:right, 2:down, 3:left vector<pair<int, int>> direction(4); //距離を計算する int f(vector<pair<int, int>> vec) { sort(vec.begin(), vec...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; const int INF = 1e8; // 0:up, 1:right, 2:down, 3:left vector<pair<int, int>> direction(4); //距離を計算する int f(vector<pair<int, int>> vec) { sort(vec.begin(), vec.end()); ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["-", 0, 30, 0, 43, 49, 50, 0, 42, 0, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 85], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
632
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) \ { ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) \ { ...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22]]
1
876
import sys from collections import defaultdict def input(): return sys.stdin.readline().rstrip() def culc(li): li.sort(key=lambda x: x[0]) ans = 10**9 for i in range(len(li)-1): if li[i][1] == '+' and li[i+1][1] == '-': ans = min(ans, li[i+1][0]-li[i][0]) #print(ans,li) return ...
import sys from collections import defaultdict def input(): return sys.stdin.readline().rstrip() def culc(li): li.sort(key=lambda x: x[0]) ans = 10**9 for i in range(len(li)-1): if li[i][1] == '+' and li[i+1][1] == '-': ans = min(ans, li[i+1][0]-li[i][0]) return ans def main(): ...
[["-", 0, 652, 3, 4, 0, 634, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 634, 0, 557, 0, 6]]
5
637
from bisect import bisect_left from collections import defaultdict n = int(input()) xysame, upright, downright = {},{},{} u_list = ("U","R","D","L") for u in u_list: xysame[u] = defaultdict(list) upright[u] = defaultdict(list) downright[u] = defaultdict(list) for _ in range(n): x,y,u = input().split(...
from bisect import bisect_left from collections import defaultdict n = int(input()) xysame, upright, downright = {},{},{} u_list = ("U","R","D","L") for u in u_list: xysame[u] = defaultdict(list) upright[u] = defaultdict(list) downright[u] = defaultdict(list) for _ in range(n): x,y,u = input().split(...
[["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 60], ["-", 8, 196, 0, 57, 64, 196, 0, 1, 0, 22], ["+", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117]]
5
522
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <string> #include <vector> const int MOD = 1e9 + 7; const int...
[["-", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22], ["+", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22]]
1
1,136
import sys import collections sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): N = int(input()) XYU = [[x for x in input().split()] for _ in range(N)] ans = float("inf") c1 = collections.defaultdict(list) c2 = collections.defaultdict(list) for x, y, u in XYU: ...
import sys import collections sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): N = int(input()) XYU = [[x for x in input().split()] for _ in range(N)] ans = float("inf") c1 = collections.defaultdict(list) c2 = collections.defaultdict(list) for x, y, u in XYU: ...
[["-", 0, 656, 0, 14, 8, 196, 0, 7, 12, 22], ["+", 0, 656, 0, 14, 8, 196, 0, 7, 12, 22]]
5
1,379
import sys input = sys.stdin.readline du = {} dd = {} dr = {} dl = {} n = int(input()) p = {'U': {}, 'D': {}, 'R': {}, 'L': {}} m = {'U': {}, 'D': {}, 'R': {}, 'L': {}} for i in range(n): x, y, u = input().rstrip('\n').split() x = int(x) y = int(y) if x + y in p[u]: p[u][x+y].append(x) el...
import sys input = sys.stdin.readline du = {} dd = {} dr = {} dl = {} n = int(input()) p = {'U': {}, 'D': {}, 'R': {}, 'L': {}} m = {'U': {}, 'D': {}, 'R': {}, 'L': {}} for i in range(n): x, y, u = input().rstrip('\n').split() x = int(x) y = int(y) if x + y in p[u]: p[u][x+y].append(x) el...
[["-", 0, 57, 15, 666, 0, 657, 31, 657, 12, 612], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
1,147
/* このコード、と~おれ! Be accepted! ∧_∧  (。・ω・。)つ━☆・*。 ⊂   ノ    ・゜+.  しーJ   °。+ *´¨)          .· ´¸.·*´¨) ¸.·*¨)           (¸.·´ (¸.·'* ☆ */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <ioma...
/* このコード、と~おれ! Be accepted! ∧_∧  (。・ω・。)つ━☆・*。 ⊂   ノ    ・゜+.  しーJ   °。+ *´¨)          .· ´¸.·*´¨) ¸.·*¨)           (¸.·´ (¸.·'* ☆ */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <ioma...
[["+", 49, 53, 54, 55, 0, 56, 0, 153, 0, 154], ["+", 49, 53, 54, 55, 0, 56, 49, 352, 0, 67], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
1,244
/* このコード、と~おれ! Be accepted! ∧_∧  (。・ω・。)つ━☆・*。 ⊂   ノ    ・゜+.  しーJ   °。+ *´¨)          .· ´¸.·*´¨) ¸.·*¨)           (¸.·´ (¸.·'* ☆ */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <ioma...
/* このコード、と~おれ! Be accepted! ∧_∧  (。・ω・。)つ━☆・*。 ⊂   ノ    ・゜+.  しーJ   °。+ *´¨)          .· ´¸.·*´¨) ¸.·*¨)           (¸.·´ (¸.·'* ☆ */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <ioma...
[["-", 51, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 51, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["-", 51, 16, 31, 16, 12, 16, 12, 103, 0, 125], ["+", 51, 16, 31, 16, 12, 16, 12, 103, 0, 125]]
1
1,544
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) x.begin(), x.end() #define mod 1000000007 typedef long long ll; typedef struct point { ll x; ll y; char dis; } point; int main() { ll n; cin >> n; vector<point> vec; rep(i, n) { point p;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) x.begin(), x.end() #define mod 1000000007 typedef long long ll; typedef struct point { ll x; ll y; char dis; } point; int main() { ll n; cin >> n; vector<point> vec; rep(i, n) { point p;...
[["+", 28, 69, 341, 342, 0, 16, 31, 91, 17, 33]]
1
818
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<int, int> P; #define INF 1e9 struct POINT { int x, y; char u; POINT(int x, int y, char u) : x(x), y(y), u(u) {} }; int main(int, char **) { int n; cin >> n; vector<POINT> p; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair<int, int> P; #define INF 1e9 struct POINT { int x, y; char u; POINT(int x, int y, char u) : x(x), y(y), u(u) {} }; int main(int, char **) { int n; cin >> n; vector<POINT> p; ...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 33], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 72], ["-", 15, 339, 51, 16, 12, 16, 12, 16, 17, 33], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 17, 72]]
1
1,113
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template <class T> using p...
[["-", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22], ["+", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22], ["-", 64, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 64, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]...
1
5,031
U,R,D,L="URDL" d={i:[]for i in"URDL"} _,*a=map(str.split,open(0)) for*z,u in a:d[u]+=[*map(int,z)], N,P,M=9e9,"x+y,","x-y," for*F,S in(D,U,"x,y,"),(L,R,"y,x,"),(U,R,P+M),(L,D,P+M),(L,U,M+P),(D,R,M+P): n=p=-9e9 for x,y,r in sorted(eval(f"[({S}Q)for Q,P in enumerate(F)for x,y in d[P]]")): if r:n,p=x,y elif x==n:N=m...
U,R,D,L="URDL" d={i:[]for i in"URDL"} _,*a=map(str.split,open(0)) for*z,u in a:d[u]+=[*map(int,z)], N,P,M=9e9,"x+y,","x-y," for*F,S in(D,U,"x,y,"),(L,R,"y,x,"),(U,R,P+M),(L,D,P+M),(L,U,M+P),(D,R,M+P): n=p=-9e9 for x,y,r in sorted(eval(f"[({S}Q)for Q,P in enumerate(F)for x,y in d[P]]")): if r:n,p=x,y elif x==n:N=m...
[["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 48], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
218
#import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from math import gcd #input=sys.stdin.readline import bisect n=int(input()) arr=[list(input().split()) for _ in range(n)] yaxis={} xaxis={} s1axis={} s2...
#import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from math import gcd #input=sys.stdin.readline import bisect n=int(input()) arr=[list(input().split()) for _ in range(n)] yaxis={} xaxis={} s1axis={} s2...
[["-", 0, 57, 15, 679, 31, 666, 0, 557, 0, 6], ["+", 0, 57, 15, 679, 31, 666, 0, 557, 0, 6], ["-", 0, 57, 15, 679, 12, 666, 0, 557, 0, 6], ["+", 0, 57, 15, 679, 12, 666, 0, 557, 0, 6]]
5
1,004
n = int(input()) xx = [[] for _ in range(200001)] yy = [[] for _ in range(200001)] xy = [[] for _ in range(400001)] yx = [[] for _ in range(200001)] for _ in range(n): x, y, u = input().split() if u=='U' or u=='D': xx[int(x)].append((int(y), u)) else: yy[int(y)].append((int(x), u)) xy[in...
n = int(input()) xx = [[] for _ in range(200001)] yy = [[] for _ in range(200001)] xy = [[] for _ in range(400001)] yx = [[] for _ in range(200001)] for _ in range(n): x, y, u = input().split() if u=='U' or u=='D': xx[int(x)].append((int(y), u)) else: yy[int(y)].append((int(x), u)) xy[in...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
564
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 #define all(a) sort((a).begin(), (a).end()) //ソートのマクロ #define Re(a) reverse((a).begin(), (a).end()) #define YN(a) ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 #define all(a) sort((a).begin(), (a).end()) //ソートのマクロ #define Re(a) reverse((a).begin(), (a).end()) #define YN(a) ...
[["-", 12, 69, 28, 69, 341, 342, 0, 16, 17, 72], ["+", 12, 69, 28, 69, 341, 342, 0, 16, 17, 33]]
1
1,286
#include <bits/stdc++.h> using namespace std; #define NDEBUG #include <cassert> typedef long long ll; typedef long double Double; typedef unsigned long long ull; typedef pair<int, int> ii; typedef pair<ll, ll> llll; typedef pair<double, double> dd; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vec...
#include <bits/stdc++.h> using namespace std; #define NDEBUG #include <cassert> typedef long long ll; typedef long double Double; typedef unsigned long long ull; typedef pair<int, int> ii; typedef pair<ll, ll> llll; typedef pair<double, double> dd; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vec...
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]]
1
2,370
N=int(input()) XYU=[tuple(input().split()) for _ in range(N)] U=[] R=[] D=[] L=[] for x,y,u in XYU: x,y = int(x),int(y) if u=="U": U.append((x,y)) elif u=="D": D.append((x,y)) elif u=="L": L.append((x,y)) else: R.append((x,y)) r=10**9 def z(A): global r A.sort() n=p=-10**9 for k,c,a in A: if k!=n: ...
N=int(input()) W=[tuple(input().split()) for _ in range(N)] U=[] R=[] D=[] L=[] for x,y,u in W: x,y = int(x),int(y) if u=="U": U.append((x,y)) elif u=="D": D.append((x,y)) elif u=="L": L.append((x,y)) else: R.append((x,y)) r=10**9 def z(A): global r A.sort() n=p=-10**9 for k,c,a in A: if k!=n: if ...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 7, 12, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", ...
5
467
N=int(input()) XYU=[tuple(input().split()) for _ in range(N)] U=R=D=L=[] for x,y,u in XYU: x,y = int(x),int(y) if u=="U": U.append((x,y)) elif u=="D": D.append((x,y)) elif u=="L": L.append((x,y)) else: R.append((x,y)) ans=[10**9] def z(A): A.sort() n=p=-10**9 ...
N=int(input()) XYU=[tuple(input().split()) for _ in range(N)] U=[] R=[] D=[] L=[] for x,y,u in XYU: x,y = int(x),int(y) if u=="U": U.append((x,y)) elif u=="D": D.append((x,y)) elif u=="L": L.append((x,y)) else: R.append((x,y)) ans=[10**9] def z(A): A.sort() n=p=-10**9 for k,c,a in A: if k!=n: if a=...
[["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73]]
5
473
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < ll(n); i++) typedef pair<ll, ll> P; vector<P> rl[400400]; vector<P> ud[400400]; vector<P> lu[400400]; vector<P> ld[400400]; vector<P> ru[400400]; vector<P> rd[400400]; ll calc(vector<P> &vec) { ll ans = 1e18; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < ll(n); i++) typedef pair<ll, ll> P; vector<P> rl[400400]; vector<P> ud[400400]; vector<P> lu[400400]; vector<P> ld[400400]; vector<P> ru[400400]; vector<P> rd[400400]; ll calc(vector<P> &vec) { ll ans = 1e18; ...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 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, 17, 33]]
1
575
from collections import defaultdict n = int(input()) line = defaultdict(list) # R,L row = defaultdict(list) # U,D A = defaultdict(list) # U,R B = defaultdict(list) # L,D C = defaultdict(list) # U,L D = defaultdict(list) # R,D for i in range(n): x, y, u = input().split() x = int(x) y = int(y) if ...
from collections import defaultdict n = int(input()) line = defaultdict(list) # R,L row = defaultdict(list) # U,D A = defaultdict(list) # U,R B = defaultdict(list) # L,D C = defaultdict(list) # U,L D = defaultdict(list) # R,D for i in range(n): x, y, u = input().split() x = int(x) y = int(y) if ...
[["-", 0, 1, 0, 652, 63, 319, 500, 206, 51, 22], ["+", 0, 1, 0, 652, 63, 319, 500, 206, 51, 22], ["-", 3, 4, 0, 660, 0, 666, 0, 557, 0, 6], ["+", 3, 4, 0, 660, 0, 666, 0, 557, 0, 6]]
5
446
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 31, 22], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 22]]
1
953
#include <bits/stdc++.h> #define maxn 200086 using namespace std; int n; int x[maxn], y[maxn], d[maxn]; char s[10]; vector<pair<int, int>> v[maxn], V; int a[maxn * 2]; inline void rotate() { for (int i = 1; i <= n; i++) { int tmp = x[i]; x[i] = y[i], y[i] = 200000 - tmp; d[i] = (d[i] + 1) % 4; } } in...
#include <bits/stdc++.h> #define maxn 200086 using namespace std; int n; int x[maxn], y[maxn], d[maxn]; char s[10]; vector<pair<int, int>> v[maxn], V; int a[maxn * 2]; inline void rotate() { for (int i = 1; i <= n; i++) { int tmp = x[i]; x[i] = y[i], y[i] = 200000 - tmp; d[i] = (d[i] + 1) % 4; } } in...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
791
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; const int maxn = 200005; const int inf = 1000000007; int x[maxn], yy[maxn]; char c[maxn]; vector<pair<int, int>> vv1; vector<int> uu, rr, dd, ll; int cnt = 0; map<int, int> UL, UR, DL, DR, D, L; vector<int> ...
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; const int maxn = 200005; const int inf = 1000000007; int x[maxn], yy[maxn]; char c[maxn]; vector<pair<int, int>> vv1; vector<int> uu, rr, dd, ll; int cnt = 0; map<int, int> UL, UR, DL, DR, D, L; vector<int> ...
[["-", 0, 14, 8, 9, 0, 37, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 37, 0, 2, 63, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22]]
1
1,177
#十字で合流する場合 n=int(input()) ud=[[[],[]] for i in range(200001)] rl=[[[],[]] for i in range(200001)] from bisect import * cross=[[dict(),dict()] for i in range(4)] for i in range(n): x,y,u=input().split() x,y=int(x),int(y) if u=="U": ud[x][0].append(y) if x+y in cross[0][1]: cross[0...
#十字で合流する場合 n=int(input()) ud=[[[],[]] for i in range(200001)] rl=[[[],[]] for i in range(200001)] from bisect import * cross=[[dict(),dict()] for i in range(4)] for i in range(n): x,y,u=input().split() x,y=int(x),int(y) if u=="U": ud[x][0].append(y) if x+y in cross[0][1]: cross[0...
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24]]
5
1,022
import sys import math from collections import deque import heapq as hq sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 input = lambda: sys.stdin.readline().strip() NI = lambda: int(input()) NMI = lambda: map(int, input().split()) NLI = lambda: list(NMI()) SI = lambda: input() def make_grid(h, w, num): return [[int...
import sys import math from collections import deque import heapq as hq sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 input = lambda: sys.stdin.readline().strip() NI = lambda: int(input()) NMI = lambda: map(int, input().split()) NLI = lambda: list(NMI()) SI = lambda: input() def make_grid(h, w, num): return [[int...
[["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 20]]
5
765
import sys input=sys.stdin.readline N=int(input()) X1={} X2={} X={} Y={} for i in range(N): x,y,u=input().split() x=int(x) y=int(y) if x+y not in X1: X1[x+y]=[[x,u]] else: X1[x+y].append([x,u]) if y-x not in X2: X2[y-x]=[[x,u]] else: X2[y-x].append([x,u]) ...
import sys input=sys.stdin.readline N=int(input()) X1={} X2={} X={} Y={} for i in range(N): x,y,u=input().split() x=int(x) y=int(y) if x+y not in X1: X1[x+y]=[[x,u]] else: X1[x+y].append([x,u]) if y-x not in X2: X2[y-x]=[[x,u]] else: X2[y-x].append([x,u]) ...
[["-", 75, 665, 64, 196, 0, 57, 15, 666, 0, 22], ["+", 75, 665, 64, 196, 0, 57, 15, 666, 0, 22]]
5
570
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define rrep(i, n) RREP(i, n - 1, 0) #define all(v) v.begin(), v.end() ...
[["-", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22], ["+", 0, 1, 0, 2, 63, 118, 28, 69, 28, 22]]
1
973
#include <bits/stdc++.h> using namespace std; using i64 = long long; using u64 = unsigned long long; #define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i) #ifdef ENABLE_DEBUG template <typename T> void debug(T value) { cerr << value; } template <typename T, typename... Ts> void debug(T value, Ts... args) { cer...
#include <bits/stdc++.h> using namespace std; using i64 = long long; using u64 = unsigned long long; #define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i) #ifdef ENABLE_DEBUG template <typename T> void debug(T value) { cerr << value; } template <typename T, typename... Ts> void debug(T value, Ts... args) { cer...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
1,067
import java.util.Arrays; public class Main { private static void solve() { int n = ni(); int[][] p = new int[n][3]; for (int i = 0; i < n; i++) { p[i][0] = ni(); p[i][1] = ni(); p[i][2] = ns()[0]; } int ret = Integer.MAX_VALUE; int m = 200001; { Arrays.sort(p,...
import java.util.Arrays; public class Main { private static void solve() { int n = ni(); int[][] p = new int[n][3]; for (int i = 0; i < n; i++) { p[i][0] = ni(); p[i][1] = ni(); p[i][2] = ns()[0]; } int ret = Integer.MAX_VALUE; int m = 200001; { Arrays.sort(p,...
[["-", 64, 196, 0, 1, 0, 11, 31, 504, 516, 22], ["+", 64, 196, 0, 1, 0, 11, 31, 504, 516, 22]]
3
1,583
#include <bits/stdc++.h> using namespace std; using ll = long long int; using lc = complex<double>; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; vector<tuple<ll, ll, ll>> pls(n)...
#include <bits/stdc++.h> using namespace std; using ll = long long int; using lc = complex<double>; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; vector<tuple<ll, ll, ll>> pls(n)...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
1,272
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
7,417
from bisect import bisect from collections import defaultdict n = int(input()) up = [defaultdict(list), defaultdict(list), defaultdict(list)] dp = [defaultdict(list), defaultdict(list), defaultdict(list)] lp = [defaultdict(list), defaultdict(list), defaultdict(list)] rp = [defaultdict(list), defaultdict(list), default...
from bisect import bisect from collections import defaultdict n = int(input()) up = [defaultdict(list), defaultdict(list), defaultdict(list)] dp = [defaultdict(list), defaultdict(list), defaultdict(list)] lp = [defaultdict(list), defaultdict(list), defaultdict(list)] rp = [defaultdict(list), defaultdict(list), default...
[["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 48]]
5
483
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const INF int = 10000000 var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func next() string { sc.Scan() return sc.Text() } func nextInt() int { a, _ := strconv.Atoi(next()) return a } type Point struct { pos int d bo...
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const INF int = 10000000 var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func next() string { sc.Scan() return sc.Text() } func nextInt() int { a, _ := strconv.Atoi(next()) return a } type Point struct { pos int d bo...
[["-", 64, 196, 0, 1, 0, 2, 3, 4, 0, 147], ["+", 64, 196, 0, 1, 0, 2, 3, 4, 0, 146]]
7
947
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; // #include<boost/multiprecision/cpp_int.hpp> // na...
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; // #include<boost/multiprecision/cpp_int.hpp> // na...
[["+", 0, 57, 15, 339, 51, 16, 31, 91, 17, 92], ["-", 0, 57, 15, 339, 51, 16, 31, 91, 17, 92]]
1
2,652