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
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #def...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #def...
[["-", 31, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["-", 12, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 16, 12, 16, 12, 22], ["+", 0, ...
1
898
n=int(input()) l=[] for i in range(n): l.append(len(input())) print(len(set(l)))
n=int(input()) l=[] for i in range(n): l.append(input()) print(len(set(l)))
[["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
41
n = int(input()) s = set() for i in range(n): s.insert(input()) print(len(s))
n = int(input()) s = set() for i in range(n): s.add(input()) print(len(s))
[["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22]]
5
36
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int N; cin >> N; set<string> st; string s; rep(i, N) { cin >> s; st.insert(s); } cout << s.size() << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int N; cin >> N; set<string> st; string s; rep(i, N) { cin >> s; st.insert(s); } cout << st.size() << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22]]
1
74
<?php fscanf(STDIN,"%d %d %d %d",$a,$b,$c,$d); while(1){ $c -= $b; if($c<=0){ echo "Yes\n"; exit; } $d -= $a; if($b<=0){ echo "No\n"; exit; } }
<?php fscanf(STDIN,"%d %d %d %d",$a,$b,$c,$d); while(1){ $c -= $b; if($c<=0){ echo "Yes\n"; exit; } $a -= $d; if($a<=0){ echo "No\n"; exit; } }
[["-", 8, 9, 0, 1, 0, 564, 31, 606, 0, 141], ["+", 8, 9, 0, 1, 0, 564, 31, 606, 0, 141], ["-", 8, 9, 0, 1, 0, 564, 12, 606, 0, 141], ["+", 8, 9, 0, 1, 0, 564, 12, 606, 0, 141], ["-", 0, 57, 15, 23, 0, 16, 31, 606, 0, 141], ["+", 0, 57, 15, 23, 0, 16, 31, 606, 0, 141]]
6
74
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define mp make_pair #define pb push_back #define pf push_front #define ss second #define ff first #define sz(x) (int)x.size() #define newl "\n" #define mem(x, val) memset(x, val, sizeof...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; #define mp make_pair #define pb push_back #define pf push_front #define ss second #define ff first #define sz(x) (int)x.size() #define newl "\n" #define mem(x, val) memset(x, val, sizeof...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
368
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, x, y; cin >> a >> b >> c >> d; x = (a + d - 1) / d; y = (b + c - 1) / b; if (x <= y) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, x, y; cin >> a >> b >> c >> d; x = (a + d - 1) / d; y = (b + c - 1) / b; if (x >= y) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
89
import java.util.Scanner; public class Main { static final long MOD = 1000000007; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int A = scan.nextInt(); int B = scan.nextInt(); int C = scan.nextInt(); int D = scan.nextInt(); while (true) { C -= B; ...
import java.util.Scanner; public class Main { static final long MOD = 1000000007; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int A = scan.nextInt(); int B = scan.nextInt(); int C = scan.nextInt(); int D = scan.nextInt(); while (true) { C -= B; ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
134
#include <bits/stdc++.h> using namespace std; int main() { int A, B, C, D; cin >> A >> B >> C >> D; int i = 0; while (A > 0 && C > 0) { if (i % 2 == 0) C -= B; else A -= D; i++; } if (A < 0) cout << "No"; else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; int main() { int A, B, C, D; cin >> A >> B >> C >> D; int i = 0; while (A > 0 && C > 0) { if (i % 2 == 0) C -= B; else A -= D; i++; } if (A <= 0) cout << "No"; else cout << "Yes"; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
87
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int a, b, c, d; cin >> a >> b >> c >> d; int x = ceil((double)c / b); int y = ceil((double)a / d); if (x >= y) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int a, b, c, d; cin >> a >> b >> c >> d; int x = ceil((double)c / b); int y = ceil((double)a / d); if (x <= y) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
84
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <stdio.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<double> vd; typedef pair<int, int> pi; int main() { int a, b, c,...
#include <bits/stdc++.h> #include <iostream> #include <queue> #include <stdio.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<double> vd; typedef pair<int, int> pi; int main() { int a, b, c,...
[["-", 49, 50, 51, 41, 15, 23, 0, 16, 12, 22], ["+", 49, 50, 51, 41, 15, 23, 0, 16, 12, 22]]
1
158
a, b, c, d = map(int, input().split()) import math ao = math.ceil(a / d) taka = math.ceil(c / b) #print(taka, ao) if taka == ao: print('YES') else: if taka > ao: print('NO') else: print('YES')
a, b, c, d = map(int, input().split()) import math ao = math.ceil(a / d) taka = math.ceil(c / b) #print(taka, ao) if taka == ao: print('Yes') else: if taka > ao: print('No') else: print('Yes')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
75
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int INF = 1e9; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; int i = 0; while (!(a > 0 || c > 0)) { if (i % 2 == 0) c -= b; else a -= d; i++; } cout <<...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int INF = 1e9; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; int i = 0; while (a > 0 && c > 0) { if (i % 2 == 0) c -= b; else a -= d; i++; } cout << (a...
[["-", 8, 9, 0, 52, 15, 339, 51, 91, 17, 111], ["-", 0, 52, 15, 339, 51, 91, 28, 23, 0, 24], ["-", 15, 339, 51, 91, 28, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["-", 0, 52, 15, 339, 51, 91, 28, 23, 0, 25]]
1
111
a,b,c,d = map(int,input().split()) for i in range(1,1000): if(i%2!=0): c -= b else: a -= d if(a<=0): print("No") return elif(c<=0): print("Yes") return
a,b,c,d = map(int,input().split()) for i in range(1,1000): if(i%2!=0): c -= b else: a -= d if(a<=0): print("No") break elif(c<=0): print("Yes") break
[["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["-", 0, 57, 75, 665, 64, 196, 0, 37, 0, 38], ["+", 0, 57, 75, 665, 64, 196, 0, 93, 0, 94]]
5
75
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if ((a - 1) / d + 1 >= (c - 1) / b + 1) cout << "yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if ((a - 1) / d + 1 >= (c - 1) / b + 1) cout << "Yes" << endl; else cout << "No" << endl; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
70
#include <iostream> int main() { int a, b, c, d; std::cin >> a >> b >> c >> d; bool isTAK = true; while (a > 0 && c > 0) { if (isTAK) c -= b; else a -= d; } if (a <= 0) std::cout << "No"; else std::cout << "Yes"; return 0; }
#include <iostream> int main() { int a, b, c, d; std::cin >> a >> b >> c >> d; bool isTAK = true; while (a > 0 && c > 0) { if (isTAK) c -= b; else a -= d; isTAK = !isTAK; } if (a <= 0) std::cout << "No"; else std::cout << "Yes"; return 0; }
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 91, 17, 111], ["+", 8, 9, 0, 1, 0, 11, 12, 91, 28, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
85
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long mod = 1e9 + 7; const int iINF = 0x3f3f3f3f; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) typedef long long ll; long long mod = 1e9 + 7; const int iINF = 0x3f3f3f3f; const long long INF = 1LL << 60; using namespace std; template <class T> inline bool chmin(T &a, T b) { ...
[["+", 31, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33]]
1
191
#include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned long long int uint64; typedef long long int int64; #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define ABS(a) ((a) > (0) ? (a) : -(a)) void get_N(int64 *n) { ...
#include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned long long int uint64; typedef long long int int64; #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define ABS(a) ((a) > (0) ? (a) : -(a)) void get_N(int64 *n) { ...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
0
984
/*author : Yashvardhan Sunday, April 26, 2020 5:32 PM */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll #define pb push_back #define vi vector<int> #define pi pair<int, int> #define vpi vector<pi> #define ff first #define ss second #define mp make_pair #define endl '\n' #define al...
/*author : Yashvardhan Sunday, April 26, 2020 5:32 PM */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll #define pb push_back #define vi vector<int> #define pi pair<int, int> #define vpi vector<pi> #define ff first #define ss second #define mp make_pair #define endl '\n' #define al...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
647
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using vll = vector<ll>; using vvll = vector<vector<ll>>; const ll INF = 1e18; #define pu push #define pb push_back #define mp make_pair #define print(x) cout << (x) << endl; #define rep(i, n) for (ll i = ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using vll = vector<ll>; using vvll = vector<vector<ll>>; const ll INF = 1e18; #define pu push #define pb push_back #define mp make_pair #define print(x) cout << (x) << endl; #define rep(i, n) for (ll i = ...
[["-", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
183
import numpy as np import sys import math a , b , c , d = map(int,input().split()) time = c / b w = c % b if w != 0: time += 1 if a - ( (time-1)*d) > 0: print("Yes") else: print("No")
import numpy as np import sys import math a , b , c , d = map(int,input().split()) time = int( c / b ) w = c % b if w != 0: time += 1 if a - ( (time-1)*d) > 0: print("Yes") else: print("No")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
75
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, nu...
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, nu...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
215
A, B, C, D = map(int, input().split()) if (D + B - 1) // B < (A + D - 1) // D: print("Yes") else: print("No")
A, B, C, D = map(int, input().split()) if (C + B - 1) // B <= (A + D - 1) // D: print("Yes") else: print("No")
[["-", 0, 657, 31, 23, 0, 657, 31, 657, 31, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 31, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
55
A,B,C,D = map(int,input().split()) if C % B != 0: ans_A = ((C // B) + 1) else: ans_A = C // B if A % D != 0: ans_C = A // D + 2 else: ans_C = A // D if ans_A <= ans_C: print('Yes') else: print('No')
A,B,C,D = map(int,input().split()) if C % B != 0: ans_A = ((C // B) + 1) else: ans_A = C // B if A % D != 0: ans_C = A // D + 1 else: ans_C = A // D if ans_A <= ans_C: print('Yes') else: print('No')
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
85
#include <bits/stdc++.h> using namespace std; #define REP(i, init, n) for (int i = (int)(init); i < (int)(n); i++) #define vi vector<int> #define vl vector<long> #define vvi vector<vector<int>> #define vvl vector<vector<long>> #define pint pair<int, int> #define plong pair<long, long> int main() { int A, B, C, D; ...
#include <bits/stdc++.h> using namespace std; #define REP(i, init, n) for (int i = (int)(init); i < (int)(n); i++) #define vi vector<int> #define vl vector<long> #define vvi vector<vector<int>> #define vvl vector<vector<long>> #define pint pair<int, int> #define plong pair<long, long> int main() { int A, B, C, D; ...
[["-", 12, 23, 0, 41, 15, 23, 0, 16, 17, 20], ["+", 12, 23, 0, 41, 15, 23, 0, 16, 17, 47], ["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
105
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long using namespace std; int main(void) { int A, B, C, D; cin >> A >> B >> C >> D; while (true) { B -= D; if (B <= 0) { cout << "Yes" << endl; return 0; } ...
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long using namespace std; int main(void) { int A, B, C, D; cin >> A >> B >> C >> D; while (true) { C -= B; if (C <= 0) { cout << "Yes" << endl; return 0; } ...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
99
n=int(input()) d={} for i in range(n): s=str(input()) d.add(s) print(len(d))
n=int(input()) d=set() for i in range(n): s=str(input()) d.add(s) print(len(d))
[["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 45], ["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 46], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
41
import collections N=int(input()) P=[input() for i in range(N)] print(P) c=collections.Counter(P) print(len(c))
import collections N=int(input()) P=[input() for i in range(N)] c=collections.Counter(P) print(len(c))
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
43
#include <bits/stdc++.h> #include <string.h> #define ll long long #include <vector> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> #include <string.h> #define ll long long #include <vector> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
72
s = set() for _ in range(int(input())): s.add(input()) print(*s,'\n',len(s))
s = set() for _ in range(int(input())): s.add(input()) print(len(s))
[["-", 0, 1, 0, 652, 3, 4, 0, 661, 0, 48], ["-", 0, 1, 0, 652, 3, 4, 0, 661, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 652, 3, 4, 0, 557, 0, 6, 0, 44], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
40
N = int(input()) S = [input(i) for i in range(N)] #print(S) ans=set(S) print(len(ans))
N = int(input()) S = [input() for _ in range(N)] #print(S) ans=set(S) print(len(ans))
[["-", 0, 662, 12, 658, 8, 652, 3, 4, 0, 22], ["-", 0, 1, 0, 662, 12, 658, 0, 659, 31, 22], ["+", 0, 1, 0, 662, 12, 658, 0, 659, 31, 22]]
5
37
n = int(input()) x = [input() for i in range(3)] print(len(list(set(x))))
n = int(input()) x = [input() for i in range(n)] print(len(list(set(x))))
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 22]]
5
35
N = int(input()) S = [input() for i in range(N)] # N = 5 # S = ['aa', 'a', 'aa', 'aaaa', 'aa'] C = dict([s,1] for s in S) L = len(C)
N = int(input()) S = [input() for i in range(N)] # N = 5 # S = ['aa', 'a', 'aa', 'aaaa', 'aa'] C = dict([s,1] for s in S) L = len(C) print(L)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
44
import math import collections import fractions import itertools def solve(): n = int(input()) s = [input() for i in range(n)] print(len(s)) return 0 if __name__ == '__main__': solve()
import math import collections import fractions import itertools def solve(): n = int(input()) s = [input() for i in range(n)] print(len(set(s))) return 0 if __name__ == '__main__': solve()
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
54
n = int(input()) ans = [] cnt = 0 for i in range(n): s = input() ans.append(s) ans.sort() for i in range(n-1): if ans[i]!=ans[i+1]: cnt+=1 print(cnt)
n = int(input()) ans = [] cnt = 1 for i in range(n): s = input() ans.append(s) ans.sort() for i in range(n-1): if ans[i]!=ans[i+1]: cnt+=1 print(cnt)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
69
const main = (input) => { const [n, ...v] = input.split('\n') console.log(new Set(v).size) } process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
const main = (input) => { const [, ...v] = input.trim().split('\n') console.log(new Set(v).size) } process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
[["-", 8, 556, 0, 570, 0, 200, 141, 577, 0, 22], ["+", 51, 2, 63, 558, 500, 2, 63, 558, 0, 131], ["+", 51, 2, 63, 558, 500, 2, 63, 558, 559, 560], ["+", 51, 2, 63, 558, 500, 2, 3, 3, 0, 24], ["+", 51, 2, 63, 558, 500, 2, 3, 3, 0, 25]]
2
67
n=int(input()) s=[] for i in range(n): s[i]=str(input()) s=list(set(s)) print(len(s))
n=int(input()) s=[0]*n for i in range(n): s[i]=str(input()) s=list(set(s)) print(len(s))
[["+", 0, 1, 0, 662, 12, 657, 31, 634, 0, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
47
#include <bits/stdc++.h> using namespace std; int main() { int n, i, kotae = 1; cin >> n; string s[n]; for (i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); for (i = 1; i < n; i++) { if (s[i] == s[i - 1]) { kotae++; } } cout << kotae; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, kotae = 1; cin >> n; string s[n]; for (i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); for (i = 1; i < n; i++) { if (s[i] != s[i - 1]) { kotae++; } } cout << kotae; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
100
N = int(input()) S = [] for n in range(N): Sn = str(input()) S.append(Sn) print(S) ans = len(list(dict.fromkeys(S))) print(ans)
N = int(input()) S = [] for n in range(N): Sn = str(input()) S.append(Sn) ans = len(list(dict.fromkeys(S))) print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
56
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { scanInit() n := scanInt() lottery := map[string]bool{} count := 0 for i:= 0; i<n; i++ { s := scan() if _,ok := lottery[s]; !ok { lottery[s] = true count ++ } } fmt.Println(count) } var sc = bufio.NewScanner(os.Stdin) func scanIn...
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { scanInit() n := scanInt() lottery := map[string]bool{} count := 0 for i:= 0; i<n; i++ { s := scan() // fmt.Println(s) if _,ok := lottery[s]; !ok { lottery[s] = true count ++ } } fmt.Println(count) } var sc = bufio.NewScanner(o...
[["+", 8, 196, 0, 1, 0, 2, 63, 438, 439, 22], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 0, 131], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["+", 8, 196, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165]]
7
180
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n, i; int cnt = 1; char S[200000][11]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s", S[i]); } qsort(S, 200000, 11, strcmp); for (i = 1; i < n; i++) { if (strcmp(S[i], S[i - 1]) != 0) ++cnt; } pri...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n, i; int cnt = 1; char S[200000][11]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s", S[i]); } qsort(S, n, 11, strcmp); for (i = 1; i < n; i++) { if (strcmp(S[i], S[i - 1]) != 0) ++cnt; } printf("...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
128
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> vec(N); set<int> se; for (int X = 0; X < N; X++) { cin >> vec.at(X); se.insert(vec.at(X)); } cout << se.size() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<string> vec(N); set<string> se; for (int X = 0; X < N; X++) { cin >> vec.at(X); se.insert(vec.at(X)); } cout << se.size() << endl; }
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]]
1
81
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using Graph = vector<vector<int>>; using ll = long long; int main() { ll n; cin >> n; vector<string> s(n); int count = 0; rep(i, n) { cin >> s[i]; } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using Graph = vector<vector<int>>; using ll = long long; int main() { ll n; cin >> n; vector<string> s(n); int count = 1; rep(i, n) { cin >> s[i]; } ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
142
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); ArrayList<String> S = new ArrayList<String>(); for (int i = 0; i < N; i++) { S.add(sc.next()); } System.out.println(S.size()); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Set S = new HashSet<>(); for (int i = 0; i < N; i++) { S.add(sc.next()); } System.out.println(S.size()); } }
[["-", 0, 195, 8, 196, 0, 503, 39, 513, 0, 78], ["-", 8, 196, 0, 503, 39, 513, 0, 237, 0, 18], ["-", 8, 196, 0, 503, 39, 513, 0, 237, 0, 78], ["-", 8, 196, 0, 503, 39, 513, 0, 237, 0, 47], ["+", 8, 498, 0, 195, 8, 196, 0, 503, 39, 78], ["-", 0, 503, 49, 200, 51, 230, 39, 513, 0, 78], ["+", 0, 503, 49, 200, 51, 230, 39,...
3
98
// Copyright © 2020 Kavish Lodha. All rights reserved. #include <bits/stdc++.h> using namespace std; #define vll vector<long long> #define mll map<long long, long long> #define max(a, b) ((a > b) ? a : b) #define min(a, b) ((a > b) ? b : a) #define pb push_back #define prll pair<long long, long long> typedef long long...
// Copyright © 2020 Kavish Lodha. All rights reserved. #include <bits/stdc++.h> using namespace std; #define vll vector<long long> #define mll map<long long, long long> #define max(a, b) ((a > b) ? a : b) #define min(a, b) ((a > b) ? b : a) #define pb push_back #define prll pair<long long, long long> typedef long long...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
866
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, start, n) for (int i = (int)(start); i < (int)(n); ++i) int N, M; void func() { cin >> N; map<string, int> S; int ans(0); rep(i, 0, N) { string tmp; cin >> tmp; if (S.count(tmp)) break; else { ++ans; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, start, n) for (int i = (int)(start); i < (int)(n); ++i) int N, M; void func() { cin >> N; map<string, int> S; int ans(0); rep(i, 0, N) { string tmp; cin >> tmp; if (!(S.count(tmp))) { ++ans; S[tmp] = 1; ...
[["+", 0, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["-", 8, 9, 0, 9, 0, 57, 64, 93, 0, 94], ["-", 8, 9, 0, 9, 0, 57, 64, 93, 0, 35], ["-", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 25]]
1
109
N = int(input()) prizes = set() unique = 0 for _ in range(N): curr = input() if not prizes: unique += 1 prizes.add(curr) if curr not in prizes: unique += 1 print(unique)
N = int(input()) prizes = set() unique = 0 for _ in range(N): curr = input() if not prizes: unique += 1 prizes.add(curr) if curr not in prizes: prizes.add(curr) unique += 1 print(unique)
[["+", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
55
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); int ans = 1; string prev = s[1]; for (int i = 1; i < n; i++) if (prev != s[i]) { ans++; prev = s[i]; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); int ans = 1; string prev = s[0]; for (int i = 1; i < n; i++) if (prev != s[i]) { ans++; prev = s[i]; } cout << ans; }
[["-", 0, 43, 49, 50, 51, 69, 341, 342, 0, 13], ["+", 0, 43, 49, 50, 51, 69, 341, 342, 0, 13]]
1
107
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; sort(a.begin(), a.end()); for (int i = 0; i < n - 1; i++) { if (a[i] != a[i + 1]) ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } int ans = 0; sort(a.begin(), a.end()); for (int i = 0; i < n - 1; i++) { if (a[i] != a[i + 1]) ans++; } cout << ans + 1 << endl; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
112
n = int(input()) s = [int(input()) for _ in range(n)] ans = set() for i in s: ans.add(i) print(len(ans))
n = int(input()) s = [input() for _ in range(n)] ans = set() for i in s: ans.add(i) print(len(ans))
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["-", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["-", 8, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
48
N = int(input()) d = {} for i in range(N): d[input()] = 0 print(len(dict))
N = int(input()) d = {} for i in range(N): d[input()] = 0 print(len(d))
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
35
#include <bits/stdc++.h> using namespace std; int main() { int n; set<string> S; for (int i = 0; i < n; i++) { string s; cin >> s; S.insert(s); } cout << S.size() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<string> S; for (int i = 0; i < n; i++) { string s; cin >> s; S.insert(s); } cout << S.size() << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
61
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; set<string> S; for (int i = 0; i < n; i++) { string s; cin >> s; S.insert(s); } cout << S.size() << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; set<string> S; for (int i = 0; i < n; i++) { string s; cin >> s; S.insert(s); } cout << S.size() << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
88
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int n; vector<string> name; int answer = 0; cin >> n; string input; for (int i = 0; i < n; i++) { cin >> input; name.push_back(input); } sort(name.begin(), name.end()); for (int i = 0; i < n; i++) { if (i == ...
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int n; vector<string> name; int answer = 0; cin >> n; string input; for (int i = 0; i < n; i++) { cin >> input; name.push_back(input); } sort(name.begin(), name.end()); for (int i = 0; i < n; i++) { if (i == ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
134
#include <stdio.h> #include <stdlib.h> #include <string.h> int compare(const void *a, const void *b) { return strcmp(a, b); } int main(void) { int n; int i; char s[200000][11]; int count = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", s[i]); qsort(s, n, 11, compare); for (i = 0; i < ...
#include <stdio.h> #include <stdlib.h> #include <string.h> int compare(const void *a, const void *b) { return strcmp(a, b); } int main(void) { int n; int i; char s[200000][11]; int count = 0; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%s", s[i]); qsort(s, n, 11, compare); for (i = 0; i < ...
[["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
150
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 1; vector<string> s(n); for (int i = 1; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); for (int i = 1; i < n; i++) { if (s[i - 1] != s[i]) ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 1; vector<string> s(n); for (int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); for (int i = 1; i < n; i++) { if (s[i - 1] != s[i]) ans++; } cout << ans << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
108
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s.begin(), s.end()); int ans = 1; for (int i = 1; i < n; i++) { if (s[i] == s[i - 1]) ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s.begin(), s.end()); int ans = 1; for (int i = 1; i < n; i++) { if (s[i] != s[i - 1]) ans++; } cout << ans << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
110
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; vector<string> s; rep(i, n) cin >> s[i]; set<string> a; rep(i, n) a.insert(s[i]); int ans = a.size(); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; set<string> a; rep(i, n) a.insert(s[i]); int ans = a.size(); cout << ans << endl; }
[["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 24], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 53, 54, 55, 0, 25]]
1
85
N = input() list = [input() for i in range(N)] print(len(set(list)))
N = int(input()) list = [input() for i in range(N)] print(len(set(list)))
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
29
n = gets.to_i s = [] n.times do |i| s << gets.chomp end puts s.count
n = gets.to_i s = [] n.times do |i| s << gets.chomp end puts s.uniq.count
[["+", 0, 652, 3, 4, 0, 652, 486, 652, 735, 22], ["+", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131]]
4
26
N = int(input()) st = set() for _ in range(N): S = input() st.insert(S) print(len(st))
N = int(input()) st = set() for _ in range(N): S = input() st.add(S) print(len(st))
[["-", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 319, 22]]
5
39
#include <bits/stdc++.h> using namespace std; int main() { int n; set<string> s; string ss; while (n--) { cin >> ss; s.insert(ss); } cout << s.size() << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<string> s; string ss; while (n--) { cin >> ss; s.insert(ss); } cout << s.size() << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
52
#include <iostream> #include <set> #include <vector> using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; set<string> st; rep(i, n) { string s; cin >> s; st.insert(s); } cout << st.size() << endl; return 0; }
#include <iostream> #include <set> #include <vector> using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; cin >> n; set<string> st; rep(i, n) { string s; cin >> s; st.insert(s); } cout << st.size() << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
74
n=int(input()) li=[] for si in n: si=input() li.append(si) print(len(set(li)))
n=int(input()) li=[] for si in range(n): si=input() li.append(si) print(len(set(li)))
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]]
5
38
n = int(input()) s = [input() for i in range(n)] ss = sorted(s) test = ss[0] count = 1 for i in range(n): if test != s[i]: test = s[i] count += 1 print(count)
n = int(input()) s = [input() for i in range(n)] ss = sorted(s) test = ss[0] count = 1 for i in range(n): if test != ss[i]: test = ss[i] count += 1 print(count)
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 64, 196, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 206, 51, 22]]
5
66
n=int(intput()) s=set(input() for _ in range(n)) print(len(s))
n=int(input()) s=set([input() for _ in range(n)]) print(len(s))
[["-", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 658, 0, 70], ["+", 0, 662, 12, 652, 3, 4, 0, 658, 0, 73]]
5
30
N = int(input()) S =[input() for i in range(N+1)] s = set(S) print(len(s))
N = int(input()) S =[input() for i in range(N)] s = set(S) print(len(s))
[["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
37
line = readlines len = line.length i = 0 while i < len line[i] = line[i].chomp i += 1 end n = line[0].to_s goods = [] for i in 1..n do goods.push(line[i]) end print goods.uniq.length
line = readlines len = line.length i = 0 while i < len line[i] = line[i].chomp i += 1 end n = line[0].to_i goods = [] for i in 1..n do goods.push(line[i]) end print goods.uniq.length
[["-", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
65
N = int(input()) Ws = [s for _ in range(N)] print(len(set(Ws)))
N = int(input()) Ws = [input() for _ in range(N)] print(len(set(Ws)))
[["-", 0, 656, 0, 1, 0, 662, 12, 658, 8, 22], ["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 25]]
5
30
#include <iostream> #include <map> #include <string> using namespace std; int main() { map<string, int> data; string s; while (getline(cin, s)) { data[s] = 1; } cout << data.size(); }
#include <iostream> #include <map> #include <string> using namespace std; int main() { map<string, int> data; string s; while (getline(cin, s)) { data[s] = 1; } cout << data.size() - 1; }
[["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
53
#include <bits/stdc++.h> using namespace std; #define INF 1000007 #define MOD 1000000007 #define int long long int #define maxn 100 #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a / gcd(a, b)...
#include <bits/stdc++.h> using namespace std; #define INF 1000007 #define MOD 1000000007 #define int long long int #define maxn 100 #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a / gcd(a, b)...
[["-", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
565
import math import time from collections import defaultdict, deque from sys import stdin, stdout from bisect import bisect_left, bisect_right n = int(input()) ans = 0 c = defaultdict(lambda: 0) for _ in n: s = input() if(s in c): ans += 1 c[s] += 1 print(ans)
import math import time from collections import defaultdict, deque from sys import stdin, stdout from bisect import bisect_left, bisect_right n = int(input()) ans = 0 c = defaultdict(lambda: 0) for _ in range(n): s = input() if(s not in c): ans += 1 c[s] += 1 print(ans)
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 699]]
5
71
import java.util.HashSet; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet<Integer> hs = new HashSet<Integer>(); int n = sc.nextInt(); for (int i = 0; i < n; i++) hs.add(sc.nextInt()); System.out.println(hs.size(...
import java.util.HashSet; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet<String> hs = new HashSet<String>(); int n = sc.nextInt(); for (int i = 0; i < n; i++) hs.add(sc.next()); System.out.println(hs.size()); ...
[["-", 8, 196, 0, 503, 39, 513, 0, 237, 0, 78], ["+", 8, 196, 0, 503, 39, 513, 0, 237, 0, 78], ["-", 49, 200, 51, 230, 39, 513, 0, 237, 0, 78], ["+", 49, 200, 51, 230, 39, 513, 0, 237, 0, 78], ["-", 8, 1, 0, 492, 3, 4, 0, 492, 141, 22], ["+", 8, 1, 0, 492, 3, 4, 0, 492, 141, 22]]
3
102
N=int(inout()) S=list(input() for i in range(N)) print(len(set(S)))
N=int(input()) S=list(input() for i in range(N)) print(len(set(S)))
[["-", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22]]
5
33
N = input() List = list(input() for i in range(N)) print(len(set(List)))
N = int(input()) List = list(input() for i in range(N)) print(len(set(List)))
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
30
a = int(input()) ar = [] for i in range(a): ar.append(l) print(len(set(ar)))
a = int(input()) ar = [] for i in range(a): l = input() ar.append(l) print(len(set(ar)))
[["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
36
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> #define rip(i, n) for (int i = 0; i < n; i++) #define ll long long #define lb long double #define vec vector<int> using namespace std; int main() { int n; cin >> n; vector<string> a(n); ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> #define rip(i, n) for (int i = 0; i < n; i++) #define ll long long #define lb long double #define vec vector<int> using namespace std; int main() { int n; cin >> n; vector<string> a(n); ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, ...
1
141
N=int(input()) S=[] for i in range(N): S.append(input()) print(set(S))
N=int(input()) S=[] for i in range(N): S.append(input()) print(len(set(S)))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
35
num = gets.to_i ary = [] num.times do |i| ary += gets.chomp.to_s end puts ary.uniq.length
num = gets.to_i ary = [] num.times do |i| ary[i] = gets.chomp.to_s end puts ary.uniq.length
[["-", 0, 652, 196, 737, 8, 736, 0, 755, 17, 107], ["+", 196, 737, 8, 736, 0, 662, 31, 742, 0, 70], ["+", 196, 737, 8, 736, 0, 662, 31, 742, 0, 22], ["+", 196, 737, 8, 736, 0, 662, 31, 742, 0, 73], ["+", 0, 652, 196, 737, 8, 736, 0, 662, 0, 32]]
4
30
N=int(input()) a=[input() for i in range(N)] print(len(collections.Counter(a)))
import collections N=int(input()) a=[input() for i in range(N)] print(len(collections.Counter(a)))
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
34
N=int(input()) a=[] for i in range(N): a.append(input()) print(len(collections.Counter(a)))
import collections N=int(input()) a=[] for i in range(N): a.append(input()) print(len(collections.Counter(a)))
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int n; set<string> s; string s1; for (int i = 0; i < n; i++) { cin >> s1; s.insert(s1); } cout << s.size(); }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<string> s; string s1; for (int i = 0; i < n; i++) { cin >> s1; s.insert(s1); } cout << s.size(); }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
59
N = int(input()) #1行目のNを取得する s = [input() for i in range(N)] #複数行の数値の入力を取得 print(len(s))
N = int(input()) #1行目のNを取得する s = [input() for i in range(N)] #複数行の数値の入力を取得 print(len(set(s)))
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
31
group = {} for _ in range(int(input())): group.add(input()) print(len(group))
group = set() for _ in range(int(input())): group.add(input()) print(len(group))
[["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 45], ["-", 0, 656, 0, 1, 0, 662, 12, 680, 0, 46], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
32
import sys n = int(input().strip()) items = set() for _ in range(n): items |= {sys.readline().strip()} print(len(items))
import sys n = int(input().strip()) items = set() for _ in range(n): items |= {sys.stdin.readline().strip()} print(len(items))
[["+", 63, 319, 500, 652, 63, 319, 500, 319, 319, 22], ["+", 0, 652, 63, 319, 500, 652, 63, 319, 0, 131]]
5
47
n = int(input()) l = [input() for i in range(n)] l = set(l) l = list(l) print(sum(l))
n = int(input()) l = [input() for i in range(n)] l = set(l) l = list(l) print(len(l))
[["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22]]
5
41
gets.to_i.times.map{gets}.each{|a| a.chomp!}.uniq.count
p gets.to_i.times.map{gets}.each{|a| a.chomp!}.uniq.count
[["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
24
#include <bits/stdc++.h> using namespace std; int main() { int N, t = 0; string s; map<string, int> m; for (int i = 0; i < N; i++) { cin >> s; if (m.count(s)) continue; else { m[s] = 1; t++; } } cout << t << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, t = 0; cin >> N; string s; map<string, int> m; for (int i = 0; i < N; i++) { cin >> s; if (m.count(s)) continue; else { m[s] = 1; t++; } } cout << t << endl; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
80
n = int(input()) s = [] for _ in range(n): s.append(int(input)) print(len(set(s)))
n = int(input()) s = [] for _ in range(n): s.append(input()) print(len(set(s)))
[["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24]]
5
39
n = int(input()) slist = [] for i in range(n): news = str(input()) slist.append(news) # print(slist) slist_u = list(set(slist)) print(slist_u) slist_u_len = len(slist_u) print(slist_u_len)
n = int(input()) slist = [] for i in range(n): news = str(input()) slist.append(news) # print(slist) slist_u = list(set(slist)) # print(slist_u) slist_u_len = len(slist_u) print(slist_u_len)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
58
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Set<String> set = new HashSet<>(); for (int i = 0; i < n; i++) { set.add(sc.nextLine()); } s...
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); Set<String> set = new HashSet<>(); for (int i = 0; i < n; i++) { set.add(sc.nextLi...
[["+", 8, 196, 0, 503, 49, 200, 51, 492, 500, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 0, 131], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 24], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 49, 200, 51, 492, 3, 4, 0, 492, 141, 22], ["+", 51, 492, 3, 4, 0, 49...
3
117
fgets(STDIN); $arr = []; while ($line = fgets(STDIN)) { $arr[trim($line)] = 0; } echo count($arr);
<?php fgets(STDIN); $arr = []; while ($line = fgets(STDIN)) { $arr[trim($line)] = 0; } echo count($arr);
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
42
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; set<string> s; for (int i = 0; i < n; i++) { string t; cin >> t; s.insert(t); } cout << s.size() << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; set<string> s; for (int i = 0; i < n; i++) { string t; cin >> t; s.insert(t); } cout << s.size() << "\n"; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
80
n=int(input()) string_list=[input() for i in range(n)] print(len(string_list))
n=int(input()) string_list=[input() for i in range(n)] print(len(set(string_list)))
[["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
29
N = int(input()) S = [] for i in range(N): S.append(input()) set_S = list(set(S)) len(set_S)
N = int(input()) S = [] for i in range(N): S.append(input()) set_S = list(set(S)) print(len(set_S))
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
41
N = int(input()) r = set() for i in range(N): r |= set(input()) print(len(r))
N = int(input()) r = set() for i in range(N): r |= set([input()]) print(len(r))
[["+", 0, 677, 12, 652, 3, 4, 0, 634, 0, 70], ["+", 0, 677, 12, 652, 3, 4, 0, 634, 0, 73]]
5
36
import collections n=int(input()) s_list=list(input() for _ in range(n)) c=collections.Ceounter(s_list) print(len(c.keys()))
import collections n=int(input()) s_list=list(input() for _ in range(n)) c=collections.Counter(s_list) print(len(c.keys()))
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
44
n=int(input()) s=[list(input()) for _ in range(n)] t=list(set(s)) print(len(t))
n=int(input()) s=[input() for _ in range(n)] t=list(set(s)) print(len(t))
[["-", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["-", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["-", 8, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
41
#include <bits/stdc++.h> using namespace std; #define ll long long map<string, int> a; //映射 int main() { int n, num = 0; string s; for (int i = 1; i <= n; i++) { cin >> s; if (a[s] == 0) { num++; a[s]++; } else a[s]++; } cout << num; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long map<string, int> a; //映射 int main() { int n, num = 0; string s; cin >> n; for (int i = 1; i <= n; i++) { cin >> s; if (a[s] == 0) { num++; a[s]++; } else a[s]++; } cout << num; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
88
const main = input => new Set(input.split("\n").slice(1)).size console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));
const main = input => new Set(input.trim().split("\n").slice(1)).size console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));
[["+", 500, 2, 63, 558, 500, 2, 63, 558, 559, 560], ["+", 500, 2, 63, 558, 500, 2, 3, 3, 0, 24], ["+", 500, 2, 63, 558, 500, 2, 3, 3, 0, 25], ["+", 0, 2, 63, 558, 500, 2, 63, 558, 0, 131]]
2
50