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
change_count
int64
0
100
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; int main() { vector<pair<int, int>> vpii; int num, ans; char cm; while (cin >> num >> cm >> ans && num != 0 && ans != 0) { vpii.push_back(make_pair(ans, num)); } sort(vpii.begin(), vpii.end(), greater<pair<...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; int main() { vector<pair<int, int>> vpii; int num, ans; char cm; while (cin >> num >> cm >> ans && (num != 0 || ans != 0)) { vpii.push_back(make_pair(ans, num)); } sort(vpii.begin(), vpii.end(), greater<pai...
[["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106], ["+", 0, 52, 15, 339, 51, 16, 12, 23, 0, 25]]
1
220
4
#include <cmath> #include <iomanip> #include <iostream> #include <stdio.h> using namespace std; int main() { int p[100], Score[30] = {}; int n, s; int call, rank; while (scanf("%d,%d", &n, &s), n | s) { p[n - 1] = s; Score[s]++; } while (cin >> call) { rank = 1; for (int i = 29; i >= p[cal...
#include <cmath> #include <iomanip> #include <iostream> #include <stdio.h> using namespace std; int main() { int p[100], Score[30] = {}; int n, s; int call, rank; while (scanf("%d,%d", &n, &s), n | s) { p[n - 1] = s; Score[s - 1]++; } while (cin >> call) { rank = 0; for (int i = 29; i >= p...
[["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
132
6
score = [] until (t = gets.split(',').map(&:to_i))== [0,0] score << [t[0] , t[1], 0] end score.sort!{ |x, y| x[1] <=> y[1] }.reverse! score.length.times do |i| # p score if i == 0 score[i][2] = 1 else if score[i-1][1] == score[i][1] score[i][2] = score[i-1][2] else ...
score = [] until (t = gets.split(',').map(&:to_i))== [0,0] score << [t[0] , t[1], 0] end score.sort!{ |x, y| x[1] <=> y[1] }.reverse! score.length.times do |i| # p score if i == 0 score[i][2] = 1 else if score[i-1][1] == score[i][1] score[i][2] = score[i-1][2] else ...
[["-", 0, 652, 3, 4, 0, 742, 500, 742, 0, 70], ["+", 0, 652, 3, 4, 0, 742, 500, 652, 17, 131], ["+", 0, 652, 3, 4, 0, 742, 500, 652, 735, 22], ["+", 3, 4, 0, 742, 500, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 742, 500, 742, 0, 73], ["+", 3, 4, 0, 742, 500, 652, 3, 4, 0, 25]]
4
161
6
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0061 """ import sys def calc_rank(data): scores = {} # ?????????key, ???????????????id???????????????value??¨????????????????????? for id, point in data: if point in scores: scores[point]....
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0061 """ import sys def calc_rank(data): scores = {} # ?????????key, ???????????????id???????????????value??¨????????????????????? for id, point in data: if point in scores: scores[point]....
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 28, 612]]
5
255
3
def get_input(): while True: try: yield ''.join(input()) except EOFError: break teams = [0 for i in range(101)] points = [False for i in range(31)] while True: a,b = [int(i) for i in input().split(",")] if a == 0 and b == 0: break teams[a] = b points...
def get_input(): while True: try: yield ''.join(input()) except EOFError: break teams = [0 for i in range(101)] points = [False for i in range(31)] while True: a,b = [int(i) for i in input().split(",")] if a == 0 and b == 0: break teams[a] = b points...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612]]
5
165
3
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int[][] num; while ((line = br.readLine()) != null) { num = new int[10][10]; for (int i = 0; i < 10; i++) ...
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int[][] num; while ((line = br.readLine()) != null) { num = new int[10][10]; for (int i = 0; i < 10; i++) ...
[["-", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22]]
3
199
2
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); while (sc.hasNextLine() == true) { String line = sc.nextLine(); int[][] map = new int[10][10]; for (int i = 0; i < ma...
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); while (sc.hasNextLine() == true) { String line = sc.nextLine(); int[][] map = new int[10][10]; for (int i = 0; i < ma...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 12, 499]]
3
206
4
#include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; const int MX = 200000; bool sieve[MX]; void prepare() { memset(sieve, false, sizeof sieve); sieve[0] = sieve[1] = true; for (int i = 2; i * i < MX; ++i) { if (!sieve[i]) { for (int j = i * i; j < MX; j += i...
#include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; const int MX = 200000; bool sieve[MX]; void prepare() { memset(sieve, false, sizeof sieve); sieve[0] = sieve[1] = true; for (int i = 2; i * i < MX; ++i) { if (!sieve[i]) { for (int j = i * i; j < MX; j += i...
[["+", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 12, 22]]
1
175
2
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { bool f[105000]; int n; long long int sum[105000]; memset(f, false, sizeof(f)); sum[0] = 0; for (int i = 2; i <= 105000; i++) { if (f[i]) continue; for (int j = i * i; j < 105000; j += i) f[j] = ...
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int main() { bool f[105000]; int n; long long int sum[105000]; memset(f, false, sizeof(f)); sum[0] = 0; for (int i = 2; i * i <= 105000; i++) { if (f[i]) continue; for (int j = i * i; j < 105000; j += i) f[j...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22]]
1
179
2
#include <cmath> #include <cstdio> using namespace std; int dp[10010]; int prime(int n) { int i, j, d; if (n == 1) { return dp[1] = 2; }; d = dp[n - 1]; for (i = d + 1;; i++) { for (j = 2;; j++) { if (i % j == 0) break; if (j == (int)sqrt(i)) { return dp[n] = i; } ...
#include <cmath> #include <cstdio> using namespace std; int dp[10010]; int prime(int n) { int i, j, d; if (n == 1) { return dp[1] = 2; }; d = dp[n - 1]; for (i = d + 1;; i++) { for (j = 2;; j++) { if (i % j == 0) break; if (j == (int)sqrt(i) + 1) { return dp[n] = i; ...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
191
2
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <utility> #include <vector> using namespace std; typedef long long ll; int main() { const int N = 200000; bitset<N> sosu; int ans[10000]; int cnt = 0; int sum = 0; sosu.set(); for (int i = 2; i < N;...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <iostream> #include <utility> #include <vector> using namespace std; typedef long long ll; int main() { const ll N = 200000; bitset<N> sosu; int ans[10000]; int cnt = 0; int sum = 0; sosu.set(); for (ll i = 2; i < N; +...
[["-", 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, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78]]
1
172
4
#include <cmath> #include <iostream> using namespace std; int x[1000000], y[100000], n, cnt; int main() { for (int i = 2; i < 200000; i++) { for (int j = 2; j <= sqrt(i); j++) { if (j % i == 0) { goto E; } } x[i] = 0; E:; } for (int i = 0; i < 200000; i++) { if (x[i] == 1) { ...
#include <cmath> #include <iostream> using namespace std; int x[1000000], y[100000], n, cnt; int main() { for (int i = 2; i < 200000; i++) { for (int j = 2; j <= sqrt(i); j++) { if (i % j == 0) { goto E; } } x[i] = 1; E:; } for (int i = 0; i < 200000; i++) { if (x[i] == 1) { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13]]
1
159
6
#include <cmath> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define MAX 105000 using namespace std; int main() { /*for(int k = 1; k<MAX;k++) { if(PrimeCheck(v[k+1])) { //cout << v[k+1] << " "; v2[d] = v[k+1]; ...
#include <cmath> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define MAX 105000 using namespace std; int main() { /*for(int k = 1; k<MAX;k++) { if(PrimeCheck(v[k+1])) { //cout << v[k+1] << " "; v2[d] = v[k+1]; ...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22]]
1
225
2
#include <math.h> #include <stdio.h> int isprime(int x) { int i; if (x == 2) { return 1; } if (x < 2 || x % 2 == 0) { return 0; } i = 3; while (i <= sqrt(x)) { if (x % i == 0) { return 0; } i = i + 2; } return 1; } int main() { int n, c = 0, l[10001] = {0}, j = 0; for (in...
#include <math.h> #include <stdio.h> int isprime(int x) { int i; if (x == 2) { return 1; } if (x < 2 || x % 2 == 0) { return 0; } i = 3; while (i <= sqrt(x)) { if (x % i == 0) { return 0; } i = i + 2; } return 1; } int main() { int n, c = 0, l[10001] = {0}, j = 0; for (in...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
189
2
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
267
2
#include <iostream> using namespace std; int main() { int prime[10001], p = 3, psum[10001], n; prime[1] = 2, prime[2] = 3; for (int i = 5; p < 10001; i++) { int f = 0; for (int j = 1; prime[j] * prime[j] <= i; j++) if (i % prime[j] == 0) { f = 1; break; } if (!f) pr...
#include <iostream> using namespace std; int main() { int prime[10001], p = 3, psum[10001], n; prime[1] = 2, prime[2] = 3; for (int i = 5; p < 10001; i++) { int f = 0; for (int j = 1; prime[j] * prime[j] <= i; j++) if (i % prime[j] == 0) { f = 1; break; } if (!f) pr...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
185
2
#include <bitset> #include <cstdio> #include <iostream> #include <vector> using namespace std; #define MAX 1000000 int main() { bitset<MAX> is_prime; is_prime.set(); is_prime[0] = false, is_prime[1] = false; for (int i = 2; i * i <= MAX; i++) { for (int j = i + i; j <= MAX; j += i) { is_prime[j] = ...
#include <bitset> #include <cstdio> #include <iostream> #include <vector> using namespace std; #define MAX 1000000 int main() { bitset<MAX + 1> is_prime; is_prime.set(); is_prime[0] = false, is_prime[1] = false; for (int i = 2; i * i <= MAX; i++) { for (int j = i + i; j <= MAX; j += i) { is_prime[j...
[["+", 0, 43, 39, 344, 3, 347, 0, 16, 17, 72], ["+", 0, 43, 39, 344, 3, 347, 0, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 69, 28, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 69, 28, 22]]
1
222
6
#include <algorithm> #include <complex> #include <cstdio> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #de...
#include <algorithm> #include <complex> #include <cstdio> #include <iostream> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #de...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
203
2
#include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <sstream> #include <string> using namespace std; const int primemax = 500000; bool prime[primemax]; void init() { for (int i = 0; i < primemax; i++) { prime[i] = true; } prime[0] = prime[1] = false; for (int i = 2; i < pri...
#include <cmath> #include <complex> #include <cstdio> #include <iostream> #include <sstream> #include <string> using namespace std; const int primemax = 500000; bool prime[primemax]; void init() { for (int i = 0; i < primemax; i++) { prime[i] = true; } prime[0] = prime[1] = false; for (int i = 2; i * i <...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 22]]
1
199
4
max=110000 array=[*2..max] 2.upto(Math.sqrt(max)) do |num1| array.reject! do |num2| (num2%num1==0)&&(num2>num1) end end p array.size while gets break if $_.to_i==0 x=0 for i in 0...$_.to_i x+=array[i] end puts x end
max=110000 array=[*2..max] 2.upto(Math.sqrt(max)) do |num1| array.reject! do |num2| (num2%num1==0)&&(num2>num1) end end while gets break if $_.to_i==0 x=0 for i in 0...$_.to_i x+=array[i] end puts x end
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 486, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
82
4
max = 105000 sn = max.to_f**0.5.ceil is_prime = [false, false] + [true]*(max-1) (2..sn).each do |i| next unless is_prime[i] (i*i).step(max, i) do |j| is_prime[j] = false end end prime_list = (2..max).to_a.select{ |i| is_prime[i] } puts prime_list.size while n = gets.to_i do break if n == 0 puts prime_lis...
max = 105000 sn = max.to_f**0.5.ceil is_prime = [false, false] + [true]*(max-1) (2..sn).each do |i| next unless is_prime[i] (i*i).step(max, i) do |j| is_prime[j] = false end end prime_list = (2..max).to_a.select{ |i| is_prime[i] } while n = gets.to_i do break if n == 0 puts prime_list[0..(n-1)].inject(:+...
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 486, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
123
4
import sys from itertools import * n=104730;a=list(range(n));a[:2]=0,0 for i in range(2,323):a[i*2::i]=[0]*len(a[i*2::i]) p=list(compress(range(n),a)) for e in sys.stdin: if'0'!=e:print(sum(p[:int(e)]))
import sys from itertools import * n=104730;a=list(range(n));a[:2]=0,0 for i in range(2,323):a[i*2::i]=[0]*len(a[i*2::i]) p=list(compress(range(n),a)) for e in sys.stdin: if'0\n'!=e:print(sum(p[:int(e)]))
[["+", 0, 57, 15, 666, 0, 557, 0, 6, 0, 44]]
5
107
1
import math r = 10000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*i+1,r,i+1): p[j] = 0 while True: n = int(input()) if not n: break i, num, sum = 0, 1, 0 while num < n: if p[i] == 1: num += 1 ...
import math r = 200000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*i+1,r,i+1): p[j] = 0 while True: n = int(input()) if not n: break i, num, sum = 0, 0, 0 while num < n: if p[i] == 1: num += 1 ...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 432, 0, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 432, 0, 612], ["+", 64, 196, 0, 1, 0, 677, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 677, 12, 657, 12, 612]]
5
122
6
import math r = 105000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*i+1,r,i+1): p[j] = 0 prime = [0 for i in range(10000)] j = 0 for i in range(len(p)): if p[i]: prime[j] = i+1 j += 1 while True: n = int(input()...
import math r = 105000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: for j in range(2*i+1,r,i+1): p[j] = 0 prime = [0 for i in range(11000)] j = 0 for i in range(len(p)): if p[i]: prime[j] = i+1 j += 1 while True: n = int(input()...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]]
5
139
2
import math prime = [0 for i in range(11000)] k = 0 r = 105000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: prime[k] = i+1 k += 1 l = i for j in range(2*i+1,r,i+1): p[j] = 0 for i in range(l,r): if p[i]: prime[k] = i+1 ...
import math prime = [0 for i in range(11000)] k = 0 r = 105000 sqrt = int(math.sqrt(r)) p = [1]*r p[0] = 0 for i in range(1,sqrt): if p[i]: prime[k] = i+1 k += 1 l = i for j in range(2*i+1,r,i+1): p[j] = 0 for i in range(l+1,r): if p[i]: prime[k] = i+1 ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
152
2
<?php while (true) { fscanf(STDIN, '%d %d %d', $a, $b, $n); if (feof(STDIN)) { break; } $s = 0; $mod = $a > $b ? $a % $b : $a; for ($i = 0; $i < $n; $i++) { $mod *= 10; $s += (int) ($mod / $b); $mod = $mod >= $b ? $mod % $b : $mod; } echo $s . PHP_EOL; }
<?php while (true) { fscanf(STDIN, '%d %d %d', $a, $b, $n); if (feof(STDIN)) { break; } $s = 0; $mod = $a >= $b ? $a % $b : $a; for ($i = 0; $i < $n; $i++) { $mod *= 10; $s += (int) ($mod / $b); $mod = $mod >= $b ? $mod % $b : $mod; } echo $s . PHP_EOL; }
[["-", 0, 1, 0, 11, 12, 41, 15, 16, 17, 47], ["+", 0, 1, 0, 11, 12, 41, 15, 16, 17, 20]]
6
121
2
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextDouble()) { BigDecimal a = sc.nextBigDecimal(), b = sc.nextBigDecimal(); int n = sc.nextInt(); String d = a.divide(b, n + 1, 0).toStrin...
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextBigDecimal()) { BigDecimal a = sc.nextBigDecimal(), b = sc.nextBigDecimal(); int n = sc.nextInt(); String d = a.divide(b, n + 2, 0).toP...
[["-", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["+", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["-", 51, 492, 500, 492, 3, 4, 0, 16, 12, 499], ["+", 51, 492, 500, 492, 3, 4, 0, 16, 12, 499], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]]
3
149
6
import java.math.*; import java.util.*; class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); int a, b, c; while (s.hasNext()) { a = s.nextInt(); b = s.nextInt(); c = s.nextInt(); BigDecimal bd = new BigDecimal(a); bd = bd.setScale(c + 5);...
import java.math.*; import java.util.*; class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); int a, b, c; while (s.hasNext()) { a = s.nextInt(); b = s.nextInt(); c = s.nextInt(); BigDecimal bd = new BigDecimal(a); bd = bd.setScale(c + 5);...
[["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]]
3
179
2
#include <stdio.h> int main() { int i, j; int n[10]; char s[11]; while (scanf("%s", s) != -1) { for (i = 0; i < 10; i++) { n[i] = s[i] - '0'; } for (i = 9; i > 0; i--) { for (j = 0; j < i; j++) { n[j] = (n[j] + n[j + 1]) % 10; printf("%d\n", n[0]); } } } ret...
#include <stdio.h> int main() { int i, j; int n[10]; char s[11]; while (scanf("%s", s) != -1) { for (i = 0; i < 10; i++) n[i] = s[i] - '0'; for (i = 9; i > 0; i--) for (j = 0; j < i; j++) n[j] = (n[j] + n[j + 1]) % 10; printf("%d\n", n[0]); } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 52, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]]
0
136
6
main() { int n, i, x[10]; while (scanf("%d", &n) != -1) { for (i = 0; i < 10; i++) { x[i] = n % 10; n /= 10; } printf("%d\n", (x[0] + x[1] * 9 + x[2] * 36 + x[3] * 84 + x[4] * 126 + x[5] * 126 + x[6] * 84 + x[7] * 36 + x[8] * 9 + x[9]) % 10); } ...
main() { long long n, i, x[10]; while (scanf("%lld", &n) != -1) { for (i = 0; i < 10; i++) { x[i] = n % 10; n /= 10; } printf("%lld\n", (x[0] + x[1] * 9 + x[2] * 36 + x[3] * 84 + x[4] * 126 + x[5] * 126 + x[6] * 84 + x[7] * 36 + x[8] * 9 + x[9]) % ...
[["-", 36, 36, 0, 30, 0, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
140
7
#include <stdio.h> int main(void) { char a[10]; while (scanf("%s", &a) != EOF) { int b[10], i, j; for (i = 0; i < 10; i++) b[i] = a[i] - '0'; for (i = 8; i > 0; i--) { for (j = 0; j <= i; j++) { b[j] = (b[j] + b[j + 1]) % 10; } } printf("%d\n", b[0]); } return 0; }
#include <stdio.h> int main(void) { char a[10]; while (scanf("%s", &a) != EOF) { int b[10], i, j; for (i = 0; i < 10; i++) b[i] = a[i] - '0'; for (i = 8; i >= 0; i--) { for (j = 0; j <= i; j++) { b[j] = (b[j] + b[j + 1]) % 10; } } printf("%d\n", b[0]); } return 0; }
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 20]]
0
135
2
#include <iostream> using namespace std; string s; int a[10][10]; main() { while (cin >> s) { for (int i = 0; i < 10; i++) a[0][i] = s[i] - '0'; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9 - i; j++) a[i + 1][j] = (a[i][j] + a[i][j + 1]) % 10; } cout << a[10][0] << endl; }...
#include <iostream> using namespace std; string s; int a[10][10]; main() { while (cin >> s) { for (int i = 0; i < 10; i++) a[0][i] = s[i] - '0'; for (int i = 0; i < 9; i++) { for (int j = 0; j < 9 - i; j++) a[i + 1][j] = (a[i][j] + a[i][j + 1]) % 10; } cout << a[9][0] << endl; } ...
[["-", 31, 16, 12, 69, 28, 69, 341, 342, 0, 13], ["+", 31, 16, 12, 69, 28, 69, 341, 342, 0, 13]]
1
138
2
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s[10]; cin >> s[0]; s[0] += "0"; for (int i = 1; i < 10; i++) { for (int j = 0; j < 10; j++) { s[i][j] = (s[i -...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s[10]; while (cin >> s[0]) { s[0] += "0"; for (int i = 1; i < 10; i++) { for (int j = 0; j < 10; j++) { ...
[["+", 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, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
160
6
#include <bits/stdc++.h> using namespace std; int main() { int num[11][11]; string number; cin >> number; for (int i = 0; i < number.size(); i++) { num[0][i] = number[i] - '0'; } for (int i = 1; i < 10; i++) { for (int j = 1; j < 10; j++) { num[i][j] = (num[i - 1][j - 1] + num[i - 1][j]) % ...
#include <bits/stdc++.h> using namespace std; int main() { int num[11][11]; string number; while (cin >> number) { for (int i = 0; i < number.size(); i++) { num[0][i] = number[i] - '0'; } for (int i = 1; i < 10; i++) { for (int j = 1; j < 10; j++) { num[i][j] = (num[i - 1][j - 1...
[["+", 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, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
143
6
#include <bits/stdc++.h> using namespace std; using db = double; using ll = long long; using vi = vector<int>; #define op operator #define pb push_back int a[13][13]; int main() { cout << fixed << setprecision(9); ios ::sync_with_stdio(0); for (string s; cin >> s;) { for (int i = 0; i < 10; i++) a[0...
#include <bits/stdc++.h> using namespace std; using db = double; using ll = long long; using vi = vector<int>; #define op operator #define pb push_back int a[13][13]; int main() { cout << fixed << setprecision(9); ios ::sync_with_stdio(0); for (string s; cin >> s;) { for (int i = 0; i < 10; i++) a[0...
[["-", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 72]]
1
186
2
#include <cstdio> using namespace std; int a[10], n; int main() { while (scanf("%d", &n) != EOF) { for (int i = 9; i >= 0; i--) { a[i] = n % 10; n /= 10; } for (int i = 9; i > 0; i--) { for (int j = 0; j < i; j++) { a[j] = (a[j] + a[j + 1]) % 10; } } printf("%d\n"...
#include <cstdio> using namespace std; int a[10]; long n; int main() { while (scanf("%ld", &n) != EOF) { for (int i = 9; i >= 0; i--) { a[i] = n % 10; n /= 10; } for (int i = 9; i > 0; i--) { for (int j = 0; j < i; j++) { a[j] = (a[j] + a[j + 1]) % 10; } } printf(...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["-", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6]]
1
134
5
#include <cstdio> int main() { char s[11], a, i; for (; fgets(s, 11, stdin);) { for (a = 9; a >= 0; a--) for (i = 0; i < a; s[i] = (s[i] + s[i + 1] - 6) % 10 + 48, i++) ; printf("%c\n", *s); } }
#include <cstdio> int main() { char s[15], a, i; for (; fgets(s, 15, stdin);) { for (a = 9; a >= 0; a--) for (i = 0; i < a; s[i] = (s[i] + s[i + 1] - 6) % 10 + 48, i++) ; printf("%c\n", *s); } }
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 7, 15, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 7, 15, 2, 3, 4, 0, 13]]
1
96
4
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { vector<int> a(10); while (scanf("%1d ", a) == 1) { for (int i = 1; i < 10; i++) { scanf("%1d ", &a[i]); } for (int i = 9; i >= 1; i--) { vector<int> b(i); for (int j = 0; j < i; j++) { b...
#include <cstdio> #include <iostream> #include <vector> using namespace std; int main() { vector<int> a(10); while (scanf("%1d ", &a[0]) == 1) { for (int i = 1; i < 10; i++) { scanf("%1d ", &a[i]); } for (int i = 9; i >= 1; i--) { vector<int> b(i); for (int j = 0; j < i; j++) { ...
[["+", 51, 16, 31, 2, 3, 4, 0, 66, 17, 67], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 70], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 66, 28, 69, 341, 342, 0, 73]]
1
151
4
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> #define N 10 using namespace std; int main() { string inp; cin >> inp; vector<int> vec; for (int i = 0; i < N; i++) { if (inp[i] == '0') { vec.push_back(0); } else { vec.push_back((int)inp[i] - '0')...
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> #define N 10 using namespace std; int main() { string inp; while (cin >> inp) { vector<int> vec; for (int i = 0; i < N; i++) { if (inp[i] == '0') { vec.push_back(0); } else { vec.push_ba...
[["+", 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, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
169
6
#include <iostream> using namespace std; int main() { string s; int num[10]; int tmp[10]; cin >> s; for (int i = 0; i < s.size(); ++i) if ('0' <= s[i] && s[i] <= '9') num[i] = s[i] - '0'; for (int i = 9; i > 0; --i) { for (int j = 0; j < i; ++j) tmp[j] = (num[j] + num[j + 1]) % 10; f...
#include <iostream> using namespace std; int main() { string s; int num[10]; int tmp[10]; while (cin >> s) { for (int i = 0; i < s.size(); ++i) if ('0' <= s[i] && s[i] <= '9') num[i] = s[i] - '0'; for (int i = 9; i > 0; --i) { for (int j = 0; j < i; ++j) tmp[j] = (num[j] + nu...
[["+", 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, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
172
6
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string.h> using namespace std; int output(int num[10], int len) { if (len == 1) { return num[0]; } else { int temp[10] = {0}; len--; for (int i = 0; i < len; i++) { temp[i] = (num[i] + num[i ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string.h> using namespace std; int output(int num[10], int len) { if (len == 1) { return num[0]; } else { int temp[10] = {0}; len--; for (int i = 0; i < len; i++) { temp[i] = (num[i] + num[i ...
[["+", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22]]
1
167
2
def suicide(lis): if len(lis) == 1: print(lis[0]) pokakito = [] for i in range(len(lis)-1): check = lis[i] + lis[i+1] one = int(str(check)[-1]) pokakito.append(one) else: suicide(pokakito) while True: try: lis = [int(char) for char in input()] ...
def suicide(lis): if len(lis) == 1: print(lis[0]) return pokakito = [] for i in range(len(lis)-1): check = lis[i] + lis[i+1] one = int(str(check)[-1]) pokakito.append(one) else: suicide(pokakito) while True: try: lis = [int(char) for char in i...
[["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]]
5
103
1
#include <algorithm> #include <iostream> #include <string> int main() { char c; int a = 0; std::string s, x; for (; std::cin >> s >> c;) { x = s; reverse(x.begin(), x.end()); if (x == s) a++; } std::cout << a << "\n"; }
#include <algorithm> #include <iostream> #include <string> int main() { int a = 0; std::string s, x; for (; std::cin >> s;) { x = s; reverse(x.begin(), x.end()); if (x == s) a++; } std::cout << a << "\n"; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
79
5
s = 0 while a = gets.chop f = 1 a.size.times{|i| f = 0 if a[i] != a[~i] } s += f end p s
s = 0 while a = gets a.chop! f = 1 a.size.times{|i| f = 0 if a[i] != a[~i] } s += f end p s
[["+", 0, 493, 0, 89, 8, 170, 0, 652, 486, 22], ["-", 0, 493, 0, 89, 15, 662, 12, 652, 735, 22], ["+", 0, 493, 0, 89, 8, 170, 0, 652, 735, 22]]
4
42
3
count = 0 while True: a = input() b = a[::-1] if a == b: count+=1 print(count)
count = 0 try: while True: a = input() b = a[::-1] if a == b: count+=1 except EOFError: pass print(count)
[["+", 36, 36, 36, 36, 0, 656, 0, 246, 0, 247], ["+", 36, 36, 36, 36, 0, 656, 0, 246, 0, 102], ["+", 36, 36, 0, 656, 0, 246, 0, 671, 0, 672], ["+", 36, 36, 0, 656, 0, 246, 0, 671, 0, 22], ["+", 36, 36, 0, 656, 0, 246, 0, 671, 0, 102], ["+", 0, 246, 0, 671, 0, 196, 0, 674, 0, 675]]
5
32
6
import sys print(e[:-1]==e[-2::-1]for e in sys.stdin)
import sys print(sum(e[:-1]==e[-2::-1]for e in sys.stdin))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 668, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 668, 0, 25]]
5
27
3
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = 0; while (sc.hasNext()) { char[] c = sc.next().toCharArray(); for (int i = 0; i < c.length; i++) { if (intJudge(c[i])) { String str = c[i] + "...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = 0; while (sc.hasNext()) { char[] c = sc.next().toCharArray(); for (int i = 0; i < c.length; i++) { if (intJudge(c[i])) { String str = c[i] + "...
[["+", 64, 196, 0, 7, 8, 196, 0, 57, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 196, 0, 45], ["+", 8, 196, 0, 57, 75, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 75, 196, 0, 93, 0, 35], ["+", 0, 7, 8, 196, 0, 57, 75, 196, 0, 46]]
3
207
5
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int count; int sum; sum = 0; while (sc.hasNext()) { count = 0; String str = sc.next(); for (int i = 0; i < str.length(); i++) { if ('0' <= str.cha...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int count; int sum; sum = 0; while (sc.hasNext()) { count = 0; String str = sc.next(); for (int i = 0; i < str.length(); i++) { if ('0' <= str.cha...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35]]
3
145
4
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { FastScanner sc = new FastSc...
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { FastScanner sc = new FastSc...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 98]]
3
683
2
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int count = 0; while ((line = br.readLine()) != null) { int a = 0; boolean f = false; for (int i = 0...
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int count = 0; while ((line = br.readLine()) != null) { int a = 0; boolean f = false; for (int i = 0...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35]]
3
171
4
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); String s; char[] c; int res, i, l; res = 0; for (; sc.hasNext();) { s = sc.next(); c = new char[s.length()]; for (i = 0; i < s.length(); i...
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); String s; char[] c; int res, i, l; res = 0; for (; sc.hasNext();) { s = sc.next(); c = new char[s.length()]; for (i = 0; i < s.length(); i...
[["+", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 195, 8, 196, 0, 7, 8, 196, 0, 46]]
3
318
2
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); int num = 0; while (sc.hasNextLine() == true) { String line = sc.nextLine(); int state = 0; int tmp = 0; fo...
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); int num = 0; while (sc.hasNextLine() == true) { String line = sc.nextLine(); int state = 0; int tmp = 0; fo...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 196, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 519, 0, 52, 8, 196, 0, 1, 0, 35]]
3
177
6
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger sum = new BigInteger("0"); while (sc.hasNextLine()) { String str = sc.nextLine(); String[] a = str.split("[D]"); for (int i...
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger sum = new BigInteger("0"); while (sc.hasNext()) { String str = sc.next(); String[] a = str.split("[^0-9]"); for (int i = 0;...
[["-", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["+", 8, 196, 0, 52, 15, 15, 0, 492, 141, 22], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["-", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491], ["+", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491]]
3
148
26
import java.math.*; import java.util.*; class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); BigInteger ret = new BigInteger("0"); while (s.hasNext()) { String str = s.next(); String[] a = str.split("[a-zA-Z.]"); for (int i = 0; i < a.length; i++) { ...
import java.math.*; import java.util.*; class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); BigInteger ret = new BigInteger("0"); while (s.hasNext()) { String str = s.next(); String[] a = str.split("[^0-9]"); for (int i = 0; i < a.length; i++) { ...
[["-", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491], ["+", 49, 200, 51, 492, 3, 4, 0, 5, 0, 491]]
3
145
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long sum = 0; long tmp = 0; while (stdIn.hasNext()) { String a = stdIn.nextLine(); char[] b = new char[100]; b = a.toCharArray(); tmp = 0; for...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); long sum = 0; long tmp = 0; while (stdIn.hasNext()) { String a = stdIn.nextLine(); char[] b = new char[100]; b = a.toCharArray(); tmp = 0; for...
[["-", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46], ["+", 0, 195, 8, 196, 0, 52, 8, 196, 0, 46]]
3
160
2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = 0; while (sc.hasNext()) { String s = sc.next(); int start = 0; for (int i = 0; i < s.length(); i++) { if (s.codePointAt(i) > 47 && s.codePointAt(i) <...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = 0; while (sc.hasNext()) { String s = sc.next(); int start = 0; for (int i = 0; i < s.length(); i++) { if (s.codePointAt(i) > 47 && s.codePointAt(i) <...
[["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 499]]
3
172
2
#include <math.h> #include <stdio.h> #include <string.h> int main() { int i, j, k; int n = 0; char s[81]; while (scanf("%s", s) != -1) { for (i = 0; i < strlen(s); i++) { if ('1' <= s[i] && s[i] <= '9') { for (j = i + 1; j < strlen(s); j++) { if (s[j] < '0' || '9' < s[j]) { ...
#include <math.h> #include <stdio.h> #include <string.h> int main() { int i, j, k; int n = 0; char s[81]; while (scanf("%s", s) != -1) { for (i = 0; i < strlen(s); i++) { if ('1' <= s[i] && s[i] <= '9') { for (j = i + 1; j < strlen(s); j++) { if (s[j] < '0' || '9' < s[j]) ...
[["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 57, 64, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 57, 64, 9, 0, 7, 8, 9, 0, 46]]
0
191
4
#include <ctype.h> #include <math.h> #include <stdio.h> #include <string.h> int main(void) { char str[81]; int count = 0, length, i, j = 0, k = 0; while (scanf("%s", str) != EOF) { length = strlen(str); for (i = length - 1; i >= 0; i--) { if (isdigit(str[i])) { j = 0; while (1) { ...
#include <ctype.h> #include <math.h> #include <stdio.h> #include <string.h> int main(void) { char str[81]; int count = 0, length, i, j = 0, k = 0; while (scanf("%s", str) != EOF) { length = strlen(str); for (i = length - 1; i >= 0; i--) { if (isdigit(str[i])) { j = 0; k = 0; ...
[["+", 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, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
0
165
4
#include <math.h> #include <stdio.h> int main() { int i = 0, j, sum = 0; char ch; int str[6]; while ((ch = getchar()) != EOF) { if (isdigit(ch) != 0) { str[i++] = ch - '0'; } else if (i != 0) { for (j = 0; j < i; j++) { sum += str[j] * pow(10, i - j - 1); } i = 0; } ...
#include <math.h> #include <stdio.h> int main() { int i = 0, j, sum = 0; char ch; int str[6]; while ((ch = getchar()) != EOF) { if (isdigit(ch) != 0) { str[i++] = ch - '0'; } else if (i != 0) { for (j = 0; j < i; j++) { sum += str[j] * pow(10, i - j - 1); } i = 0; } ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
126
2
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i, len; int pass = 0; char line[100]; while (1) { if (scanf("%s", line) == -1) break; len = strlen(line); for (i = 0; i < len; i++) { if (line[i] < '0' || line[i] > '9') line[i] = 0; } for (i = 0;...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i, len; int pass = 0; char line[100]; while (1) { if (scanf("%s", line) == -1) break; len = strlen(line); for (i = 0; i < len; i++) { if (line[i] < '0' || line[i] > '9') line[i] = 0; } for (i = 0;...
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
0
159
2
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; int main() { string st; int ans = 0; while (getline(cin, st)) { int num = 0; for (auto c : st) { if (isdigit(c)) { num...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; int main() { string st; int ans = 0; while (getline(cin, st)) { int num = 0; for (auto c : st) { if (isdigit(c)) { num...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
106
4
#include <cctype> #include <iostream> using namespace std; string sentence; typedef string::const_iterator State; int parse(State &it) { int ret = 0; while (isdigit(*it)) { ret = ret * 10; ret = ret + *it - '0'; it++; } return ret; } int main(void) { int sum = 0; while (cin >> sentence) { ...
#include <cctype> #include <iostream> using namespace std; string sentence; typedef string::const_iterator State; int parse(State &it) { int ret = 0; while (isdigit(*it)) { ret = ret * 10; ret = ret + *it - '0'; it++; } return ret; } int main(void) { int sum = 0; while (cin >> sentence) { ...
[["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
134
3
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i, c) \ for (__typeof((c).begin()) i = (c).begin(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i, c) \ for (__typeof((c).begin()) i = (c).begin(...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
268
6
#include <bits/stdc++.h> #define range(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rep(i, n) range(i, 0, n) using namespace std; int main(void) { int ans = 0; while (1) { string s; cin >> s; if (cin.eof()) break; int n = s.size(); int cur = 0; rep(i, n) { if (isdigit(s...
#include <bits/stdc++.h> #define range(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rep(i, n) range(i, 0, n) using namespace std; int main(void) { int ans = 0; while (1) { string s; cin >> s; if (cin.eof()) break; int n = s.size(); int cur = 0; rep(i, n) { if (isdigit(s...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
130
4
#include <iostream> #include <string> using namespace std; int main() { string str; int c = 0; while (cin >> str) { int t = 0; for (int i = 0; i < str.length(); i++) { if (str[i] >= '0' && str[i] <= '9') t = t * 10 + str[i] - '0'; else { c += t; t = 0; } } ...
#include <iostream> #include <string> using namespace std; int main() { string str; int c = 0; while (cin >> str) { int t = 0; for (int i = 0; i < str.length(); i++) { if (str[i] >= '0' && str[i] <= '9') t = t * 10 + str[i] - '0'; else { c += t; t = 0; } } ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
107
4
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, l, n) for (int i = l; i <...
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, l, n) for (int i = l; i <...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
218
2
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a) REP(i, 0, a) #define REP(i, a, b) for (int i = a; i < b; ++i) t...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a) REP(i, 0, a) #define REP(i, a, b) for (int i = a; i < b; ++i) t...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
251
6
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { string str; int ans, num; ans = 0; num = 0; while (true) { num = 0; cin >> str; if (cin.eof()) { break; } for (int i = 0; i < str.size(); i++) { if (str[i] >= '0' && str[i] <= '9'...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { string str; int ans, num; ans = 0; num = 0; while (true) { num = 0; cin >> str; if (cin.eof()) { break; } for (int i = 0; i < str.size(); i++) { if (str[i] >= '0' && str[i] <= '9'...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
141
4
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define FOR(i, a, b) fo...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define FOR(i, a, b) fo...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]]
1
319
2
#include <iostream> using namespace std; int main() { string s; int ans = 0; int sum; int flag = 1; int temp = 0; while (cin >> s) { sum = 0; for (int i = 0; i < s.size(); i++) { if ('0' <= s[i] && s[i] <= '9') { sum = 10 * sum + (s[i] - '0'); } else { ans += sum; ...
#include <iostream> using namespace std; int main() { string s; int ans = 0; int sum; int flag = 1; int temp = 0; while (cin >> s) { sum = 0; for (int i = 0; i < s.size(); i++) { if ('0' <= s[i] && s[i] <= '9') { sum = 10 * sum + (s[i] - '0'); } else { ans += sum; ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
121
4
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <numeric> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define PUSH(n, v) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <numeric> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define PUSH(n, v) ...
[["+", 0, 52, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 23, 0, 42, 0, 22], ["+", 15, 339, 51, 16, 31, 23, 0, 42, 0, 32], ["+", 51, 16, 31, 23, 0, 2, 3, 4, 0, 25]]
1
134
4
#include <iostream> #include <string> using namespace std; int main() { int ans = 0, num; string s; while (cin >> s) { num = 0; for (int i = 0; i < s.size(); i++) { if ('0' <= s[i] && s[i] <= '9') { num = num * 10 + (s[i] - '0'); } else { ans += num; num = 0; } ...
#include <iostream> #include <string> using namespace std; int main() { int ans = 0, num; string s; while (cin >> s) { num = 0; for (int i = 0; i < s.size(); i++) { if ('0' <= s[i] && s[i] <= '9') { num = num * 10 + (s[i] - '0'); } else { ans += num; num = 0; } ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
115
4
#include <iostream> #include <string> using namespace std; int findNumber(string s) { int tmp = 0, res = 0; for (int i = 0; i < s.size(); i++) { if (0 <= s[i] - '0' && s[i] - '0' < 10) { tmp *= 10; tmp += s[i] - '0'; } else { res += tmp; tmp = 0; } } return res; } int main(...
#include <iostream> #include <string> using namespace std; int findNumber(string s) { int tmp = 0, res = 0; for (int i = 0; i < s.size(); i++) { if (0 <= s[i] - '0' && s[i] - '0' < 10) { tmp *= 10; tmp += s[i] - '0'; } else { res += tmp; tmp = 0; } } return res + tmp; } int...
[["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 72], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 12, 22]]
1
138
2
#include <iostream> #include <string> using namespace std; int main() { string s; int sum = 0; while (getline(cin, s)) { string sa; for (int i = 0; i < s.size(); i++) { if (s[i] >= '0' && s[i] <= '9') { sa.push_back(s[i]); } else { if (i != 0 && s[i - 1] >= '0' && s[i - 1] <= ...
#include <iostream> #include <string> using namespace std; int main() { string s; int sum = 0; while (getline(cin, s)) { string sa; for (int i = 0; i < s.size(); i++) { if (s[i] >= '0' && s[i] <= '9') { sa.push_back(s[i]); } else { if (i != 0 && s[i - 1] >= '0' && s[i - 1] <= ...
[["-", 341, 342, 0, 16, 31, 2, 63, 118, 28, 22], ["+", 341, 342, 0, 16, 31, 2, 63, 118, 28, 22]]
1
207
4
#include <iostream> #include <string> using namespace std; int main() { int ans = 0; string s; while (getline(cin, s)) { int n = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') n = n * 10 + 1; else if (s[i] == '2') n = n * 10 + 2; else if (s[i] == '3') n ...
#include <iostream> #include <string> using namespace std; int main() { int ans = 0; string s; while (getline(cin, s)) { int n = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') n = n * 10 + 1; else if (s[i] == '2') n = n * 10 + 2; else if (s[i] == '3') n ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
274
4
#include <stdio.h> int main() { int r = 0, j, i; char s[128]; while (scanf("%s", s) != EOF) { j = 0; i = 0; while (s[i] != 0) { if (s[i] >= '0' && s[i] <= '9') { j *= 10; j += (s[i] - '0'); } else { r += j; j = 0; } i++; } } printf("%d\n"...
#include <stdio.h> int main() { int r = 0, j, i; char s[128]; while (scanf("%s", s) != EOF) { j = 0; i = 0; while (s[i] != 0) { if (s[i] >= '0' && s[i] <= '9') { j *= 10; j += (s[i] - '0'); } else { r += j; j = 0; } i++; } r += j; } p...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
123
4
#include <iostream> #include <string> using namespace std; int main() { string str; unsigned int x, sum = 0; while (cin >> str) { for (string::size_type i = 0; i < str.length(); i++) { x = 0; while (isdigit(str[i])) { x = 10 * x + str[i] - '0'; i++; } if (x > 0) { ...
#include <iostream> #include <string> using namespace std; int main() { string str; unsigned int x, sum = 0; while (cin >> str) { for (string::size_type i = 0; i < str.length(); i++) { x = 0; while (isdigit(str[i])) { x = 10 * x + str[i] - '0'; i++; } if (x > 0) { ...
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
112
2
#include <iostream> #include <string> #include <vector> using namespace std; bool isdigit(char c); int main() { string str; int num = 0; int ans = 0; while (cin >> str) { for (int i = 0; i < str.size(); ++i) { if (isdigit(str[i])) { if (isdigit(str[i - 1])) { num *= 10; ...
#include <iostream> #include <string> #include <vector> using namespace std; bool isdigit(char c); int main() { string str; int num = 0; int ans = 0; while (cin >> str) { for (int i = 0; i < str.size(); ++i) { if (isdigit(str[i])) { if (isdigit(str[i - 1])) { num *= 10; ...
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
270
2
#include <iostream> using namespace std; int main() { string text; int s = 0, n = 0; while (cin >> text) { for (int i = 0; i < text.size(); i++) { if ('0' <= text[i] && text[i] <= '9') { n *= 10; n += (text[i] - '0'); } else { s += n; n = 0; } } n = ...
#include <iostream> using namespace std; int main() { string text; int s = 0, n = 0; while (cin >> text) { for (int i = 0; i < text.size(); i++) { if ('0' <= text[i] && text[i] <= '9') { n *= 10; n += (text[i] - '0'); } else { s += n; n = 0; } } s +=...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
115
4
#include <stdio.h> int main() { double d[8]; int i; while (scanf("%lf", &d[0]) != EOF) { for (i = 1; i < 8; i++) scanf("%lf", &d[i]); if ((d[0] <= d[4] && d[4] <= d[2] || d[4] <= d[0] && d[0] <= d[6]) && (d[1] <= d[5] && d[5] <= d[3] || d[5] <= d[1] && d[1] <= d[7])) { printf("Yes\n");...
#include <stdio.h> int main() { double d[8]; int i; while (scanf("%lf", &d[0]) != EOF) { for (i = 1; i < 8; i++) scanf("%lf", &d[i]); if ((d[0] <= d[4] && d[4] <= d[2] || d[4] <= d[0] && d[0] <= d[6]) && (d[1] <= d[5] && d[5] <= d[3] || d[5] <= d[1] && d[1] <= d[7])) { printf("YES\n");...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
170
4
#include <stdio.h> int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if ((((xb1 <= xa1) && (xa1 <= xb2)) || ((xb1 <= xa2) && (xa2 <= xb2)) || ((xa1 <= xb1) && (xb1 <= xa2)...
#include <stdio.h> int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if ((((xb1 <= xa1) && (xa1 <= xb2)) || ((xb1 <= xa2) && (xa2 <= xb2)) || ((xa1 <= xb1) && (xb1 <= xa2)...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
202
2
#include <stdio.h> int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if (xb1 <= xa2 && xa1 <= xb2 && yb1 <= ya2 && ya1 <= yb2) { printf("YES"); } else { printf("NO"...
#include <stdio.h> int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if (xb1 <= xa2 && xa1 <= xb2 && yb1 <= ya2 && ya1 <= yb2) { printf("YES\n"); } else { printf("N...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
102
2
#include <iostream> using namespace std; int main() { double ax1, ax2, ay1, ay2, bx1, bx2, by1, by2; while (cin >> ax1 >> ay1 >> ax2 >> ay2 >> bx1 >> by1 >> bx2 >> by2) { if (ax1 <= by2 && by1 <= ay2 && bx1 <= ax2 && ay1 <= by2) cout << "YES" << endl; else cout << "NO" << endl; } return 0;...
#include <iostream> using namespace std; int main() { double ax1, ax2, ay1, ay2, bx1, bx2, by1, by2; while (cin >> ax1 >> ay1 >> ax2 >> ay2 >> bx1 >> by1 >> bx2 >> by2) { if (ax1 <= bx2 && by1 <= ay2 && bx1 <= ax2 && ay1 <= by2) cout << "YES" << endl; else cout << "NO" << endl; } return 0;...
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 12, 22]]
1
89
4
#include <iostream> using namespace std; int main() { double ax1, ax2, ay1, ay2, bx1, bx2, by1, by2; while (cin >> ax1 >> ay1 >> ax2 >> ay2 >> bx1 >> by1 >> bx2 >> by2) { if (ax1 <= by2 && by1 <= ay2 && bx1 <= ax2 && ay1 <= by2) cout << "YES" << endl; else cout << "NO" << endl; } return 0;...
#include <iostream> using namespace std; int main() { double ax1, ax2, ay1, ay2, bx1, bx2, by1, by2; while (cin >> ax1 >> ay1 >> ax2 >> ay2 >> bx1 >> by1 >> bx2 >> by2) if (ax1 <= bx2 && by1 <= ay2 && bx1 <= ax2 && ay1 <= by2) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 51, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
89
4
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) { if (xa1 <= xb2 && xa2 >= xb1 && ya1 >= yb2 && xa2 >= yb1) { cout << "YES" << endl; } else { cout << "NO" << endl; } } ...
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) { if (xa1 <= xb2 && xa2 >= xb1 && ya1 <= yb2 && ya2 >= yb1) { cout << "YES" << endl; } else { cout << "NO" << endl; } } ...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 20], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
93
4
#include <iostream> using namespace std; int x[4], y[4]; int main() { while (cin >> x[0] >> y[0]) { cin >> x[1] >> y[1]; cin >> x[2] >> y[2]; cin >> x[3] >> y[3]; if (x[0] > x[1]) swap(x[0], x[1]); if (x[2] > x[3]) swap(x[2], x[3]); if (y[0] > y[1]) swap(y[0], y[1]); if (...
#include <iostream> using namespace std; long double x[4], y[4]; int main() { while (cin >> x[0] >> y[0]) { cin >> x[1] >> y[1]; cin >> x[2] >> y[2]; cin >> x[3] >> y[3]; if (x[0] > x[1]) swap(x[0], x[1]); if (x[2] > x[3]) swap(x[2], x[3]); if (y[0] > y[1]) swap(y[0], y[1]); ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 39, 40]]
1
264
3
#include <stdio.h> int main() { double xa1, xa2, ya1, ya2, xb1, xb2, yb1, yb2; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if (xa1 > xb2 || ya1 > yb2 || xb1 > xa2 || yb1 > xa2) { printf("NO\n"); } else { printf("YES\n"); }...
#include <stdio.h> int main() { double xa1, xa2, ya1, ya2, xb1, xb2, yb1, yb2; while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { if (xa1 > xb2 || ya1 > yb2 || xb1 > xa2 || yb1 > ya2) { printf("NO\n"); } else { printf("YES\n"); }...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
104
2
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22]]
1
208
4
#include <cstdio> int main() { float xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%f%f%f%f%f%f%f%f", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != -1) { if (xa1 <= xb2 && xb1 <= xa2 && ya1 <= yb2 && yb2 <= ya2) printf("YES\n"); else printf("NO\n"); } }
#include <cstdio> int main() { float xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (scanf("%f%f%f%f%f%f%f%f", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != -1) { if (xa1 <= xb2 && xb1 <= xa2 && ya1 <= yb2 && yb1 <= ya2) printf("YES\n"); else printf("NO\n"); } }
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
97
2
#include <iostream> using namespace std; struct P { int x; int y; }; int main() { P a, b, c, d; while (cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y) { if (c.x <= b.x && d.x <= a.x && c.y <= b.y && d.y <= a.y) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
#include <iostream> using namespace std; struct P { double x; double y; }; int main() { P a, b, c, d; while (cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y) { if (c.x <= b.x && a.x <= d.x && c.y <= b.y && a.y <= d.y) cout << "YES" << endl; else cout << "NO" << endl; } return...
[["-", 0, 30, 0, 122, 8, 123, 0, 124, 39, 40], ["+", 0, 30, 0, 122, 8, 123, 0, 124, 39, 40], ["-", 31, 16, 31, 16, 12, 16, 31, 118, 28, 22], ["+", 31, 16, 31, 16, 12, 16, 31, 118, 28, 22], ["-", 31, 16, 31, 16, 12, 16, 12, 118, 28, 22], ["+", 31, 16, 31, 16, 12, 16, 12, 118, 28, 22], ["-", 15, 339, 51, 16, 12, 16, 31, ...
1
124
12
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2; if (!(xb2 < xa1 || xa2 < xb1 || ya1 > yb2 || ya2 < yb1)) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) { if (!(xb2 < xa1 || xa2 < xb1 || ya1 > yb2 || ya2 < yb1)) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
[["+", 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, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
88
6
#include <cmath> #include <cstdio> using namespace std; int main(void) { double xa1, ya1, xa2, ya2; // A左下,右上 double xb1, yb1, xb2, yb2; // B左下,右上 while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { bool f = false; double xaa = (xa1 > ...
#include <cmath> #include <cstdio> using namespace std; int main(void) { double xa1, ya1, xa2, ya2; // A左下,右上 double xb1, yb1, xb2, yb2; // B左下,右上 while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) { bool f = false; double xaa = (xa1 > ...
[["-", 8, 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, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
479
4
#include <iostream> #include <stdio.h> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) { if (((xb1 <= xa1 && xa1 <= xb1) || (xa1 <= xb1 && xb1 <= xa2)) && ((yb1 <= ya1 && ya1 <= yb2) || (ya1 <= yb1 && ...
#include <iostream> #include <stdio.h> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) { if (((xb1 <= xa1 && xa1 <= xb2) || (xa1 <= xb1 && xb1 <= xa2)) && ((yb1 <= ya1 && ya1 <= yb2) || (ya1 <= yb1 && ...
[["-", 0, 16, 31, 23, 0, 16, 12, 16, 12, 22], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
123
2
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) cout << ((xb1 <= xa2 && xa1 <= xb2 && yb1 >= ya2 && ya1 >= yb2) ? "YES" :...
#include <iostream> using namespace std; int main() { double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) cout << ((xb1 <= xa2 && xa1 <= xb2 && yb1 <= ya2 && ya1 <= yb2) ? "YES" :...
[["-", 15, 23, 0, 16, 31, 16, 12, 16, 17, 20], ["+", 15, 23, 0, 16, 31, 16, 12, 16, 17, 19], ["-", 0, 41, 15, 23, 0, 16, 12, 16, 17, 20], ["+", 0, 41, 15, 23, 0, 16, 12, 16, 17, 19]]
1
81
4
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define INF 100000000 #define pb push_back #de...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define INF 100000000 #define pb push_back #de...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
423
4
while gets xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = $_.split.map(&:to_i) if (xa2 < xb1) || (ya2 < yb1) || (xa1 > xb2) || (ya1 > yb2) puts "NO" else puts "YES" end end
while gets xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = $_.split.map(&:to_f) if (xa2 < xb1) || (ya2 < yb1) || (xa1 > xb2) || (ya1 > yb2) puts "NO" else puts "YES" end end
[["-", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753], ["+", 0, 662, 12, 652, 3, 4, 0, 752, 0, 753]]
4
62
2
import sys for s in sys.stdin: xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = list(map(float,s.split())) if xb1 < xa1 or xa2 < xb1: print("NO") elif yb2 < ya1 or ya2 < yb1: print("NO") else: print("YES")
import sys for s in sys.stdin: xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = list(map(float,s.split())) if xb2 < xa1 or xa2 < xb1: print("NO") elif yb2 < ya1 or ya2 < yb1: print("NO") else: print("YES")
[["-", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 0, 22]]
5
76
2
while True: try: xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = list(map(float, input().split())) print("NO" if (xb2 < xa1 or xa2 < xb1 or yb2 < ya1 or ya2 < ya1) else "YES") except: break
while True: try: xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = list(map(float, input().split())) print("NO" if (xb2 < xa1 or xa2 < xb1 or yb2 < ya1 or ya2 < yb1) else "YES") except: break
[["-", 0, 41, 0, 23, 0, 679, 12, 666, 0, 22], ["+", 0, 41, 0, 23, 0, 679, 12, 666, 0, 22]]
5
67
2
x = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(/\s/); y = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; for (i = 0; i < x.length - 1; i += 3) { count = 0; for (j = 0; j < 10; j++) { if (y[j] <= 20 - (x[i] * 1 + x[i + 1] * 1) && y[j] != x[i + 2] && y[j] != x[i + 1] && y[j] != x[i]) { count...
x = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(/\s/); y = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; for (i = 0; i < x.length - 1; i += 3) { count = 0; for (j = 0; j < 10; j++) { if (y[j] <= 20 - (x[i] * 1 + x[i + 1] * 1) && y[j] != x[i + 2] && y[j] != x[i + 1] && y[j] != x[i]) { count...
[["-", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491], ["+", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491]]
2
189
4
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { boolean[] c = new boolean[11]; Arrays.fill(c, true); c[0] = false; int C1 = sc.nextInt(); int C2 = sc.nextI...
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { boolean[] c = new boolean[11]; Arrays.fill(c, true); c[0] = false; int C1 = sc.nextInt(); int C2 = sc.nextI...
[["-", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499]]
3
212
2