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 <iostream> #include <stack> #include <string> #include <utility> #include <vector> int main(void) { std::string Input; std::cin >> Input; std::stack<int> PlaceBackSlash; std::stack<std::pair<int, int>> Puddle_Place_Quantity; for (unsigned int i = 0; i < Input.size(); ++i) { if (Input[i] == '\\') ...
#include <iostream> #include <stack> #include <string> #include <utility> #include <vector> int main(void) { std::string Input; std::cin >> Input; std::stack<int> PlaceBackSlash; std::stack<std::pair<int, int>> Puddle_Place_Quantity; for (unsigned int i = 0; i < Input.size(); ++i) { if (Input[i] == '\\') ...
[["-", 8, 9, 0, 7, 10, 43, 39, 86, 0, 87]]
1
339
1
#include <algorithm> #include <iostream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { stack<int> S1; stack<pair<int, int>> S2; char slope; int i = 0; int sum = 0; while (cin >> slope) { if (slope == '\\') { S1.push(i...
#include <algorithm> #include <iostream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { stack<int> S1; stack<pair<int, int>> S2; char slope; int i = 0; int sum = 0; while (cin >> slope) { if (slope == '\\') { S1.push(i...
[["-", 75, 76, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["-", 0, 1, 0, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 1, 0, 16, 12, 2, 63, 118, 28, 22]]
1
290
4
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(...
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
440
2
#include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <stdlib.h> using namespace std; stack<int> S1; stack<pair<int, int>> S2; int area = 0; int main() { string s; cin >> s; int n = s.size(); for (int i = 0; i < n; i++) { if (s[i] == '\\') { S1.push(i); } else if (s[...
#include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <stdlib.h> using namespace std; stack<int> S1; stack<pair<int, int>> S2; int area = 0; int main() { string s; cin >> s; int n = s.size(); for (int i = 0; i < n; i++) { if (s[i] == '\\') { S1.push(i); } else if (s[...
[["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]]
1
307
4
#include <algorithm> #include <iostream> #include <stack> #include <vector> using namespace std; int main(int argc, char const *argv[]) { stack<pair<int, char>> S; int section_num = 0; int pool_sum = 0; string input; std::cin >> input; ; vector<pair<int, int>> pools; pools.reserve(20000); for (siz...
#include <algorithm> #include <iostream> #include <stack> #include <vector> using namespace std; int main(int argc, char const *argv[]) { stack<pair<int, char>> S; int section_num = 0; int pool_sum = 0; string input; std::cin >> input; ; vector<pair<int, int>> pools; pools.reserve(20000); for (siz...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19]]
1
464
2
def solve(diagram) area = 0 froms = [] layers = [] (0...diagram.size).each do |x| c = diagram[x] case c when '\\' then froms.push x when '/' then next if froms.empty? from = froms.pop area += 1 area += x - from - 1 layers << [from, x] end end return ar...
def solve(diagram) area = 0 froms = [] layers = [] (0...diagram.size).each do |x| c = diagram[x] case c when '\\' then froms.push x when '/' then next if froms.empty? from = froms.pop area += 1 area += x - from - 1 layers << [from, x] end end return ar...
[["-", 36, 36, 0, 493, 0, 751, 15, 738, 12, 612], ["+", 36, 36, 0, 493, 0, 751, 15, 738, 12, 612]]
4
190
2
# -*- coding: utf-8 -*- count = 0 backslash_index = [] area_pond = [] pending_area=[] for index,symbol in enumerate(input()): if symbol == "\\": backslash_index += [index] elif symbol == '/' and backslash_index: last_bs_index = backslash_index.pop() diff = index - last_bs_index count += diff if area_pond...
# -*- coding: utf-8 -*- count = 0 backslash_index = [] area_pond = [] pending_area=[] for index,symbol in enumerate(input()): if symbol == "\\": backslash_index += [index] elif symbol == '/' and backslash_index: last_bs_index = backslash_index.pop() diff = index - last_bs_index count += diff while area_p...
[["-", 0, 57, 75, 665, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 75, 665, 64, 196, 0, 52, 0, 89]]
5
113
2
section = input( ) depth = 0 area = 0 depthArr = deque( ) areaArr = deque( ) for i, ground in enumerate( section ): if "\\" == ground: depth += 1 depthArr.append( i ) elif 0 < depth and "/" == ground: if len( depthArr ): j = depthArr.pop( ) pool = i - j area += pool while len( areaArr ): preJ...
from collections import deque section = input( ) depth = 0 area = 0 depthArr = deque( ) areaArr = deque( ) for i, ground in enumerate( section ): if "\\" == ground: depth += 1 depthArr.append( i ) elif 0 < depth and "/" == ground: if len( depthArr ): j = depthArr.pop( ) pool = i - j area += pool ...
[["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
174
6
cross_section = input() visited = {0: -1} height = 0 pools = [] for i, c in enumerate(cross_section): if c == '\\': height -= 1 elif c == '/': height += 1 if height in visited: width = i - visited[height] sm = 0 while pools and pools[-1][0] > visited[h...
cross_section = input() visited = {0: -1} height = 0 pools = [] for i, c in enumerate(cross_section): if c == '\\': height -= 1 elif c == '/': height += 1 if height in visited: width = i - visited[height] sm = 0 while pools and pools[-1][0] > visited[h...
[["-", 0, 652, 3, 4, 0, 661, 0, 668, 8, 22], ["+", 0, 652, 3, 4, 0, 661, 0, 668, 8, 22]]
5
146
2
# encoding: utf-8 def calc_area(startIndex, endIndex, terrain): level = terrain[startIndex] area = 0 for i in range(startIndex, endIndex): area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1]) return int(area) def check_area(terrain): i = 0 startIndex = 0 endIndex = ...
# encoding: utf-8 def calc_area(startIndex, endIndex, terrain): level = terrain[startIndex] area = 0 for i in range(startIndex, endIndex): area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1]) return int(area) def check_area(terrain): i = 0 startIndex = 0 endIndex = ...
[["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
5
348
6
# l = open('input.txt').readline() l = input() k = 0 S1, S2 = [], [] for i in range(len(l)): if l[i] == '\\': S1.append(i) elif l[i] == '/': j = S1.pop() a = i - j k += i - j while S2 and S2[-1][0] > j: a += S2.pop()[1] S2.append((j, a)) print(k) pri...
# l = open('input.txt').readline() l = input() k = 0 S1, S2 = [], [] for i in range(len(l)): if l[i] == '\\': S1.append(i) elif l[i] == '/' and S1: j = S1.pop() a = i - j k += i - j while S2 and S2[-1][0] > j: a += S2.pop()[1] S2.append((j, a)) print...
[["+", 8, 196, 0, 57, 75, 665, 15, 679, 17, 355], ["+", 8, 196, 0, 57, 75, 665, 15, 679, 12, 22]]
5
128
2
g = input() l = [] q = [] n = 0 for x in range(len(g)): if g[x] == '\\': if n: l.append(n) n = 0 if q: q.append(-1) q.append(x) elif g[x] == '/': if q: while True: p = q.pop() print(p) ...
g = input() l = [] q = [] n = 0 for x in range(len(g)): if g[x] == '\\': if n: l.append(n) n = 0 if q: q.append(-1) q.append(x) elif g[x] == '/': if q: while True: p = q.pop() if p == -1: ...
[["-", 0, 52, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
161
4
import sys from functools import reduce class Area: def __init__(self, start, end, area): self.start = start self.end = end self.area = area def addArea(self, area): self.area += area if __name__ == "__main__": line = sys.stdin.readline().strip() area_stack = [] ...
import sys from functools import reduce class Area: def __init__(self, start, end, area): self.start = start self.end = end self.area = area def addArea(self, area): self.area += area if __name__ == "__main__": line = sys.stdin.readline().strip() area_stack = [] ...
[["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612]]
5
320
2
def main(): """ ????????? """ S1 = [] # ????????????1(??????????????????) S2 = [] # ????????????2(??????????°´????????????????????¨??¢???) A = 0 # ?????¢??? inp = input() #inp = "\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\" for i in range(len(inp)): if inp[i] == chr(0x5c)...
def main(): """ ????????? """ S1 = [] # ????????????1(??????????????????) S2 = [] # ????????????2(??????????°´????????????????????¨??¢???) A = 0 # ?????¢??? inp = input() #inp = "\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\" for i in range(len(inp)): if inp[i] == chr(0x5c)...
[["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6]]
5
228
2
s = input() St1, St2 = [], [] sumv = 0 for i in range(len(s)): if s[i] == '\\': St1.append(i) elif s[i] == '/' and len(St1) > 0: j = St1.pop() a = i-j sumv += a while len(St2) > 0 and St2[-1][0] > j: a += St2.pop()[1] St2.append([j, a]) St2.insert(...
s = input() St1, St2 = [], [] sumv = 0 for i in range(len(s)): if s[i] == '\\': St1.append(i) elif s[i] == '/' and len(St1) > 0: j = St1.pop() a = i-j sumv += a while len(St2) > 0 and St2[-1][0] > j: a += St2.pop()[1] St2.append([j, a]) St2.insert(...
[["+", 0, 1, 0, 652, 3, 4, 0, 634, 0, 70], ["+", 0, 1, 0, 652, 3, 4, 0, 634, 0, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 634, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 634, 0, 73]]
5
153
4
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { /* InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); */ BufferedReader br = new BufferedReader(new InputStreamReader(System....
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { /* InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); */ BufferedReader br = new BufferedReader(new InputStreamReader(System....
[["-", 8, 527, 0, 520, 0, 1, 0, 11, 17, 107], ["+", 8, 527, 0, 520, 0, 1, 0, 11, 17, 110]]
3
553
2
import java.io.IOException; import java.util.ArrayList; import java.util.LinkedList; import java.util.Scanner; class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.out.println(" "); Scanner scan = new Scanner(System.in); String text = scan.next()...
import java.io.IOException; import java.util.ArrayList; import java.util.LinkedList; import java.util.Scanner; class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.out.println(" "); Scanner scan = new Scanner(System.in); String text = scan.next()...
[["+", 0, 57, 75, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 196, 0, 1, 0, 11, 12, 22], ["+", 64, 196, 0, 57, 75, 196, 0, 1, 0, 35]]
3
553
4
#include <stdio.h> #include <string.h> #define N 20000 typedef struct Data { int area, posi; } Data; Data t[N]; int u[N], n, i, T, U, ans, A; char str1[N + 1]; Data X, Y; void Dpush(Data data) { t[T++] = data; } Data Dpop() { return t[--T]; } void push(int x) { u[U++]; } int pop() { return u[--U]; } void init() { ...
#include <stdio.h> #include <string.h> #define N 20000 typedef struct Data { int area, posi; } Data; Data t[N]; int u[N], n, i, T, U, ans, A; char str1[N + 1]; Data X, Y; void Dpush(Data data) { t[T++] = data; } Data Dpop() { return t[--T]; } void push(int x) { u[U++] = x; } int pop() { return u[--U]; } void init...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 57, 64, 9, 0, 57, 64, 116, 0, 35]]
0
378
4
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n = 0; char c[20002]; int height [20002]; // i番目のマスの左の高さは、height[i-1]。右の高さはheight[i]。height[0]=0 height[0] = 0; //基準の高さ int flood[20002]; //水の体積。1オリジン int floodnum = 0; //池の数 int sum = 0; while (1) { scanf("%c", &...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n = 0; char c[20002]; int height [20002]; // i番目のマスの左の高さは、height[i-1]。右の高さはheight[i]。height[0]=0 height[0] = 0; //基準の高さ int flood[20002]; //水の体積。1オリジン int floodnum = 0; //池の数 int sum = 0; while (1) { scanf("%c", &...
[["-", 75, 76, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 75, 76, 0, 57, 15, 23, 0, 16, 17, 18]]
0
522
2
#include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> #include <vector> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define ...
#include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <stdexcept> #include <stdio.h> #include <string> #include <vector> using namespace std; #define abs(N) ((N > 0) ? N : -1 * N) #define lt(A, B) ((A > B) ? B : A) #define gt(A, B) ((A < B) ? B : A) #define print(S) (cout << S) #define ...
[["-", 0, 52, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 47], ["-", 8, 9, 0, 100, 0, 1, 0, 11, 12, 22], ["+", 0, 100, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 22], ["+", 0, 10...
1
470
8
#include <iostream> #include <stack> #include <vector> using namespace std; typedef struct { unsigned int left; unsigned int area; } AreaInfo_t; #define CalcArea(x, y) ((x) - (y)) stack<unsigned int> ArealeftIdxStack; vector<AreaInfo_t> AreaInfoStack; int Decision(char, unsigned int); void Fusion(AreaInfo_t); ...
#include <iostream> #include <stack> #include <vector> using namespace std; typedef struct { unsigned int left; unsigned int area; } AreaInfo_t; #define CalcArea(x, y) ((x) - (y)) stack<unsigned int> ArealeftIdxStack; vector<AreaInfo_t> AreaInfoStack; int Decision(char, unsigned int); void Fusion(AreaInfo_t); ...
[["-", 0, 99, 8, 9, 0, 100, 0, 37, 0, 13], ["+", 0, 99, 8, 9, 0, 100, 0, 37, 0, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13]]
1
371
21
#include <algorithm> #include <cctype> #include <cmath> #include <iostream> #include <list> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #define LEN 100005 using namespace std; // list実装 // cinだと遅い scanf int main() { stack<int> s1; stack<pair<int, int>> s2; char ch; ...
#include <algorithm> #include <cctype> #include <cmath> #include <iostream> #include <list> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #define LEN 100005 using namespace std; // list実装 // cinだと遅い scanf int main() { stack<int> s1; stack<pair<int, int>> s2; char ch; ...
[["-", 0, 52, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 8, 9, 0, 52, 15, 339, 51, 91, 17, 111], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]]
1
293
5
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> //#include<cmath> using namespace std; int main(void) { int i = 0, sum = 0, k = 0, a, b; string s; stack<int> S; stack<pair<int,...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> //#include<cmath> using namespace std; int main(void) { int i = 0, sum = 0, k = 0, a, b; string s; stack<int> S; stack<pair<int,...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 11...
1
415
9
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n"); var a = Arr[1].split(" ").map(Number); var b = Arr[3].split(" ").map(Number); var cnt = 0; var len = a.length; for (var i = 0; i < b.length; i++) { if (linearSearch(b[i])) cnt++; } console.log(cnt); function line...
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n"); var a = Arr[1].split(" ").map(Number); var b = Arr[3].split(" ").map(Number); var cnt = 0; var len = a.length; for (var i = 0; i < b.length; i++) { if (linearSearch(b[i])) cnt++; } console.log(cnt); function line...
[["-", 0, 52, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 52, 15, 23, 0, 16, 31, 69, 71, 22]]
2
174
2
var countCommonNumber = function(n, s, q, t) { var counter = 0; for (var i = 0; i < n; i += 1) { for (var j = 0; j < q; j += 1) { if (s[i] === t[j]) { counter += 1; break; } } } return counter; }; (function(stdin) { var line = stdin.split('\n'); var n = parseInt(line[0], 10)...
var countCommonNumber = function(n, s, q, t) { var counter = 0; for (var i = 0; i < q; i += 1) { for (var j = 0; j < n; j += 1) { if (t[i] === s[j]) { counter += 1; break; } } } return counter; }; (function(stdin) { var line = stdin.split('\n'); var n = parseInt(line[0], 10)...
[["-", 8, 556, 0, 7, 15, 1, 0, 16, 12, 22], ["+", 8, 556, 0, 7, 15, 1, 0, 16, 12, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 69, 500, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 500, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 69, 500, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 500, 22]]
2
200
8
const config = { input : '/dev/stdin', newline : '\n' }; const line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline); const solve = (arr1, arr2) => arr1.filter(x => arr2.some(y => x == y)).length; const data1 = line[1].split(' ').map(x => parseInt(x)); const data2 = line[3].split(' '...
const config = { input : '/dev/stdin', newline : '\n' }; const line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline); const solve = (arr1, arr2) => arr2.filter(x => arr1.some(y => x == y)).length; const data1 = line[1].split(' ').map(x => parseInt(x)); const data2 = line[3].split(' '...
[["-", 51, 568, 8, 558, 500, 2, 63, 558, 500, 22], ["+", 51, 568, 8, 558, 500, 2, 63, 558, 500, 22], ["-", 3, 3, 0, 568, 8, 2, 63, 558, 500, 22], ["+", 3, 3, 0, 568, 8, 2, 63, 558, 500, 22]]
2
136
4
<?php fscanf(STDIN, '%d', $n); $line = trim(fgets(STDIN)); $S = explode(' ', $line); fscanf(STDIN, '%d', $q); $line = trim(fgets(STDIN)); $T = explode(' ', $line); echo count(array_intersect($S, $T)), PHP_EOL;
<?php fscanf(STDIN, '%d', $n); $line = trim(fgets(STDIN)); $S = array_unique(explode(' ', $line)); fscanf(STDIN, '%d', $q); $line = trim(fgets(STDIN)); $T = explode(' ', $line); echo count(array_intersect($S, $T)), PHP_EOL;
[["+", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["+", 3, 3, 0, 28, 0, 613, 3, 3, 0, 25]]
6
88
3
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //一行目をインプット int n = scan.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = scan.nextInt(); } //二行目をインプット int q =...
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //一行目をインプット int n = scan.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = scan.nextInt(); } //二行目をインプット int q =...
[["-", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 504, 71, 22], ["+", 0, 57, 15, 15, 0, 16, 12, 504, 71, 22]]
3
284
4
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.rea...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.rea...
[["-", 8, 196, 0, 7, 8, 196, 0, 196, 0, 45], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45]]
3
318
2
import java.util.*; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = stdIn.nextInt(); } int q = stdIn.nextInt(); int[] T = new int[q]; for (int i = ...
import java.util.*; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = stdIn.nextInt(); } int q = stdIn.nextInt(); int[] T = new int[q]; for (int i = ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["-", 15, 15, 0, 16, 31, 492, 3, 4, 0, 22], ["-", 15, 15, 0, 16, 31, 492, 3, 4, 0, 21], ["+", 15, 15, 0, 16, 31, 492, 3, 4, 0, 21], ["+", 0, 16, 31, 492, 3, 4, 0, 504, 516, 22]]
3
191
6
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int n, q, i, j, key, ans = 0; Scanner sc = new Scanner(System.in); n = sc.nextInt(); int s[] = new int[n]; for (i = 0; i < n; i++) { s[i] = sc.ne...
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int n, q, i, j, key, ans = 0; Scanner sc = new Scanner(System.in); n = sc.nextInt(); int s[] = new int[n]; for (i = 0; i < n; i++) { s[i] = sc.n...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
201
2
import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; import java.io.*; import java.util.*; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int i, j, n, q, a; ...
import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; import java.io.*; import java.util.*; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int i, j, n, q, a; ...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
241
2
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); /*answer*/ int n, q; int[] s, t; int i, j, c; n = sc.nextInt(); s = new int[n]; for (i = 0; i < n; i++) { s[i] = sc.nextInt(); } q = s...
public class Main { public void run(java.io.InputStream in, java.io.PrintStream out) { java.util.Scanner sc = new java.util.Scanner(in); /*answer*/ int n, q; int[] s, t; int i, j, c; n = sc.nextInt(); s = new int[n]; for (i = 0; i < n; i++) { s[i] = sc.nextInt(); } q = s...
[["-", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 12, 504, 516, 22]]
3
244
4
import java.util.*; class Main { int n, q; int count = 0; int[] S; int[] T; Scanner sc = new Scanner(System.in); void input() { n = sc.nextInt(); S = new int[n]; for (int i = 0; i < n; i++) { S[i] = sc.nextInt(); } q = sc.nextInt(); T = new int[q]; for (int j = 0; j < q;...
import java.util.*; class Main { int n, q; int count = 0; int[] S; int[] T; Scanner sc = new Scanner(System.in); void input() { n = sc.nextInt(); S = new int[n]; for (int i = 0; i < n; i++) { S[i] = sc.nextInt(); } q = sc.nextInt(); T = new int[q]; for (int j = 0; j < q;...
[["-", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 12, 504, 516, 22]]
3
240
4
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { //???????????????????????? BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); /...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { //???????????????????????? BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); /...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
201
2
import java.util.Scanner; public class Main { public static void main(String[] args) { int C = 0; Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = in.nextInt(); } int q = in.nextInt(); int[] T = new int[q]; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { int C = 0; Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] S = new int[n]; for (int i = 0; i < n; i++) { S[i] = in.nextInt(); } int q = in.nextInt(); int[] T = new int[q]; ...
[["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]]
3
208
4
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); String[] inputS = scan.nextLine().split(" "); int q = Integer.parseInt(scan.nextLine()); String[] inputT = scan.nextLine().split(...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); String[] inputS = scan.nextLine().split(" "); int q = Integer.parseInt(scan.nextLine()); String[] inputT = scan.nextLine().split(...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
246
2
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int size = Integer.parseInt(br.readLi...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int size = Integer.parseInt(br.readLi...
[["+", 8, 196, 0, 57, 15, 15, 0, 91, 17, 111]]
3
250
1
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) { s[i] = sc.nextInt(); } int q = sc.nextInt(); int[] t = new int[q]; for (int i = 0...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) { s[i] = sc.nextInt(); } int q = sc.nextInt(); int[] t = new int[q]; for (int i = 0...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
192
2
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n =...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n =...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
251
2
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.setIn(new FileInputStream("./input.txt")); BufferedReader br = new Buff...
import java.io.BufferedReader; // import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.setIn(new FileInputStream("./input.txt")...
[["-", 8, 196, 0, 52, 15, 15, 0, 16, 17, 60], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 17, 79]]
3
264
2
import java.io.BufferedReader; // import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.setIn(new FileInputStream("./ALDS1_4_A-in10.txt")); BufferedR...
import java.io.BufferedReader; // import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.setIn(new FileInputStream("./ALDS1_4_A-in10.txt")); BufferedR...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22]]
3
283
2
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = readInt(r); int[] s = strAryToIntAry(r.readLine().split(" ")); int q = readI...
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = readInt(r); int[] s = strAryToIntAry(r.readLine().split(" ")); int q = readI...
[["-", 15, 15, 0, 16, 12, 504, 71, 27, 0, 29], ["+", 8, 196, 0, 52, 8, 1, 0, 27, 0, 22], ["+", 8, 196, 0, 52, 8, 1, 0, 27, 0, 29]]
3
336
3
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] S = new long[N]; for (int i = 0; i < N; i++) { S[i] = sc.nextLong(); } int Q = sc.nextInt(); int ans = 0; for (int i = 0; i < Q; i++) { ...
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] S = new long[N]; for (int i = 0; i < N; i++) { S[i] = sc.nextLong(); } int Q = sc.nextInt(); int ans = 0; for (int i = 0; i < Q; i++) { ...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
159
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) s[i] = stdIn.nextInt(); int q = stdIn.nextInt(); int[] t = new int[q]; for (int...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) s[i] = stdIn.nextInt(); int q = stdIn.nextInt(); int[] t = new int[q]; for (int...
[["+", 0, 7, 8, 7, 8, 57, 64, 196, 0, 45], ["+", 8, 7, 8, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 7, 8, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 7, 8, 57, 64, 196, 0, 46]]
3
216
4
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { ContestScanner scan = new ContestScanner()...
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { ContestScanner scan = new ContestScanner()...
[["+", 0, 514, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 514, 8, 196, 0, 57, 64, 196, 0, 46]]
3
1,618
4
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; 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[] ss = br.rea...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; 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[] ss = br.rea...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
265
2
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[] S = new int[10001]; // for sentinel int[] T = new i...
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[] S = new int[10001]; // for sentinel int[] T = new i...
[["-", 0, 52, 15, 15, 0, 16, 31, 504, 71, 22], ["+", 0, 52, 15, 15, 0, 16, 31, 504, 71, 22]]
3
282
2
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; class Main { public static void main(String[] args) throws Exception { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine()); String[] strArray = r.readLin...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; class Main { public static void main(String[] args) throws Exception { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(r.readLine()); String[] strArray = r.readLin...
[["-", 0, 195, 8, 196, 0, 503, 49, 200, 141, 22], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 141, 22], ["-", 0, 503, 49, 200, 51, 227, 497, 505, 0, 22], ["+", 0, 503, 49, 200, 51, 227, 497, 505, 0, 22], ["-", 8, 196, 0, 1, 0, 11, 31, 504, 516, 22], ["+", 8, 196, 0, 1, 0, 11, 31, 504, 516, 22], ["-", 8, 498, 0, 195, 8, 196,...
3
365
10
import java.lang.*; import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); String[] line = sc.nextLine().split(" "); int[] data = new int[n]; for (int i = 0; i < n; i++) { data[i] = Integer.pars...
import java.lang.*; import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); String[] line = sc.nextLine().split(" "); int[] data = new int[n]; for (int i = 0; i < n; i++) { data[i] = Integer.pars...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
449
2
import static java.lang.System.out; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int size = (scanner.nextInt()); int[] S = new int[size]; for (int i = 0; i < size; i++) { S[i] = scanner.nextInt(); } i...
import static java.lang.System.out; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int size = (scanner.nextInt()); int[] S = new int[size]; for (int i = 0; i < size; i++) { S[i] = scanner.nextInt(); } i...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
210
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i, j, n, q, count = 0; n = scan.nextInt(); int[] s = new int[n]; for (i = 0; i < n; i++) { s[i] = scan.nextInt(); } q = scan.nextInt(); int[] t = new...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int i, j, n, q, count = 0; n = scan.nextInt(); int[] s = new int[n]; for (i = 0; i < n; i++) { s[i] = scan.nextInt(); } q = scan.nextInt(); int[] t = new...
[["-", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 71, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 504, 71, 22], ["+", 0, 57, 15, 15, 0, 16, 12, 504, 71, 22]]
3
196
4
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main { public static void main(String[] args) { int suretu_kazu = 0; int[] suretu; int bubun_nokazu = 0; int[] bubun; String moji = ""; String[] srt; String[] bbn; int gacchi = 0; ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main { public static void main(String[] args) { int suretu_kazu = 0; int[] suretu; int bubun_nokazu = 0; int[] bubun; String moji = ""; String[] srt; String[] bbn; int gacchi = 0; ...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
311
2
import java.util.Scanner; public class Main { void run() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) s[i] = scan.nextInt(); int q = scan.nextInt(); int[] t = new int[q]; for (int i = 0; i < q; i++) t[i] = s...
import java.util.Scanner; public class Main { void run() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) s[i] = scan.nextInt(); int q = scan.nextInt(); int[] t = new int[q]; for (int i = 0; i < q; i++) t[i] = s...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 22], ["-", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 504, 516, 22], ["...
3
205
8
import java.util.Scanner; public class Main { private static Scanner s; public static void main(String[] args) { s = new Scanner(System.in); int a = s.nextInt(); int[] b = new int[a]; int count = 0; for (int i = 0; i < a; i++) b[i] = s.nextInt(); int c = s.nextInt(); int[] d = new...
import java.util.Scanner; public class Main { private static Scanner s; public static void main(String[] args) { s = new Scanner(System.in); int a = s.nextInt(); int[] b = new int[a]; int count = 0; for (int i = 0; i < a; i++) b[i] = s.nextInt(); int c = s.nextInt(); int[] d = new...
[["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]]
3
190
4
import java.util.Scanner; class Main { public static void main(String[] args) { int i; int j; int k; int count = 0; Scanner scan = new Scanner(System.in); int snum = scan.nextInt(); int S[] = new int[snum]; for (i = 0; i < snum; i++) { S[i] = scan.nextInt(); } int tnum...
import java.util.Scanner; class Main { public static void main(String[] args) { int i; int j; int k; int count = 0; Scanner scan = new Scanner(System.in); int snum = scan.nextInt(); int S[] = new int[snum]; for (i = 0; i < snum; i++) { S[i] = scan.nextInt(); } int tnum...
[["+", 8, 196, 0, 7, 502, 11, 12, 16, 17, 33], ["+", 8, 196, 0, 7, 502, 11, 12, 16, 12, 499], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]]
3
228
6
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (scan.hasNext()) { int n = scan.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) { s[i] = scan.nextInt(); } int q = scan.nextInt...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while (scan.hasNext()) { int n = scan.nextInt(); int[] s = new int[n]; for (int i = 0; i < n; i++) { s[i] = scan.nextInt(); } int q = scan.nextInt...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
202
2
import java.io.*; import java.lang.*; import java.util.*; public class Main { static final int INF = 1000000000; public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); int n, q; n = input.nextInt(); ArrayList<Integer> s = new ArrayList<Integer>(); for...
import java.io.*; import java.lang.*; import java.util.*; public class Main { static final int INF = 1000000000; public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); int n, q; n = input.nextInt(); Set<Integer> s = new HashSet<Integer>(); for (int i ...
[["-", 0, 195, 8, 196, 0, 503, 39, 513, 0, 78], ["+", 0, 195, 8, 196, 0, 503, 39, 513, 0, 78], ["-", 0, 503, 49, 200, 51, 230, 39, 513, 0, 78], ["+", 0, 503, 49, 200, 51, 230, 39, 513, 0, 78]]
3
191
8
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { int n = 0, q = 0; String S_String = "", T_String = ""; int[] S, T; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { n = Integer.parseInt(br.readLine()); S_...
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { int n = 0, q = 0; String S_String = "", T_String = ""; int[] S, T; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { n = Integer.parseInt(br.readLine()); S_...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 35]]
3
418
2
#include <cstdio> #include <iostream> using namespace std; typedef int data_t; typedef struct tag_node { tag_node *before_; data_t data_; tag_node *next_; } node_t; class List { node_t *head_; node_t *FindNodeFromBefore(data_t) const; node_t *FindLastNode(void) const; public: List(void); void Insert...
#include <cstdio> #include <iostream> using namespace std; typedef int data_t; typedef struct tag_node { tag_node *before_; data_t data_; tag_node *next_; } node_t; class List { node_t *head_; node_t *FindNodeFromBefore(data_t) const; node_t *FindLastNode(void) const; public: List(void); void Insert...
[["-", 0, 14, 8, 9, 0, 37, 0, 144, 0, 145], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22]]
1
636
2
#include <bits/stdc++.h> using namespace std; int main() { list<int> li; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { char s[20]; int t; scanf("%s", s); if (s[6] == 0) scanf("%d", &t); if (s[0] == 'i') li.push_front(t); else if (s[6] == 0) for (list<int>::ite...
#include <bits/stdc++.h> using namespace std; int main() { list<int> li; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { char s[20]; int t; scanf("%s", s); if (s[6] == 0) scanf("%d", &t); if (s[0] == 'i') li.push_front(t); else if (s[6] == 0) { for (list<int>::i...
[["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 7, 8, 57, 64, 9, 0, 46]]
1
259
2
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; struct node { int key; node *pre, *nex; }; node *nil; void init() { nil = (node *)malloc(sizeof(node)); nil->nex = nil; nil->pre = nil; } void insert(int key) { node *a = (node *)malloc(sizeof(node))...
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; struct node { int key; node *pre, *nex; }; node *nil; void init() { nil = (node *)malloc(sizeof(node)); nil->nex = nil; nil->pre = nil; } void insert(int key) { node *a = (node *)malloc(sizeof(node))...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
498
4
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define rep(i, n) FOR(i, 0, n) #define DEBUG(x) cout << #x << ": " << x << endl #define vint vector<int> #define vdouble ve...
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define rep(i, n) FOR(i, 0, n) #define DEBUG(x) cout << #x << ": " << x << endl #define vint vector<int> #define vdouble ve...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 14, 8, 9, 0, 1, 0, 35]]
1
425
4
#include "bits/stdc++.h" using namespace std; struct Node { int key; Node *next, *prev; }; Node *nil; Node *listSearch(int key) { Node *cur = nil->next; while (cur != nil && cur->key != key) { cur = cur->next; } return cur; } void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; ni...
#include "bits/stdc++.h" using namespace std; struct Node { int key; Node *next, *prev; }; Node *nil; Node *listSearch(int key) { Node *cur = nil->next; while (cur != nil && cur->key != key) { cur = cur->next; } return cur; } void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; ni...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 104], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
490
6
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *...
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
449
4
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; struct Node { Node *prev, *next; int key; }; Node *Nil; void init() { Nil = (Node *)malloc(sizeof(Node)); Nil->next = Nil; Nil->prev = Nil; } void Insert(int x) { Node *node; node = (Node *)...
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; struct Node { Node *prev, *next; int key; }; Node *Nil; void init() { Nil = (Node *)malloc(sizeof(Node)); Nil->next = Nil; Nil->prev = Nil; } void Insert(int x) { Node *node; node = (Node *)...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
435
7
#include <algorithm> #include <deque> #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; cin.clear(); cin.ignore(); deque<int> dq; string command; int number; for (int i = 0; i < n; i++) { cin >> command; if (command == "insert") { cin >> number;...
#include <algorithm> #include <deque> #include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; cin.clear(); cin.ignore(); deque<int> dq; string command; int number; for (int i = 0; i < n; i++) { cin >> command; if (command == "insert") { cin >> number;...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
222
6
#include <stdio.h> int main() { int n, q, S[10000], T[500], i, j, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (T[i] == S[j]) ...
#include <stdio.h> int main() { int n, q, S[10000], T[500], i, j, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (T[i] == S[j]) { ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
165
4
#include <stdio.h> int linersearch(int *, int, int); #define N 10000 int main() { int i, n, m, key, A[N + 1], c = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf("%d", &key); if (linersearch(A, key, n)) { c++; } } ...
#include <stdio.h> int linersearch(int *, int, int); #define N 10000 int main() { int i, n, m, key, A[N + 1], c = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf("%d", &key); if (linersearch(A, key, n)) { c++; } } ...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 23, 0, 24], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 57, 15, 23, 0, 25], ["-", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38]]
0
194
6
#include <stdio.h> int main() { int a[10000]; int b[10000]; int n, m, i, j, cnt = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf("%d", &b[i]); } for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (a[i] == b...
#include <stdio.h> int main() { int a[10000]; int b[10000]; int n, m, i, j, cnt = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &a[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf("%d", &b[i]); } for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { if (a[j] == b...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 69, 71, 22], ["+", 0, 57, 15, 2...
0
172
10
#include <stdio.h> #include <stdlib.h> #define NMAX 10000 #define QMAX 500 int main(void) { int i, j, n, S[NMAX], q, T[QMAX], C = 0; scanf("%d", &n); if (n > NMAX) exit(1); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); if (q > QMAX) exit(1); for (i = 0; i < q; i++) scanf...
#include <stdio.h> #include <stdlib.h> #define NMAX 10000 #define QMAX 500 int main(void) { int i, j, n, S[NMAX], q, T[QMAX], C = 0; scanf("%d", &n); if (n > NMAX) exit(1); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); if (q > QMAX) exit(1); for (i = 0; i < q; i++) scanf...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 69, 71, 22], ["+", 0, 57, 15, 2...
0
196
10
#include <stdio.h> #define N 10000 int linear(int *, int, int); int main() { int pre, nex, i, cnt = 0; int a[N], b[N]; scanf("%d", &pre); for (i = 0; i < pre; i++) scanf("%d", &a[i]); scanf("%d", &nex); for (i = 0; i < nex; i++) { scanf("%d", &b[i]); cnt += linear(a, b[i], pre); } prin...
#include <stdio.h> #define N 10000 int linear(int *, int, int); int main() { int pre, nex, i, cnt = 0; int a[N], b[N]; scanf("%d", &pre); for (i = 0; i < pre; i++) scanf("%d", &a[i]); scanf("%d", &nex); for (i = 0; i < nex; i++) { scanf("%d", &b[i]); cnt += linear(a, b[i], pre); } prin...
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
0
195
6
#include <stdio.h> int main() { int n[10000], nc, q[500], qc, i, j, count = 0; scanf("%d", &nc); for (i = 0; i < nc; i++) { scanf("%d", &n[i]); } scanf("%d", &qc); for (i = 0; i < qc; i++) { scanf("%d", &q[i]); for (j = 0; j < nc; j++) { if (n[j] == q[i]) { count++; } } ...
#include <stdio.h> int main() { int n[10000], nc, q[500], qc, i, j, count = 0; scanf("%d", &nc); for (i = 0; i < nc; i++) { scanf("%d", &n[i]); } scanf("%d", &qc); for (i = 0; i < qc; i++) { scanf("%d", &q[i]); for (j = 0; j < nc; j++) { if (n[j] == q[i]) { count++; break;...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
0
152
2
#include <stdio.h> #define N 10000 #define Q 500 int num, renum; int LinearS(int *x, int *y) { int rslt = 0, i, j; for (i = 0; i < renum; i++) for (j = 0; j < num; j++) if (*(x + j) == *(y + i)) rslt++; return rslt; } int main() { int i, rslt; int num1[N], num2[Q]; scanf("%d", &num...
#include <stdio.h> #define N 10000 #define Q 500 int num, renum; int LinearS(int *x, int *y) { int rslt = 0, i, j; for (i = 0; i < renum; i++) for (j = 0; j < num; j++) if (*(x + j) == *(y + i)) { rslt++; break; } return rslt; } int main() { int i, rslt; int num1[N], num...
[["+", 0, 7, 8, 7, 8, 57, 64, 9, 0, 45], ["+", 8, 7, 8, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 7, 8, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 7, 8, 57, 64, 9, 0, 46]]
0
199
4
#include <stdio.h> int main() { int n, q, s[10000], t[500], i, j, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &t[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (t[i] == s[j]) { ...
#include <stdio.h> int main() { int n, q, s[10000], t[500], i, j, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &t[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (t[i] == s[j]) { ...
[["-", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
0
170
2
#include <stdio.h> #define NOT_FOUND -1 int A[10000]; int main() { int i, j, n, m, l, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } scanf("%d", &m); int B[m]; for (i = 0; i < m; i++) { scanf("%d", &B[i]); l = linearSearch(n, B[i]); if (l != -1) count++; ...
#include <stdio.h> #define NOT_FOUND -1 int A[10000]; int main() { int i, j, n, m, l, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &A[i]); } scanf("%d", &m); int B[m]; for (i = 0; i < m; i++) { scanf("%d", &B[i]); l = linearSearch(n, B[i]); if (l != NOT_FOUND) co...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 79]]
0
199
4
#include <stdio.h> #define N 10000 #define M 500 int ls(int s[], int n, int key); int main() { int n, q, key; int s[N]; int count = 0; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &key); if (ls(s, n, key))...
#include <stdio.h> #define N 10000 #define M 500 int ls(int s[], int n, int key); int main() { int n, q, key; int s[N]; int count = 0; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &key); if (ls(s, n, key) ...
[["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13]]
0
204
4
#include <stdio.h> #include <stdlib.h> int main() { int i = 0, j, n, q, count = 0; int *S, *T; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); T = (int *)malloc(sizeof(int) * q); for (i = 0; i < q; i++) scanf("%d", &T[i]); ...
#include <stdio.h> #include <stdlib.h> int main() { int i = 0, j, n, q, count = 0; int *S, *T; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); T = (int *)malloc(sizeof(int) * q); for (i = 0; i < q; i++) scanf("%d", &T[i]); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 22], ["-", 8, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 8, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["-", 8, 57, 15, 23, 0, 16, 12, 69, 71, 22], ["+", 8, 57, 15, 2...
0
194
8
#include <stdio.h> int main() { int i, j, k, s, numA, numB, num = 0; scanf("%d", &numA); int retuA[numA]; for (i = 0; i < numA; i++) { scanf("%d", &retuA[i]); } scanf("%d", &numB); int retuB[numB]; for (i = 0; i < numB; i++) { scanf("%d", &retuB[i]); } for (i = 0; i < numB; i++) { ...
#include <stdio.h> int main() { int i, j, k, s, numA, numB, num = 0; scanf("%d", &numA); int retuA[numA]; for (i = 0; i < numA; i++) { scanf("%d", &retuA[i]); } scanf("%d", &numB); int retuB[numB]; for (i = 0; i < numB; i++) { scanf("%d", &retuB[i]); } for (i = 0; i < numB; i++) { ...
[["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["-", 0, 57, 15, 23, 0, 16, 12, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 71, 22]]
0
175
4
#include <stdio.h> #define S 10000 #define T 500 int s[S]; int t[T]; int main() { int i, j, n, q; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &t[i]); for (j = 0; j < i; j++) { if (t[j] == t[i]) i--; ...
#include <stdio.h> #define S 10000 #define T 500 int s[S]; int t[T]; int main() { int i, j, n, q; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &s[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &t[i]); for (j = 0; j < i; j++) { if (t[j] == t[i]) i--; ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
233
4
#include <stdio.h> #define N 10000 int main() { int n1, n2, num1[N], num2[N], i, j, count = 0; scanf("%d", &n1); for (i = 0; i < n1; i++) { scanf("%d", &num1[i]); } scanf("%d", &n2); for (i = 0; i < n2; i++) { scanf("%d", &num2[i]); } for (i = 0; i < n2; i++) { for (j = 0; j < n1; j++...
#include <stdio.h> #define N 10000 int main() { int n1, n2, num1[N], num2[N], i, j, count = 0; scanf("%d", &n1); for (i = 0; i < n1; i++) { scanf("%d", &num1[i]); } scanf("%d", &n2); for (i = 0; i < n2; i++) { scanf("%d", &num2[i]); } for (i = 0; i < n2; i++) { for (j = 0; j < n1; j++...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
0
170
2
#include <stdio.h> #define MAX 1000000 int main() { int i, j = 1, n, q, cou = 0; int S[MAX], key; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &key); for (j = 0, S[n] = key; S[j] != key; j++) ; if (i != n) ...
#include <stdio.h> #define MAX 1000000 int main() { int i, j = 1, n, q, cou = 0; int S[MAX], key; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &key); for (j = 0, S[n] = key; S[j] != key; j++) ; if (j != n) ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22]]
0
154
2
#include <stdio.h> int linearSearch(int n, int key, int *S) { int i = 0; S[n] = key; if (S[0] == key) { return 1; } while (S[i] != key) { i++; } if (i == n) { return 0; } return 1; } int main() { int i, n, q, key, count = 0; int S[10000]; scanf("%d", n); for (i = 0; i < n;...
#include <stdio.h> int linearSearch(int n, int key, int *S) { int i = 0; S[n] = key; if (S[0] == key) { return 1; } while (S[i] != key) { i++; } if (i == n) { return 0; } return 1; } int main() { int i, n, q, key, count = 0; int S[100001]; scanf("%d", &n); for (i = 0; i < ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
197
3
#include <stdio.h> int main(void) { int i, j; int n, q; long S[10000], T[10000]; int count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%ld", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%ld", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { ...
#include <stdio.h> int main(void) { int i, j; int n, q; long S[10000], T[10000]; int count = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%ld", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%ld", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { ...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
170
3
#include <stdio.h> int main(void) { int n, S[10000], q, T[500], C = 0, i = 0, j = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } i = 0; while (i < q) { while (S[j] != T[i]) { j++; if (...
#include <stdio.h> int main(void) { int n, S[10000], q, T[500], C = 0, i = 0, j = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } i = 0; while (i < q) { while (S[j] != T[i]) { j++; if (...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
0
180
4
#include <stdio.h> int main() { int s[100000], t[500], i, j, n, q, ans = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &s[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &t[i]); for (i = 0; i < n; i++) { for (j = 0; j < q; j++) { if (t[j] == s[i]) { ans++; ...
#include <stdio.h> int main() { int s[10000], t[500], i, j, n, q, ans = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &s[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &t[i]); for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (t[i] == s[j]) { ans++; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 69, 71, 22], ["+", 0, 57, 15, 23, 0...
0
165
10
#include <stdio.h> int main(void) { int n, i, q, j; int S[10000]; int T[500]; int c = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &T[i]); for (i = 0; i < n; i++) { for (j = 0; j < q; j++) { if (S[j] == T[i...
#include <stdio.h> int main(void) { int n, i, q, j; int S[10000]; int T[500]; int c = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &T[i]); for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (S[j] == T[i...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
0
169
4
#include <stdio.h> int main() { int s[10001] = {0}; int t[501] = {0}; int x, y, i, j; int count = 0; scanf("%d", &x); for (i = 0; i < x; i++) { scanf("%d", &s[x]); } scanf("%d", &y); for (i = 0; i < y; i++) { scanf("%d", &t[y]); } for (i = 0; i < y; i++) { for (j = 0; j < x; j++...
#include <stdio.h> int main() { int s[10001] = {0}; int t[501] = {0}; int x, y, i, j; int count = 0; scanf("%d", &x); for (i = 0; i < x; i++) { scanf("%d", &s[i]); } scanf("%d", &y); for (i = 0; i < y; i++) { scanf("%d", &t[i]); } for (i = 0; i < y; i++) { for (j = 0; j < x; j++...
[["-", 0, 2, 3, 4, 0, 66, 28, 69, 71, 22], ["+", 0, 2, 3, 4, 0, 66, 28, 69, 71, 22]]
0
180
4
#include <stdio.h> int main() { int i, j, n, q, sum = 0; int S[10000], T[500]; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); for (j = 0; j < q; j++) i = 0; while (S[i] != T[j]) i++; if (i < n) ...
#include <stdio.h> int main() { int i, j, n, q, sum = 0; int S[10000], T[10000]; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &T[i]); for (j = 0; j < q; j++) { i = 0; while (S[i] != T[j]) i++; if (i < n) ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45]]
0
160
4
#include <stdio.h> int linearSearch(int S[], int n, int key) { int i = 0; S[n] = key; while (S[i] != key) { i++; if (i == n) { return 0; } } return i; } int main() { int S[500000], key, i, n, q; int sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); ...
#include <stdio.h> int linearSearch(int S[], int n, int key) { int i = 0; S[n] = key; while (S[i] != key) { i++; if (i == n) { return 0; } } return 1; } int main() { int S[500000], key, i, n, q; int sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13]]
0
183
4
#include <stdio.h> int main(void) { int i, j, N, v, S[10000], T[10000], q; int c = 0; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < N; j++) { if (T[i] ...
#include <stdio.h> int main(void) { int i, j, N, v, S[10000], T[10000], q; int c = 0; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } for (i = 0; i < q; i++) { for (j = 0; j < N; j++) { if (T[i] ...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
0
173
4
#include <stdio.h> int main() { int n, i, j, q, x[10000], y[500], sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &x[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &y[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) ; { if (y[i] =...
#include <stdio.h> int main() { int n, i, j, q, x[10000], y[500], sum = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &x[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &y[i]); } for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (y[i] == x[j]) { ...
[["-", 0, 7, 8, 9, 0, 7, 8, 1, 0, 35], ["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
169
7
#include "stdio.h" int main() { int n, a[10000], m, t[10000], sum = 0, i, k; scanf("%d", &n); for (i = 0; i < n; i++) { scanf(" %d", &a[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf(" %d", &t[i]); for (k = 0; k < n; k++) { if (a[k] = t[i]) sum++; break; } ...
#include "stdio.h" int main() { int n, a[10000], m, t[10000], sum = 0, i, k; scanf("%d", &n); for (i = 0; i < n; i++) { scanf(" %d", &a[i]); } scanf("%d", &m); for (i = 0; i < m; i++) { scanf(" %d", &t[i]); for (k = 0; k < n; k++) { if (a[k] == t[i]) { sum++; break;...
[["-", 8, 9, 0, 57, 15, 23, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
154
4
#include <stdio.h> int main(int argc, char *argv[]) { int S[10000], T[500], n, q, i, j, k, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &T[i]); // for (i = 0; i < n; i++) { k = S[i]; for (j = 0; j < q; j++) ...
#include <stdio.h> int main(int argc, char *argv[]) { int S[10000], T[500], n, q, i, j, k, count = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &S[i]); scanf("%d", &q); for (i = 0; i < q; i++) scanf("%d", &T[i]); // for (i = 0; i < q; i++) { k = T[i]; for (j = 0; j < n; j++) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 57, 15, 23, 0, 16, 31, 69, 28, 22], ["+", 8, 57, 15, 23, 0, ...
0
178
8
#include <stdio.h> #include <stdlib.h> #include <string.h> int linearsearch(int *S, int n, int *T, int q) { int count = 0; for (int j = 0; j < q; ++j) { for (int i = 0; i < n; ++i) { if (T[j] == S[i]) ++count; } } return count; } int main() { int n, q; scanf("%d", &n); int S[n]; ...
#include <stdio.h> #include <stdlib.h> #include <string.h> int linearsearch(int *S, int n, int *T, int q) { int count = 0; for (int j = 0; j < q; ++j) { for (int i = 0; i < n; ++i) { if (T[j] == S[i]) { ++count; break; } } } return count; } int main() { int n, q; scanf(...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
203
4
#include <stdio.h> #include <stdlib.h> int main(void) { int n, q, i, j, count = 0; int *S, *T; scanf("%d", &n); S = (int *)malloc(n * sizeof(int)); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); T = (int *)malloc(q * sizeof(int)); for (i = 0; i < q; i++) { scanf("%d", &T[...
#include <stdio.h> #include <stdlib.h> int main(void) { int n, q, i, j, count = 0; int *S, *T; scanf("%d", &n); S = (int *)malloc(n * sizeof(int)); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); T = (int *)malloc(q * sizeof(int)); for (i = 0; i < q; i++) { scanf("%d", &T[i...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
194
4
#include <stdio.h> int cunt(int s, int *S, int t, int *T) { int i, j; int cnt = 0; for (i = 0; i < t; i++) { for (j = 0; j < s; j++) { if (T[i] == S[j]) cnt++; } } return cnt; } int main(void) { int s, S[10000], t, T[500]; int i; scanf("%d", &s); for (i = 0; i < s; i++) sc...
#include <stdio.h> int cunt(int s, int *S, int t, int *T) { int i, j; int cnt = 0; for (i = 0; i < t; i++) { for (j = 0; j < s; j++) { if (T[i] == S[j]) { cnt++; break; } } } return cnt; } int main(void) { int s, S[10000], t, T[500]; int i; scanf("%d", &s); for (...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
195
4
#include <stdio.h> int main(void) { int n, S[10000], q, T[500], C, i, j; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } C = 0; for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (T[i] == S[j]) ...
#include <stdio.h> int main(void) { int n, S[10000], q, T[500], C, i, j; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &S[i]); } scanf("%d", &q); for (i = 0; i < q; i++) { scanf("%d", &T[i]); } C = 0; for (i = 0; i < q; i++) { for (j = 0; j < n; j++) { if (T[i] == S[j]) { ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
168
4
/* * File: main.c * Author: s1252007 * * Created on June 26, 2018, 11:17 AM */ #include <stdio.h> #include <stdlib.h> /* * */ int linearSearch(int *S, int n, int *T, int q); int main(int argc, char **argv) { int n, q; int *S, *T; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (int i = 0...
/* * File: main.c * Author: s1252007 * * Created on June 26, 2018, 11:17 AM */ #include <stdio.h> #include <stdlib.h> /* * */ int linearSearch(int *S, int n, int *T, int q); int main(int argc, char **argv) { int n, q; int *S, *T; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (int i = 0...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
0
257
4
#include <stdio.h> #include <stdlib.h> int main() { int *S, *T, n, N, C, i, j; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (i = 0; i <= n - 1; i++) { scanf("%d", &S[i]); } scanf("%d", &N); T = (int *)malloc(sizeof(int) * N); for (i = 0; i <= N - 1; i++) { scanf("%d", &T[i]); }...
#include <stdio.h> #include <stdlib.h> int main() { int *S, *T, n, N, C, i, j; scanf("%d", &n); S = (int *)malloc(sizeof(int) * n); for (i = 0; i <= n - 1; i++) { scanf("%d", &S[i]); } scanf("%d", &N); T = (int *)malloc(sizeof(int) * N); for (i = 0; i <= N - 1; i++) { scanf("%d", &T[i]); }...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22]]
0
209
4