prompt
string
response
string
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define krep(i,k,n,m) for(int i=k;i<n;i+=m) #define erep(i,k,n) for(int i=k;i<n;i++) #define mod 1000000007; //最大公約数 int gcd(int s,int b){ if(b==0)return s; return gcd(b,s%b); } signed main(){ int n; ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#pragma comment (linker, "/STACK:256000000") #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++) #define rep(i,n) FOR(i,0,n) using namespace std; typedef long long ll; int main(){ int n,ans=0; string s; cin>>n; rep(i,n){ cin>>s; if(s=="E869120")ans++; } cout<<ans<<endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define int long long #define pie 3.141592653589793238462643383279 #define mod 1000000007 #define INF LLONG_MAX/5 #define all(v) v.begin(),v.end() #define P pair<int,int> #define S second #define F first #define f(i,n) for(int i=0;i<n;i++) int mypow(int a,int b,int c){ if(...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i,n) for (int i=0;i<(int)(n);i++) #define codefor int test;scanf("%d",&test);while(test--) #define yn(ans) cout<<(ans?"Yes":"No")<<endl #define YN(ans) cout<<(ans?"YES":"NO")<<endl #define umap unordered_map #def...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#define _USE_MATH_DEFINES #include<iostream> #include<string> #include<queue> #include<cmath> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<random> #include<functional> #include<algorithm> #include<stack> #include<cstdio> #include<cstring> #include<bitset> #include<unordered_map...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main(){ int n, ans = 0; string s[2000]; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; if (s[i] == "E869120") { ans++; } } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
a=0 for i in range(int(input())): if input()=="E869120": a+=1 print(a)
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<algorithm> #include<cmath> #define int long long using namespace std; #define rep(s,i,n) for(int i=s;i<n;i++) #define c(n) cout<<n<<endl; string s[214514]; signed main(){ int n; cin>>n; int ans=0; rep(0,i,n){ cin>>s[i]; if(s[i]=="E869120")ans++; } c(ans) }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
n = int(input()) s = [input()for i in range(n)] count = 0 for i in s: if i == 'E869120': count +=1 print(count)
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <queue> #include <algorithm> // sort #include <math.h> #define DEBUG 0 #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll mod = 1000000007; static const ll INF = 1000000000000000000LL; ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
// // Created by yamunaku on 2019/12/29. // #include <bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) #define repl(i, l, r) for(int i = (l); i < (r); i++) #define per(i, n) for(int i = ((n)-1); i >= 0; i--) #define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--) #define all(x) (x...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //#include <boost/multiprecision/cpp_int.hpp> //typedef boost::multiprecision::cpp_int ll; typedef long double dd; #define i_7 (ll)(1E9+7) //#define i_7 998244353 #define i_5 i_7-2 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; return c+i_7; }...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <algorithm> #include <math.h> #include <queue> #include <map> #include <iomanip> using namespace std; typedef long long ll; int main() { int n; cin >> n; int ans = 0; for (int i = 0; i < n; i++) { string s; cin >> s; ans += (s == "E...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define REP(i,a,b) for (int i = a; i < (b); ++i) #define all(x) (x).begin(),(x).end() const int INF = 1000000007; typedef long long ll; using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) {...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <stdio.h> #include <string> #define llint long long using namespace std; llint n; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; string s; llint ans = 0; for(int i = 1; i <= n; i++){ cin >> s; if(s == "E869120") ans++; } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> #in...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<string> #include<vector> #include<cmath> #include<algorithm> #include<set> #include<stdio.h> #include<ctype.h> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 0; i < n; i++) { string s; cin >> s; if (s == "E869120") { ans++; } } cout << ans <<...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
// _/ _/ _/_/_/ _/ //_/_/_/_/ _/_/ _/_/_/_/ _/_/ _/ _/_/ // _/ _/ _/ _/ _/ _/ _/_/_/ _/ //_/ _/ _/ _/ _/ _/ _/ _/ _/ // _/_/ _/_/ _/_/ _/_/ _/_/ _/ #include<iostream> #include<algorithm> #include<cmath> #incl...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; const ll INF = 1e14; const ll MOD = 1000000007; const double PI = 3.1415926535897; signed main() { int N; cin >> N; vector<string> vec(N); for(int i = 0;i < N;i++) { cin >> vec.at(i); } int ret =...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < n; i++) #define int long long signed main(signed argc, char* argv[]) { ios::sync_with_stdio(false); cin.tie(nullptr); int n; map<string,int> s; cin>>n; rep(i,n){ string st; cin>>st; s[st]++...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<string> #include<algorithm> #include<cmath> #include<map> #include<vector> #include<math.h> #define int long long using namespace std; signed main() { int n, ans = 0; string s; cin >> n; for (int h = 0; h < n; h++) { cin >> s; if (s == "E869120") { ans++; } } cout << ans << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin >> n; int ans = 0; for(int i=0; i<n; i++){ string s; cin >> s; if(s == "E869120"){ ans++; } } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
n = int(input()) s = [input() for i in range(n)] print(s.count("E869120"))
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define INF 1000000000000000000 #define MOD 1000000007 typedef pair<int, int> P; bool prime(int n) { for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0)return false; } return n != 1...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <array> #include <list> #include <string> #include <stack> #include <queue> #include <deque> #include <unordered_map> #include <unordered_set> #include <tuple> #include <memory> #include <cmath> #include <algorithm> #include <functional> #include <iomanip> #include <numeri...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int ans=0; for(int i=0;i<n;i++)if(sc.next().equals("E869120"))ans++; System.out.println(ans); } }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<algorithm> #include<bitset> #include<cassert> #include<cfloat> #include<climits> #include<cmath> #include<deque> #include<functional> #include<iomanip> #include<iostream> #include<map> #include<queue> #include<set> #include<stack> #include<string> #include<unordered_map> #include<unordered_set> #include<utilit...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //#include <boost/multiprecision/cpp_int.hpp> //typedef boost::multiprecision::cpp_int ll; typedef long double dd; #define i_7 (ll)(1E9+7) //#define i_7 998244353 #define i_5 i_7-2 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; return c+i_7; }...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
// #define _GLIBCXX_DEBUG // for STL debug (optional) #include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define VSORT(v) sort(v.begin(), v.end()) #define VRSORT(v) sort(v.rbegin(), v.rend()) #define ll long long using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; //typedef vector<unsi...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int,int> #define ll long long #define pal pair<double,double> #define ppap pair<pa,int> #define PI 3.14159265358979323846 #define paa pair<int,char> #define mp make_...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <string> using namespace std; string e = "E869120"; int main(){ int i,n,c = 0; cin >> n; for(i=0;i<n;i++){ string s; cin >> s; if(s==e) c++; } cout << c << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} struct FastIO{ FastIO(){ cin.tie(0); ios::sync_with_stdio(0); } }fastio_beet; //I...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include "iostream" using namespace std; int main() { string flag = "E869120"; int n; cin >> n; int ans = 0; for (int i = 0; i < n; ++i) { string s; cin >> s; ans += s == flag; } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#ifndef __cplusplus cat << EOF #endif #include <bits/stdc++.h> using namespace std; #define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__) #define rep_0(i, end) for(int i = 0; i < (end); ++i) #define rep_1(i, fr, ba) for(int i = (fr); i <= (ba); ++i) #define overload_rep(arg0, arg1, arg2, name, ...)...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define MOD 1000000007 #define INF 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define req(i, j, n) for(int i = j; i <= (int)(n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int n; cin>>n; in...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) typedef long long ll; typedef pair<int,int> P; int main(){ int n,ans=0; cin>>n; string s="E869120",t; rep(i,n){ cin>>t; if(s==t) ans++; } cout<<ans<<"\n"; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint mod = 998244353; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) template<class T> inline void YES(T condi...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#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; for (int i = 0; i < n; i++) { if (a[i] == "E869120") { ans++; } } cout << ans << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double signed main() { int n, cnt = 0; cin >> n; while (n--) { string s; cin >> s; if (s == "E869120") ++cnt; } cout << cnt << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } int main() { int n = ri(); int res = 0; for (int i = 0; i < n; i++) { std::string s; std::cin >> s; if (s == "E869120") res++; } std::cout << res << std::endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; int ans = 0; for(int i = 0; i < n; i++){ string s; cin >> s; if(s == "E869120"){ ans++; } } cout << ans << endl; ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define For(i,a,b) for(int (i) = (a);(i) < (b);i++) #define Rep(i,n) For((i),0,(n)) #define All(a) (a).begin(),(a).end() #define sp " " #define INF 1e18 #define INT_INF 1e9 #define MAX 1000 typedef long long ll; const ll MOD = 1000000007; const ll MOD_9 = 998244353; int ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <unordered_map> #include <climits> #include <set> #include <unordered_set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility>...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <iomanip> using namespace std; int main(){ int n;cin>>n; string a[n]; for(int i = 0; n > i; i++){ cin>>a[i]; } int ans = 0; for(int i = 0; n > i; i++){ if(a[i] == "E869120")ans++; } cout << ans << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
N=int(input()) S=[] for i in range(N): S.append(str(input())) print(S.count("E869120"))
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
/* おまじない */ #include <bits/stdc++.h> #pragma GCC optimize("Ofast") typedef long long ll; typedef long double ld; using namespace std; const ll MOD=pow(10,9)+7; const ll INF=(1LL<<62); const int dx[4]={0,1,0,-1}; const int dy[4]={1,0,-1,0}; const int ddx[8]={1,0,-1,-1,-1,0,1,1}; const int ddy[8]={1,1,1,0,-1,-1,-1,0}; vo...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int ans=0; for(int i=0;i<N;i++){ string s; cin>>s; if(s=="E869120") ans++; } cout<<ans<<endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int ans=0; for(int i=0;i<n;i++){ string s; cin>>s; if(s=="E869120")ans++; } cout<<ans<<endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
def num(): return int(input()) def nums(): return list(map(int,input().split())) """ A,B = nums() P,Q,R = nums() first_distance = P * B pre_runned = (B - A) * Q time = B + (first_distance - pre_runned) / (R + Q) print(time) """ """ N = num() randoms = nums() ans = 0 for i in range(N): today = randoms[i] ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int ans = 0; while(N--){ string s; cin >> s; if(s == "E869120") ans++; } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> using namespace std; int main(){ int n; cin >> n; int ret = 0; while(n--){ string s; cin >> s; ret += s == "E869120"; } cout << ret << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; typedef long long ll; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); ll n; cin>>n; string s; int ans = 0; for(int i=0;i<n;i++){ cin>>s; if(s=="E869120") ans++; } cout ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
from itertools import * from bisect import * from math import * from collections import * from heapq import * from random import * import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.rea...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <cstdio> #include <cstdint> #include <vector> #include <algorithm> #include <utility> #include <numeric> #include <set> #include <map> #include <tuple> #include <string> int main() { size_t n; scanf("%zu", &n); int res = 0; for (size_t i = 0; i < n; ++i) { char buf[128]; scanf("%s", buf); ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<algorithm> #include<string> #include<vector> #include<cmath> #include<map> #include<iomanip> #include<queue> #include<stack> #include<time.h> #define rep(i,n)for(int i=0;i<n;i++) #define int long long #define ggr getchar();getchar();return 0; #define prique priority_queue #define mod 1000000...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <iomanip> using namespace std; int main() { int n; cin >> n; int ret = 0; for (int i = 0; i < n; i++) { string s; cin >> s; if (s == "E869120")ret++; } cout << ret << endl; return ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; #define M 100000 int main(){ int n,i,c=0; string s; cin>>n; for(i=0;i<n;i++){ cin>>s; if(s=="E869120")c++; } cout<<c<<endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
nin = [] for i in range(int(input())): s = input() nin.append(s) print(nin.count("E869120"))
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(vec) (vec).begin(),(vec).end() #define int long long signed main(){ int n;cin>>n; int ans=0; rep(i,n){ string s;cin>>s; if(s=="E869120")ans++; } cout<<ans<<endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <algorithm> #include <utility> #include <string> #include <queue> #include <stack> using namespace std; typedef long long int ll; typedef pair<int, int> Pii; const ll mod = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; ve...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String target = "E869120"; int count = 0; for (int i = 0; i < n; i++) { if (target.equals(sc.next())) { cou...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> #include <map> #include <queue> #include <iomanip> #include <set> #include <tuple> #define mkp make_pair #define mkt make_tuple #define rep(i,n) for(int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const ll ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<stack> #include<list> #include<set> #include<string> #include<iomanip> #include<math.h> #include<bitset> #include<functional> using namespace std; typedef long long ll; #define lscan(x) scanf("%I64d",&x); #define lprint(x) printf("%I64d",x...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<string> using namespace std; int a; string s[10000]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i]; } for (int i = 0; i < n; i++) { if (s[i] == "E869120") { a++; } } cout << a << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define whlie while #define pb push_back #define eb emplace #define fi first #define se second #define rep(i,N) for(int i = 0; i < (N); i++) #define repr(i,N) for(int i = (N) - 1; i >= 0; i--) #define rep1(i,N) for(int i = 1; i <= (N) ; i++) #define repr1(i,N) for(int i = (N) ; i > 0 ; i--) #de...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
n = int(input()) ans = 0 for i in range(n): if input() == 'E869120': ans += 1 print(ans)
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; using ll=long long; #define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b second ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; typedef long long int ll; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; int ans=0; vector<string> s(n); for(int i=0;i<n;i++){ cin >> s[i]; if(s[i]=="E869120") ans++; } cout << ans <<...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { int N, count = 0; cin >> N; for (int i = 0; i < N; i++) { string A; cin >> A; if (...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<set> #include<unordered_map> using namespace std; typedef long long ll; #define chmax(a,b) a=max(a,b) #define chmin(a,b) a=min(a,b) #define mod 1000000007 #define mad(a,b) a=(a+b)%mod #define N 200010 int main(){ cin.tie(0); ios::s...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF 1000000010 #define EPS 1e-9 #define fst first #define scd second #define debug(x) cout<<x<<endl; #define repi(i,x,n) for(int i=x;i<n;i++) #define rep(i,n) repi(i,0,n) #define lp(i,n) repi(i,0,n) #define repn(i,n) for(int i=n;i>=0;i--) #def...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; vector<string> S(N); for (int i = 0; i < N; ++i) cin >> S[i]; int ans = 0; for (int i = 0; i < N; ++i) if (S[i] == "E869120") ++ans; cout << ans << endl; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; #define rep(i, n) for(ll i = 0;i < n;i++) #define all(i) i.begin(), i.end() template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 99999999999999999 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; int main(){ int N; scanf("%d",&N); const string pattern = "E869120"; int ans = 0; string tmp;...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <functional> #include <iomanip> #include <stdlib.h> #include <string.h> #include <cstring> #include <cmath> #include <map> #include <queue> #include <deque> #include <stack> #include <set> #include <stdio.h> #include...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans=0; while(n--) { string s; cin >> s; if(s=="E869120") ++ans; } cout << ans << endl; return 0; }
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<set> #include<queue> #include<stack> #include<bitset> #include<functional> #include<map> #include<iomanip> #include<limits> #include<unordered_set> #include<cmath> using namespace std; //long long p = 998244353; long long p = 1000000007;...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; using ll = long long; template<class T,class U> using P = pair<T,U>; template<class T> using vec = vector<T>; template<class T> using vvec = vector<vec<T>>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; string name = "E869120"; ...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <cstdio> #include <iostream> #include <string> using namespace std; int imap[301][301]; int main(void){ string base = "E869120"; string str; int n, sum = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> str; if (str.size() == base.size() && str == base) { sum+...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef pair<int,int>P; const int INF=0x3f3f3f3f; const ll INFL=0x3f3f3f3f3f3f3f3f; const int MOD=1000000007; int main(){ int n;cin>>n; int cnt=0; rep(i,n){ string s;cin>>s; if(s=="E869120")cnt++; } cou...
Problem: Increasing E869120 (Ninja E869120) E869120 You are good at alter ego. Here are $ N $ members of the PA Lab. But some of them may be E869120. So you asked all the $ N $ members of the PA Lab for their names. As a result, the $ N $ members named themselves $ S_1, S_2, S_3, \ dots, S_N $, respectively. E86912...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define P pair<int,int> #define fi first #define se second #define rep(i,n) for(int i=0;i<n;i++) #define INF 1000000000000000000 #define MOD 1000000007 #define all(v) v.begin(),v.end() #define pb push_back int dx[]={0,1,0,-1},dy[]=...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n,k; cin>>n>>k; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; int ans=n+1; int x[k]; memset(x,0,sizeof(x)); int cnt=0; int l=0; for(int i=0;i<n;i++){ //cout<<i<<" "<<a[i]<<":"<<cnt<<endl; a[i]--; if(a[i]>=k...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <bits/stdc++.h> using namespace std; // returns min(x : where As[i:i+x) contains all the elements of [1..K]) int smallest_window(int K, vector<int> As){ vector<int> freq(K + 1, 0); int t = K; int record = As.size() + 10; int tail = 0; for (int head = 0; head < As.size(); ++head){ ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <iostream> #include <algorithm> #include <vector> #include <string> #define int long long using namespace std; int n, k, a[123456], b[123456]; signed main() { cin >> n >> k; for (int i = 0; i < n; i++)cin >> a[i]; int f = 0, l = 0, ans = n + 1, sum = 0; while (f < n) { while (sum < k && l < n) { if (a...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <iostream> using namespace std; int main() { int n,k,cnt = 0,j = 0,len = __INT_MAX__; cin >> n >> k; int a[n],ans[n],flag[n + 1]; for(int i = 0;i < n;++i){ cin >> a[i]; ans[i] = flag[i] = 0; } flag[n] = 0; for(int i = 0;i < n;++i){ flag[a[i]]++; ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; int a[100000]; int cnt[200000]; int main(){ int n,k;scanf("%d%d",&n,&k); rep(i,n)scanf("%d",&a[i]); int g=0; set<int>se; int ans=INT_MAX; rep(i,n){ while(g<n&&se.size()<k){ if(a[g]>k){g++;continue;} ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { int n,k; cin >> n >> k; vector<int> a(n); for(int i =0 ;i<n;i++)cin >> a[i]; vector<int> col(k+1); int sum = 0; queue<int> Q; int ans = n+1; for(int i = 0;i<n;) { //cout<<sum<<';'<<i<<endl; if(sum<k) { if(a[i]<=k&&col[a[...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <cstdio> #include <vector> using namespace std; int v[100005], b[100005] = { 0 }; int main() { int N, K, R = 0, k = 0; scanf("%d%d", &N, &K); for (int i = 0; i < N; i++) scanf("%d", &v[i]); int start = 0, stop = 0; for (;;) { for (; stop < N && k < K; stop++) { if (v[stop] <= K && ++b[v[stop]] == 1)k...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<m...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include<bits/stdc++.h> using namespace std; signed main(){ int n,k; cin>>n>>k; vector<int> a(n); for(auto& ai:a)cin>>ai; int ans = n+1; int l=0,r=0; set<int> st; map<int,int> mp; for(;l<n;++l){ bool f = (r<n)&&(st.size()!=k); while(f){ if(a[r]<=k)st.emplace(a[r]); mp[a[r]]++; ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include<iostream> #include<cstdio> #include<algorithm> #include<map> #include<string> #include<vector> #include<climits> #define MAX 100001 int n,k; int a[MAX]; using namespace std; void solve(){ int ans=n+1; int l=0,r=0; map<int,int> m; while(1){ while(r<n&&m.size()<k){ if(a[r]<=k) m[a[r]]++; r++; }...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1 << 30; void solve(){ int N, K; cin >> N >> K; vector<int> A(N); for(int i=0;i<N;i++){ cin >> A[i]; } vector<int> cnt(K+1); int ans = INF, s=0; for(int l=0,r=0;l<N;l++){ while(r<N && s<K){ if...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> counts(k + 1, 0); vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } int total = 0; int ans = 1000000000; for (int l ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <bits/stdc++.h> using namespace std; using i64 = int64_t; using vi = vector<i64>; using vvi = vector<vi>; int main() { int n, k; cin >> n >> k; vi as(n); for (int i = 0; i < n; i++) { cin >> as[i]; } set<int> s; multiset<int> ss; int l = 0, r = 0; int minwidth = 1e...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <stdio.h> #include <cmath> #include <algorithm> #include <cfloat> #include <stack> #include <queue> #include <vector> #include <string> #include <iostream> #include <set> #include <map> #include <time.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 100000...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0; i<n; i++) #define rrep(i, n) for(int i=n-1; i>=0; i--) #define FOR(i, a, b) for(int i=a; i<b; i++) #define ALL(v) v.begin(),v.end() #define pb push_back #define eb emplace_back #define mp make_pair typedef long long ll; typedef pair<int, int> p...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
class SegmentTree(): def __init__(self, arr, func=min, ie=2**63): self.h = (len(arr) - 1).bit_length() self.n = 2**self.h self.ie = ie self.func = func self.tree = [ie for _ in range(2 * self.n)] for i in range(len(arr)): self.tree[self.n + i] = arr[i] ...
Problem: For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and an integer $K$, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains all integers in range [$1, 2, ..., K$]. If there is no such sub-array, report 0. Constraints * $1 \leq N \leq 10^5$ * $1 \leq...
#include <cmath> #include <iostream> #include <vector> #include <queue> #include <deque> #include <map> #include <set> #include <stack> #include <tuple> #include <bitset> #include <algorithm> #include <functional> #include <utility> #include <iomanip> #define int long long int #define rep(i, n) for(int i = 0; i < (n);...