submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s602375863
p03761
C++
#include <iostream> #include <unordered_map> #include <vector> #include <map> #include <set> #include <algorithm> #define ll long long #define pr pair<int,int> #define all vec.begin(),vec.end() #define REP(i,a,b) for (int i = a; i < b; i++) #define fi first #define se second #define pushb push_back #define makep make_pair using namespace std; int main(){ int size; cin >> size; string arr[size]; int ch[size][26]; memset(ch,0,sizeof(ch)); string k; for(int i = 0; i < size; i++){ cin >> k; for(int j = 0; j < k.size(); j++){ ch[i][k[j] - 'a']++; } } for(int j = 0; j < 26; j++){ int min = 2e9; REP(i,0,size){ if(ch[i][j] < min) min = ch[i][j]; } REP(z,0,min) cout << (char)(j + 'a'); } return 0; }
a.cc: In function 'int main()': a.cc:23:9: error: 'memset' was not declared in this scope 23 | memset(ch,0,sizeof(ch)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <algorithm> +++ |+#include <cstring> 7 | #define ll long long
s387802576
p03761
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #include <queue> #include <climits> #include <set> #include <map> #include <stack> #include <iomanip> #include <tuple> #define ll long long #define rep(i,s,n) for(ll i = (ll)(s); i < (ll)(n); i++) #define all(a) (a).begin(),a.end() #define mod 1000000007 using namespace std; using graph =vector<vector<ll>>; /*階乗*/ ll factorial(ll n){ if(n==0){ return 1; } else{ return n*factorial(n-1); } } /* ユークリッドの互除法 最大公約数*/ ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; } /*最小公倍数*/ ll lcm(ll a,ll b){ return a/gcd(a,b)*b; } /*二点間の距離*/ double dist(pair<double,double> a,pair<double,double> b){ return sqrt(pow((a.first - b.first) ,2) + pow((a.second - b.second),2)); } //繰り返し自乗法 double ism(double aa,ll p){ double ap=aa; double ans=1; while(p>0){ //cout<<"p="<<p<<",ap="<<ap<<endl; if(p&1){//奇数が真 ans*=ap; } p/=2; ap=ap*ap; } return ans; } //繰り返し自乗法(アマリトリバージョン) ll ismm(ll aa,ll p,ll m){ ll ap=aa; ll ans=1; while(p>0){ //cout<<"p="<<p<<",ap="<<ap<<endl; if(p&1){//奇数が真 ans=(ans*ap)%m; } p/=2; ap=(ap*ap)%m; } return ans; } /* ll solve(ll i,ll m,vector<ll>t,ll n){ if(m==0){ return 1; } if(i>=n){ return 0; } cout<<i+1<<" "<<m<<endl; cout<<i+1<<" "<<m-t[i]<<endl; ll res=solve(i+1,m,t,n)||solve(i+1,m-t[i],t,n); return res; } */ //小数点12桁 struct all_init { all_init() { cout << fixed << setprecision(12); } } All_init; int main() { ll n; cin>>n; vector<ll>ans(26,LLONG_MAX); rep(i,0,n){ string o; cin>>o; vector<ll>cnt(26,0); rep(j,0,o.size()){ cnt[o[j]-'a']++; } rep(j,0,26){ ans[j]=min(ans[j],cnt[j]); } } string s; rep(j,0,26){ if(ans[j]>0){ s+=string(ans[j],i+'a'); } } cout<<s<<endl; }
a.cc: In function 'int main()': a.cc:124:30: error: 'i' was not declared in this scope 124 | s+=string(ans[j],i+'a'); | ^
s521838418
p03761
C++
// >>> TEMPLATES #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using i32 = int32_t; using i64 = int64_t; #define int ll #define double ld #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define rep1(i,n) for (int i = 1; i <= (int)(n); i++) #define repR(i,n) for (int i = (int)(n)-1; i >= 0; i--) #define rep1R(i,n) for (int i = (int)(n); i >= 1; i--) #define loop(i,a,B) for (int i = a; i B; i++) #define loopR(i,a,B) for (int i = a; i B; i--) #define all(x) (x).begin(), (x).end() #define allR(x) (x).rbegin(), (x).rend() #define pb push_back #define eb emplace_back #define mp make_pair #define fst first #define snd second auto constexpr INF32 = numeric_limits<int32_t>::max()/2-1; auto constexpr INF64 = numeric_limits<int64_t>::max()/2-1; auto constexpr INF = numeric_limits<int>::max()/2-1; #ifdef LOCAL #include "debug.hpp" #define dump(...) cerr << "[" << setw(3) << __LINE__ << ":" << __FUNCTION__ << "] ", dump_impl(#__VA_ARGS__, __VA_ARGS__) #define say(x) cerr << "[" << __LINE__ << ":" << __FUNCTION__ << "] " << x << endl #define debug if (1) #else #define dump(...) (void)(0) #define say(x) (void)(0) #define debug if (0) #endif template <class T> using pque_max = priority_queue<T>; template <class T> using pque_min = priority_queue<T, vector<T>, greater<T> >; template <class T, class = typename T::iterator, class = typename enable_if<!is_same<T, string>::value>::type> ostream& operator<<(ostream& os, T const& v) { bool f = true; for (auto const& x : v) os << (f ? "" : " ") << x, f = false; return os; } template <class T, class = typename T::iterator, class = typename enable_if<!is_same<T, string>::value>::type> istream& operator>>(istream& is, T &v) { for (auto& x : v) is >> x; return is; } template <class T, class S> istream& operator>>(istream& is, pair<T,S>& p) { return is >> p.first >> p.second; } struct IOSetup { IOSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } iosetup; template <class F> struct FixPoint : private F { constexpr FixPoint(F&& f) : F(forward<F>(f)) {} template <class... T> constexpr auto operator()(T&&... x) const { return F::operator()(*this, forward<T>(x)...); } }; struct MakeFixPoint { template <class F> constexpr auto operator|(F&& f) const { return FixPoint<F>(forward<F>(f)); } }; #define MFP MakeFixPoint()| #define def(name, ...) auto name = MFP [&](auto &&name, __VA_ARGS__) template <class T, size_t d> struct vec_impl { using type = vector<typename vec_impl<T,d-1>::type>; template <class... U> static type make_v(size_t n, U&&... x) { return type(n, vec_impl<T,d-1>::make_v(forward<U>(x)...)); } }; template <class T> struct vec_impl<T,0> { using type = T; static type make_v(T const& x = {}) { return x; } }; template <class T, size_t d = 1> using vec = typename vec_impl<T,d>::type; template <class T, size_t d = 1, class... Args> auto make_v(Args&&... args) { return vec_impl<T,d>::make_v(forward<Args>(args)...); } template <class T> void quit(T const& x) { cout << x << endl; exit(0); } template <class T> constexpr bool chmin(T& x, T const& y) { if (x > y) { x = y; return true; } return false; } template <class T> constexpr bool chmax(T& x, T const& y) { if (x < y) { x = y; return true; } return false; } template <class It> constexpr auto sumof(It b, It e) { return accumulate(b,e,typename iterator_traits<It>::value_type{}); } template <class T> int sz(T const& x) { return x.size(); } template <class C, class T> int lbd(C const& v, T const& x) { return lower_bound(v.begin(), v.end(), x)-v.begin(); } template <class C, class T> int ubd(C const& v, T const& x) { return upper_bound(v.begin(), v.end(), x)-v.begin(); } template <class C, class F> int ppt(C const& v, F f) { return partition_point(v.begin(), v.end(), f)-v.begin(); } // <<< int32_t main() { int n; cin >> n; vector<string> s(n); cin >> s; vector<int> cnt(26,INF); rep (c,26) rep (i,n) chmin(cnt[c], count(all(s[i]),'a'+c)); rep (c,26) cout << string(cnt[c],'a'+c); cout << endl; }
a.cc: In function 'int32_t main()': a.cc:81:31: error: no matching function for call to 'chmin(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 81 | rep (c,26) rep (i,n) chmin(cnt[c], count(all(s[i]),'a'+c)); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:61:35: note: candidate: 'template<class T> constexpr bool chmin(T&, const T&)' 61 | template <class T> constexpr bool chmin(T& x, T const& y) { if (x > y) { x = y; return true; } return false; } | ^~~~~ a.cc:61:35: note: template argument deduction/substitution failed: a.cc:81:31: note: deduced conflicting types for parameter 'const T' ('long long int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 81 | rep (c,26) rep (i,n) chmin(cnt[c], count(all(s[i]),'a'+c)); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s363729108
p03761
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < n; i++) int main(){ int n; cin >> n; vector<string> s(n); rep(i,n)cin>>s.at(i); rep(j,26){ m = 100; rep(i,n)m = min(m,(int) count(s.at(i).begin(),s.at(i).end(),(char)('a'+j))); rep(i,m)cout<<(char)('a'+j); } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'm' was not declared in this scope 12 | m = 100; | ^
s442633591
p03761
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < n; i++) int main(){ int n; cin >> n; vector<string> s(n); rep(i,n)cin>>s.at(i); rep(j,26){ m = 100; rep(i,n)m = min(m, count(s.at(i).begin(),s.at(i).end(),(char)('a'+j))); rep(i,m)cout<<(char)('a'+j); } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'm' was not declared in this scope 12 | m = 100; | ^
s835134717
p03761
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n;cin>>n;vector<int>X(26,50); for(int i=0;i<n;i++){ string S;cin>>S;char w='a'; for(int j=0;j<26;j++){ X.at(j)=min(X.at(j),count(S.begin(),S.end(),w)); w++; } } for(int i=0;i<26;i++){ char w='a';w+=i; for(int j=0;j<X.at(i);j++)cout<<w; } cout<<endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 8 | X.at(j)=min(X.at(j),count(S.begin(),S.end(),w)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:8:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 8 | X.at(j)=min(X.at(j),count(S.begin(),S.end(),w)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:8:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 8 | X.at(j)=min(X.at(j),count(S.begin(),S.end(),w)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s809516633
p03761
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n;cin>>n;vector<int>X(26,50); for(int i=0;i<n;i++){ string S;cin>>S; for(int j=0;j<26;j++)X.at(j)=min(X.at(j),count(S.begin(),S.end(),'a'+j)); } for(int i=0;i<26;i++)for(int j=0;j<X.at(i);j++)cout<<'a'+i; cout<<endl; }
a.cc: In function 'int main()': a.cc:7:37: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 7 | for(int j=0;j<26;j++)X.at(j)=min(X.at(j),count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:7:37: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 7 | for(int j=0;j<26;j++)X.at(j)=min(X.at(j),count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:7:37: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 7 | for(int j=0;j<26;j++)X.at(j)=min(X.at(j),count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s867225802
p03761
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<int> cnt[256]; vector<char> alp(26); iota(alp.begin(), alp.end(), 'a'); int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; for (char c : alp) { cnt[c].push_back(count(s.begin(), s.end(), c)); } } for (char c : alp) { cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); } cout << endl; }
a.cc: In function 'int main()': a.cc:15:21: error: 'min_elements' was not declared in this scope 15 | cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); | ^~~~~~~~~~~~
s932098963
p03761
C++
#include<bits/stdc++.h> int main() { vector<int> cnt[256]; vector<char> alp(26); iota(alp.begin(), alp.end(), 'a'); int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; for (char c : alp) { cnt[c].push_back(count(s.begin(), s.end(), c)); } } for (char c : alp) { cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); } cout << endl; }
a.cc: In function 'int main()': a.cc:3:3: error: 'vector' was not declared in this scope 3 | vector<int> cnt[256]; | ^~~~~~ a.cc:3:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:3:10: error: expected primary-expression before 'int' 3 | vector<int> cnt[256]; | ^~~ a.cc:4:10: error: expected primary-expression before 'char' 4 | vector<char> alp(26); | ^~~~ a.cc:5:8: error: 'alp' was not declared in this scope 5 | iota(alp.begin(), alp.end(), 'a'); | ^~~ a.cc:5:3: error: 'iota' was not declared in this scope; did you mean 'std::iota'? 5 | iota(alp.begin(), alp.end(), 'a'); | ^~~~ | std::iota In file included from /usr/include/c++/14/numeric:62, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58: /usr/include/c++/14/bits/stl_numeric.h:88:5: note: 'std::iota' declared here 88 | iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) | ^~~~ a.cc:6:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | int n; cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:8:5: error: 'string' was not declared in this scope 8 | string s; cin >> s; | ^~~~~~ a.cc:8:5: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:8:22: error: 's' was not declared in this scope 8 | string s; cin >> s; | ^ a.cc:10:7: error: 'cnt' was not declared in this scope; did you mean 'int'? 10 | cnt[c].push_back(count(s.begin(), s.end(), c)); | ^~~ | int a.cc:10:24: error: 'count' was not declared in this scope; did you mean 'std::count'? 10 | cnt[c].push_back(count(s.begin(), s.end(), c)); | ^~~~~ | std::count In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~ a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:14:34: error: 'cnt' was not declared in this scope; did you mean 'int'? 14 | cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); | ^~~ | int a.cc:14:21: error: 'min_elements' was not declared in this scope 14 | cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); | ^~~~~~~~~~~~ a.cc:14:13: error: 'string' was not declared in this scope 14 | cout << string(*min_elements(cnt[c].begin(), cnt[c].end()), c); | ^~~~~~ a.cc:14:13: note: suggested alternatives: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:16:11: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 16 | cout << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s281923793
p03761
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define all(x) (x).begin(),(x).end() #define pb push_back #define eb emplace_back using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;} ll lcm(ll a, ll b) { return a/gcd(a,b)*b;} int const INF = 1001001001; ll const MOD = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<string> S(n); set <char> st; rep(i,n) { cin >> S[i]; int len = S[i].size(); rep(j,len) { st.insert(S[i][j]); } } vector<char> ans; for(auto c : st) { int cnt = INF; rep(i,n) { cnt = min(cnt, count(all(S[i]),c)); } rep(i,cnt) ans.push_back(c); } sort(all(ans)); rep(i,ans.size()) { cout << ans[i]; } cout << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:45:18: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 45 | cnt = min(cnt, count(all(S[i]),c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:45:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 45 | cnt = min(cnt, count(all(S[i]),c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:45:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 45 | cnt = min(cnt, count(all(S[i]),c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
s454326438
p03761
C++
#include <bits/stdc++.h> using namespace std ; int main () { ios_base::sync_with_stdio(false); cin.tie(NULL) ; int n ; vector <string> s ; cin >> n ; while ( n-- ) { string a ; cin >> a ; s.push_back(a) ; } int arr[26] ; for ( int i = 'a' ; i <= 'z' ; i ++ ) { char c = i ; int minimum = 51 ; for ( auto & str : s ) { minimum = min(minimum,count(str.begin(),str.end(),c) ); } arr[i-'a'] = minimum ; } for ( int i = 0 ; i < 26 ; i ++ ) { if ( arr[i] != 0 ) { for ( int j = 0 ; j < arr[i] ; j ++ ) { cout << char(i +'a') ; } } } }
a.cc: In function 'int main()': a.cc:22:30: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 22 | minimum = min(minimum,count(str.begin(),str.end(),c) ); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:22:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 22 | minimum = min(minimum,count(str.begin(),str.end(),c) ); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:22:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | minimum = min(minimum,count(str.begin(),str.end(),c) ); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s815236134
p03761
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for(int i=0; i<N; i++) typedef long long ll; #define dump(x) cerr<<#x<<"="<<x<<endl using P = pair<int, int>; int main() { int n; cin >> n; vector<string> s(n); rep(i, n){ cin >> s.at(i); } if(n==1){ cout << s.at(0) << endl; return 0; } string v = ""; for(int i=0; i<s.at(0).size(); i++){ bool ok = false; for(int j=1; j<n; j++){ bool notok = false; for(int k=0; k<s.at(j).size(); k++){ if(s.at(0).at(i)==s.at(j).at(k)) { s.at(j).at(k) = '!'; break; } if(k==s.at(j).size()-1){ notok = true; } } if(notok) break; if(j==n-1){ ok = true; } } if(ok){ v.push_back(s.at(0).at(i)); } } if(v.size()!=0) { sort(v.begin(), v.end()); cout << v << +e3ndl; } else cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:48:23: error: 'e3ndl' was not declared in this scope 48 | cout << v << +e3ndl; | ^~~~~
s756614286
p03761
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),(v).end() #define rall(v)(v).rbegin(),(v).rend() #define F first #define S second #define pb push_back #define pu push #define COUT(x) cout<<(x)<<endl #define PQ priority_queue<ll> #define PQR priority_queue<ll,vector<ll>,greater<ll>> #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define mp make_pair #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define sz(x) (int)(x).size() typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll MOD = 1000000007LL; const ll INF = 1LL << 60; using vll = vector<ll>; using vb = vector<bool>; using vvb = vector<vb>; using vvll = vector<vll>; using vstr = vector<string>; using pll = pair<ll, ll>; ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;} ll lcm(ll a, ll b) { return a/gcd(a,b)*b;} int main(){ ll n; cin>>n; vstr s(n); vvll t(n,vll(26)); rep(i,n){ cin>>s[i]; sort(all(s[i])); rep(j,s[i].size()){ t[i][s[i][j]-'a']++; } } vll a(26,100); rep(i,n){ rep(j,26){ a[j]=min(t[i][j],a[j]); } } vector<char> g(0); rep(i,26){ ll h=a[i].size(); rep(j,h){ g.pb((char)('a'+a[i])); } } rep(i,g.size()){ cout<<g[i]<<; } }
a.cc: In function 'int main()': a.cc:58:15: error: request for member 'size' in 'a.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} 58 | ll h=a[i].size(); | ^~~~ a.cc:64:17: error: expected primary-expression before ';' token 64 | cout<<g[i]<<; | ^
s548899912
p03761
C++
#include <iostream> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <set> #include <queue> #include <string> #define rep(i, a, b) for ( int i = (a); i < (b); i++ ) #define per(i, a, b) for ( int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define bg begin() #define en end() using namespace std; typedef long long ll; static const long long MOD = 1000000007; int n; char S[55][55]; int c[55][55]; string ans; int main(void) { scanf("%d", &n); rep(i, 0, n) { scanf("%s", S[i]); } for (int i = 0; i < n; i++) { for (int j = 0; j < (int)strlen(S[i]); j++) { int ch = S[i][j] - 'a'; c[ch][i]++; } } rep(ch, 0, 26) { int cnt = 1000000000; rep(i, 0, n) { cnt = min(cnt, c[ch][i]); } rep(i, 0, cnt) ans += 'a' + ch; } printf("%s\n", ans.c_str()); return 0; }
a.cc: In function 'int main()': a.cc:36:34: error: 'strlen' was not declared in this scope 36 | for (int j = 0; j < (int)strlen(S[i]); j++) { | ^~~~~~ a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <queue> +++ |+#include <cstring> 8 | #include <string>
s366471770
p03761
C++
#include <iostream> #include <algorithm> #include <string> #include <cmath> #include <vector> #include <set> #include <queue> #include <map> #define rep(i, a, b) for ( int i = (a); i < (b); i++ ) #define per(i, a, b) for ( int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define bg begin() #define en end() using namespace std; typedef long long ll; static const long long MOD = 1000000007; int n; char S[55][55]; int c[55][55]; string ans; int main(void) { scanf("%d", &n); rep(i, 0, n) { scanf("%s", S[i]); } for (int i = 0; i < n; i++) { for (int j = 0; j < (int)strlen(S[i]); j++) { int ch = S[i][j] - 'a'; c[ch][i]++; } } rep(ch, 0, 26) { int cnt = 1000000000; rep(i, 0, n) { cnt = min(cnt, c[ch][i]); } rep(i, 0, cnt) ans += 'a' + ch; } printf("%s\n", ans.c_str()); return 0; }
a.cc: In function 'int main()': a.cc:36:34: error: 'strlen' was not declared in this scope 36 | for (int j = 0; j < (int)strlen(S[i]); j++) { | ^~~~~~ a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <map> +++ |+#include <cstring> 9 |
s997855913
p03761
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() #define dunk(a) cout << (a) << endl using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<string> s(n); rep(i, n) cin >> s[i]; string ans = ""; for (char i = 'a'; i <= 'z'; ++i) { int k = 100; rep(j, n) { k = min(k, count(all(s[j]), i)); } if (k == 100) continue; while (k > 0) { ans += i; k--; } } sort(all(ans)); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:32: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 20 | k = min(k, count(all(s[j]), i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:32: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 20 | k = min(k, count(all(s[j]), i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:20:32: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | k = min(k, count(all(s[j]), i)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~
s035581108
p03761
C++
#include <iostream> using namespace std; int cnt[26][50]; string s[50]; int main() { int n; cin>>n; string ans=""; for(int i=0;i<n;i++) { cin>>s[i]; for(int j=0;j<s[i].size();j++) cnt[s[i][j]-'a'][i]++; } for(int i=0;i<26;i++) { sort(cnt[i],cnt[i]+n); ans.append(cnt[i][0], 'a'+i); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'? 18 | sort(cnt[i],cnt[i]+n); | ^~~~ | short
s731504538
p03761
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq priority_queue<int> #define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key))) #define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key))) signed main(){ int N; cin>>N; vi A(26); string S; cin>>S; rep(i,0,S.size()) A[S[i]-'a']++; rep(i,1,N){ string X; cin>>X; vi B(26); rep(j,0,X.size()) B[S[j]-'a']++; rep(j,0,26) A[j]=min(A[j],B[j]); } string ans; rep(i,0,26){ rep(k,0,A[i]) ans+='a'+i; } if(ans) cout<<ans; }
a.cc: In function 'int main()': a.cc:36:6: error: could not convert 'ans' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' 36 | if(ans) | ^~~ | | | std::string {aka std::__cxx11::basic_string<char>}
s964598881
p03761
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; int n; string s; int a[27]; int minn[27];/ int main() { cin>>n; for(int i=1;i<=26;i++)minn[i]=100864; for(int i=1;i<=n;i++) { for(int j=1;j<=26;j++)a[j]=0; cin>>s; for(auto j:s)a[j-'a'+1]++; for(int j=1;j<=26;j++)minn[j]=min(minn[j],a[j } for(int i=1;i<=26;i++) for(int j=1;j<=minn[i];j++)putchar('a'+i-1); }
a.cc:10:14: error: expected unqualified-id before '/' token 10 | int minn[27];/ | ^
s533347516
p03761
C++
#include<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1000000007 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long #define ull unsigned long long #define vi vector<ll> #define vvi vector<vi> #define BITLE(n) (1LL<<((ll)n)) #define BITCNT(n) (__builtin_popcountll(n)) #define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1)) #define ALL(a) (a).begin(),(a).end() using namespace std; int cnt[11111][26]; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n;cin>>n; for(int i=0;i<n;i++){ string s;cin>>s; for(auto a:s)cnt[i][a-'a']; } vector<char>ans; for(int i=0;i<26;i++){ ll mi=llINF; for(int j=0;j<n;j++){ mi=min(mi,cnt[j][i]); } for(int j=0;j<mi;j++) ans.pb((char)(i+'a')); } for(auto a:ans)cout<<a; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:32:13: error: no matching function for call to 'min(long long int&, int&)' 32 | mi=min(mi,cnt[j][i]); | ~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:32:13: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 32 | mi=min(mi,cnt[j][i]); | ~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:32:13: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 32 | mi=min(mi,cnt[j][i]); | ~~~^~~~~~~~~~~~~~
s149082788
p03761
C++
#include <bits/stdc++.h> using namespace std; #define LOOP(i,o) for(i=0;i<o;i++) #define ALL(a) (a).begin(),(a).end() int main() { int n; cin>>n; vector<string> s(n); int i=0; LOOP(i,n){ cin>>s[i]; } vector<int> a(26,51); LOOP(i,n){ for(int j=0;j<s.at(i).size();j++){ int hh=1; if(s[i][j]==s[i][j+1]){ hh++; continue; } else{ a[s[i][j]-'a']=min(a[s[i][j]-'a'],hh); } } } for(int i=0;i<26;i++){ if(a[i]==51) a[i]=0; }
a.cc: In function 'int main()': a.cc:28:4: error: expected '}' at end of input 28 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s943911304
p03761
C++
/*Function Template*/ #include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int Len(int n) { int s=0; while(n!=0) s++, n/=10; return s; } int Sint(int n) { int m=0,s=0,a=n; while(a!=0) s++, a/=10; for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10; return m; } int GCD(int a,int b) { int r, tmp; /* 自然数 a > b を確認・入替 */ if(a<b){ tmp = a; a = b; b = tmp; } /* ユークリッドの互除法 */ r = a % b; while(r!=0){ a = b; b = r; r = a % b; } return b; } int Factorial(int n){ int m=1; while(n>=1) m*=n,n--; return m; } int Svec(vector<int> v){ int n=0; for(int i=0;i<v.size();i++) n+=v[i]; return n; } /////////////////////////// int main() { int n,ans=0; cin>>n; vector<string> v(n); rep(i,n) cin>>v[i]; vector<map<char,int>> w(n,map<char,int>); rep(i,n){ rep(j,v[i].size()){ w[i][v[i][j]]++; } } map<char,int> mp; rep(i,26){ mp['a'+i]=100; } for(int i=0;i<n;i++){ for(auto c:w[i]){ if(mp[c.first]>=c.second){ mp[c.first]=c.second; } } } for(int i=0;i<n;i++){ for(auto c:w[i]){ if(mp[c.first]==100){ mp[c.first]=0; } } } for(auto c:mp){ rep(i,c.second){ cout<<c.first; } } cout<<endl; } ///////////////////////////
a.cc: In function 'int main()': a.cc:62:42: error: expected primary-expression before ')' token 62 | vector<map<char,int>> w(n,map<char,int>); | ^
s181026275
p03761
C++
#include<bits/stdc++.h> using namespace std; const int mod = 1000000007; #define rep(i, n) for(int i = 0; i < (n); i++) int n,cnt[50][30]; string s[50]; char res[51]; int main() { cin>>n; int index=0; rep(i,n) cin>>s[i]; rep(i,n) rep(j,s.size()) cnt[i][s[i][j]-'a']++; rep(i,26){ int c=cnt[0][i]; for (int k=1;k<n;k++){ c=min(c,cnt[k][i]); } for (int k=index;k<index+c;k++) { res[k]='a'+i; } index+=c; } cout<<res<<endl; }
a.cc: In function 'int main()': a.cc:14:22: error: request for member 'size' in 's', which is of non-class type 'std::string [50]' {aka 'std::__cxx11::basic_string<char> [50]'} 14 | rep(i,n) rep(j,s.size()) cnt[i][s[i][j]-'a']++; | ^~~~ a.cc:4:39: note: in definition of macro 'rep' 4 | #define rep(i, n) for(int i = 0; i < (n); i++) | ^
s111402206
p03761
C++
#include <iostream> #include <vector> using namespace std; vector <char> ALPHABET(26); int main(){ int n; cin >> n; //init APLPHABET for(int i = 0; i < 26; i++){ ALPHABET[i] = char('a' + i); } vector<string> S(n); for(int i = 0; i < n; i++) cin >> S[i]; vector<int> isect(26,51); for(a = 0; a<isect.size(); a++){ for(int i = 0, i < n; i++){ int l = S[i].size(); int t = 0; for(int j = 0; j < l; j++){ if(S[i][j] == ALPHABET[a]){ tmp++; } } if(isect[a] > tmp) isect[a] = tmp; } } string ans; for(int i = 0; i < isect.size(); i++){ int t = isect[i]; while(t > 0){ ans.push_back[ALPHABET[i]]; t--; } } cout << ans; }
a.cc: In function 'int main()': a.cc:20:7: error: 'a' was not declared in this scope 20 | for(a = 0; a<isect.size(); a++){ | ^ a.cc:21:21: error: expected ';' before '<' token 21 | for(int i = 0, i < n; i++){ | ^~ | ; a.cc:21:22: error: expected primary-expression before '<' token 21 | for(int i = 0, i < n; i++){ | ^ a.cc:26:11: error: 'tmp' was not declared in this scope; did you mean 'tm'? 26 | tmp++; | ^~~ | tm a.cc:29:21: error: 'tmp' was not declared in this scope; did you mean 'tm'? 29 | if(isect[a] > tmp) isect[a] = tmp; | ^~~ | tm a.cc:37:18: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript 37 | ans.push_back[ALPHABET[i]]; | ^
s343467494
p03761
C++
#include <bits/stdc++.h> #define itn int #define REP(i, n) for (int i = 0; i < n; i++) #define IREP(i, n) for (int i = n - 1; i >= 0; i--) #define REPEACH(i,k) for(auto& i:k) #define all(a) a.begin(),a.end() #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; const ll INF = 1LL << 60; signed main() { int n; cin >> n; vector<string> s(n); map<char,int> m; REP(i,n){ map<char,bool> m2; cin >> s[i]; REP(j,s[i].size()){ if(m2.find(s[i])==m2.end()){ m2[s[i]]=true; m[s[i]]++; } } } string ans=""; REPEACH(i,m){ if(i.second==n){ ans+=i.first; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:23:35: error: no matching function for call to 'std::map<char, bool>::find(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 23 | if(m2.find(s[i])==m2.end()){ | ~~~~~~~^~~~~~ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:1224:9: note: candidate: 'template<class _Kt> decltype (((std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) [with _Key = char; _Tp = bool; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1224 | find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x)) | ^~~~ /usr/include/c++/14/bits/stl_map.h:1224:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((std::map<char, bool>*)this)->std::map<char, bool>::_M_t.std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(__x)) std::map<char, bool>::find(const _Kt&) [with _Kt = std::__cxx11::basic_string<char>]': a.cc:23:14: required from here 23 | if(m2.find(s[i])==m2.end()){ | ~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_map.h:1224:57: error: no matching function for call to 'std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(const std::__cxx11::basic_string<char>&)' 1224 | find(const _Kt& __x) -> decltype(_M_t._M_find_tr(__x)) | ~~~~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/map:62: /usr/include/c++/14/bits/stl_tree.h:1291:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Req = _Kt; _Key = char; _Val = std::pair<const char, bool>; _KeyOfValue = std::_Select1st<std::pair<const char, bool> >; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1291 | _M_find_tr(const _Kt& __k) | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1291:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stl_function.h: In substitution of 'template<class _Func, class _SfinaeType> using std::__has_is_transparent_t = typename std::__has_is_transparent<_Func, _SfinaeType>::type [with _Func = std::less<char>; _SfinaeType = std::__cxx11::basic_string<char>]': /usr/include/c++/14/bits/stl_tree.h:1289:9: required by substitution of 'template<class _Kt> decltype (((std::map<char, bool>*)this)->std::map<char, bool>::_M_t.std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(__x)) std::map<char, bool>::find(const _Kt&) [with _Kt = std::__cxx11::basic_string<char>]' 1289 | typename _Req = __has_is_transparent_t<_Compare, _Kt>> | ^~~~~~~~ a.cc:23:14: required from here 23 | if(m2.find(s[i])==m2.end()){ | ~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_function.h:1427:11: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<char>, std::__cxx11::basic_string<char>, void>' 1427 | using __has_is_transparent_t | ^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((std::map<char, bool>*)this)->std::map<char, bool>::_M_t.std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(__x)) std::map<char, bool>::find(const _Kt&) [with _Kt = std::__cxx11::basic_string<char>]': a.cc:23:14: required from here 23 | if(m2.find(s[i])==m2.end()){ | ~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_tree.h:1300:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Req = _Kt; _Key = char; _Val = std::pair<const char, bool>; _KeyOfValue = std::_Select1st<std::pair<const char, bool> >; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1300 | _M_find_tr(const _Kt& __k) const | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1300:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_map.h:1249:9: note: candidate: 'template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_find_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::find(const _Kt&) const [with _Key = char; _Tp = bool; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1249 | find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x)) | ^~~~ /usr/include/c++/14/bits/stl_map.h:1249:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((const std::map<char, bool>*)this)->std::map<char, bool>::_M_t.std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(__x)) std::map<char, bool>::find(const _Kt&) const [with _Kt = std::__cxx11::basic_string<char>]': a.cc:23:14: required from here 23 | if(m2.find(s[i])==m2.end()){ | ~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_map.h:1249:63: error: no matching function for call to 'std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::_M_find_tr(const std::__cxx11::basic_string<char>&) const' 1249 | find(const _Kt& __x) const -> decltype(_M_t._M_find_tr(__x)) | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/stl_tree.h:1291:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Req = _Kt; _Key = char; _Val = std::pair<const char, bool>; _KeyOfValue = std::_Select1st<std::pair<const char, bool> >; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1291 | _M_find_tr(const _Kt& __k) | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1291:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_tree.h:1300:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) const [with _Req = _Kt; _Key = char; _Val = std::pair<const char, bool>; _KeyOfValue = std::_Select1st<std::pair<const char, bool> >; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >]' 1300 | _M_find_tr(const _Kt& __k) const | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:1300:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_map.h:1218:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = char; _Tp = bool; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >; iterator = std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::iterator; key_type = char]' 1218 | find(const key_type& __x) | ^~~~ /usr/include/c++/14/bits/stl_map.h:1218:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, bool>::key_type&' {aka 'const char&'} 1218 | find(const key_type& __x) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:1243:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::const_iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) const [with _Key = char; _Tp = bool; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, bool> >; const_iterator = std::_Rb_tree<char, std::pair<const char, bool>, std::_Select1st<std::pair<const char, bool> >, std::less<char>, std::allocator<std::pair<const char, bool> > >::const_iterator; key_type = char]' 1243 | find(const key_type& __x) const | ^~~~ /usr/include/c++/14/bits/stl_map.h:1243:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, bool>::key_type&' {aka 'const char&'} 1243 | find(const key_type& __x) const | ~~~~~~~~~~~~~~~~^~~ a.cc:24:35: error: no match for 'operator[]' (operand types are 'std::map<char, bool>' and '__gnu_cxx::__alloc_traits
s711804881
p03761
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> using namespace std; int read() { char c=getchar(); int d=0; while(c<'0' || c>'9')c=getchar(); while(c>='0' && c<='9'){d=(d<<3)+(d<<1)+(c^48);c=getchar();} return d; } #define MAXN 50 int n; string s[MAXN+1]; int a[MAXN+1][27]; int main() { n=read(); for(int i=1;i<=n;i++) { getline(cin,s); for(int j=0;j<s.size();j++)a[i][s[j]-'a'+1]++; } for(int i=1;i<=26;i++) { int minn=233; for(int j=1;j<=n;j++) { minn=min(minn,a[j][i]); if(!minn)break; } for(int j=1;j<=minn;j++)putchar(i-1+'a'); } }
a.cc: In function 'int main()': a.cc:28:16: error: no matching function for call to 'getline(std::istream&, std::string [51])' 28 | getline(cin,s); | ~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: template argument deduction/substitution failed: a.cc:28:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'std::string [51]' {aka 'std::__cxx11::basic_string<char> [51]'} 28 | getline(cin,s); | ~~~~~~~^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: template argument deduction/substitution failed: a.cc:28:16: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'std::string [51]' {aka 'std::__cxx11::basic_string<char> [51]'} 28 | getline(cin,s); | ~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:18: note: candidate expects 3 arguments, 2 provided a.cc:29:25: error: request for member 'size' in 's', which is of non-class type 'std::string [51]' {aka 'std::__cxx11::basic_string<char> [51]'} 29 | for(int j=0;j<s.size();j++)a[i][s[j]-'a'+1]++; | ^~~~ a.cc:29:45: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 29 | for(int j=0;j<s.size();j++)a[i][s[j]-'a'+1]++; | ~~~~^~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:29:46: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 29 | for(int j=0;j<s.size();j++)a[i][s[j]-'a'+1]++; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:29:46: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 29 | for(int j=0;j<s.size();j++)a[i][s[j]-'a'+1]++; | ^~~
s590964922
p03761
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int n; cin >> n; vector<string>s(n); for (int i = 0; i < n; i++) cin >> s[i]; string abc = "abcdefghijklmnopqrstuvwxyz"; string ans; for (int i = 0; i < 26; i++) { int cnt = (int)1e9; for (int j = 0; j < s.size(); j++) { cnt = min(cnt, count(s[j].begin(), s[j].end(), abc[i])); } for (int j = 0; j < cnt; j++) { ans += abc[i]; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:34: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 17 | cnt = min(cnt, count(s[j].begin(), s[j].end(), abc[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:17:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 17 | cnt = min(cnt, count(s[j].begin(), s[j].end(), abc[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:17:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 17 | cnt = min(cnt, count(s[j].begin(), s[j].end(), abc[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s687342057
p03761
C++
n=int(input()) a=input() for i in range(n-1) a=a.intersection(input()) print(a)
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s153717979
p03761
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <functional> #include <iomanip> #include <stdlib.h> #include <string.h> #include <cmath> #include <map> #include <queue> #include <deque> #include <stack> #include <set> #define rep(i,n) for(int i=0; i<n; i++) const long long MOD = 1000000007; using namespace std; typedef long long ll; map<ll, int> mp; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<string> s(n); vector<vector<int>> a(n, vector<int>(26, 0)); rep(i, n) { cin >> s.at(i); rep(j, s.at(i).size()) { a.at(i).at(s.at(i).at(j) - 'a')++; } } string ans = ""; rep(i, 26) { int m = INT_MAX; rep(j, n) { m = min(m, a.at(j).at(i)); } rep(j, m) { char c = 'a' + i; ans += c; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:25: error: 'INT_MAX' was not declared in this scope 36 | int m = INT_MAX; | ^~~~~~~ a.cc:16:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 15 | #include <set> +++ |+#include <climits> 16 | #define rep(i,n) for(int i=0; i<n; i++)
s346685781
p03761
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <functional> #include <iomanip> #include <stdlib.h> #include <string.h> #include <cmath> #include <map> #include <queue> #include <deque> #include <stack> #include <set> #define rep(i,n) for(int i=0; i<n; i++) const long long MOD = 1000000007; using namespace std; typedef long long ll; map<ll, int> mp; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<string> s(n); vector<vector<int>> a(n, vector<int>(26, 0)); rep(i, n) { cin >> s.at(i); rep(j, s.at(i).size()) { a.at(i).at(s.at(i).at(j) - 'a')++; } } string ans = ""; rep(i, 26) { int m = INT_MAX; rep(j, n) { m = min(m, a.at(j).at(i)); } rep(j, m) { char c = 'a' + i; ans += c; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:25: error: 'INT_MAX' was not declared in this scope 36 | int m = INT_MAX; | ^~~~~~~ a.cc:16:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 15 | #include <set> +++ |+#include <climits> 16 | #define rep(i,n) for(int i=0; i<n; i++)
s771268143
p03761
C++
#include<bits/stdc++.h> using namespace std; int t[200],ans[200],ch[200]; int main(){ int n; cin>>n; string s; for(int i=0;i<n;i++) { cin>>s; for(int i=0;i<s.size();i++) { ch[s[i]]++; } for(int i='a';i<='z';i++) { ans[i]=min(ans[i],ch[i]) } } for(int i='a';i<='z';i++) { for(int j=0;j<ans[i];j++) { cout<<(char)i; } } return 0; }
a.cc: In function 'int main()': a.cc:18:48: error: expected ';' before '}' token 18 | ans[i]=min(ans[i],ch[i]) | ^ | ; 19 | } | ~
s783395481
p03761
C++
#include <iostream> #include <string> #include <iomanip> #include <vector> #include <algorithm> using namespace std; int main(void){ int N; cin >> N; vector<string>word(N); for(int i=0;i<N;i++){ cin >> word[i]; } vector<vector<int> >check(N,vector<int>(26,0)); for(int i=0;i<N;i++){ int n = word[i].length(); for(int j=0;j<n;j++){ check[i][word[j] - 'a']++; } } vector<int>usable(26,0); for(int i=0;i<26;i++){ int min_al = 51; for(int j=0;j<N;j++){ if(check[j][i] < min_al) min_al = check[j][i]; } usable[i] = min_al; } for(int i=0;i<26;i++){ if(usable[i] == 0) continue; else{ for(int j=0;j<usable[i];j++){ cout << (char) i + 'a'; } } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:24: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'char') 20 | check[i][word[j] - 'a']++; In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:20:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 20 | check[i][word[j] - 'a']++; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:20:26: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 20 | check[i][word[j] - 'a']++; | ^~~
s651901226
p03761
C++
#include <bits/stdc++.h> #define rep(i,b) for(ll i=0;i<b;i++) using namespace std; string s[50]; int n,m; signed main() { cin>>n; rep(i,n)cin>>s[i]; rep(j,26) { m = 100; rep(i, n)m = min(m, (int) count(begin(s[i]), end(s[i]),(char)j+97)); rep(i, m) cout <<(char)(j+97); } cout << endl; }
a.cc: In function 'int main()': a.cc:2:22: error: 'll' was not declared in this scope 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^~ a.cc:8:5: note: in expansion of macro 'rep' 8 | rep(i,n)cin>>s[i]; | ^~~ a.cc:8:9: error: 'i' was not declared in this scope 8 | rep(i,n)cin>>s[i]; | ^ a.cc:2:29: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^ a.cc:2:22: error: 'll' was not declared in this scope 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^~ a.cc:9:5: note: in expansion of macro 'rep' 9 | rep(j,26) { | ^~~ a.cc:9:9: error: 'j' was not declared in this scope 9 | rep(j,26) { | ^ a.cc:2:29: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^ a.cc:11:13: error: expected ';' before 'i' 11 | rep(i, n)m = min(m, (int) count(begin(s[i]), end(s[i]),(char)j+97)); | ^ a.cc:2:25: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^ a.cc:11:13: error: 'i' was not declared in this scope 11 | rep(i, n)m = min(m, (int) count(begin(s[i]), end(s[i]),(char)j+97)); | ^ a.cc:2:29: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^ a.cc:12:13: error: expected ';' before 'i' 12 | rep(i, m) cout <<(char)(j+97); | ^ a.cc:2:25: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^ a.cc:12:13: error: 'i' was not declared in this scope 12 | rep(i, m) cout <<(char)(j+97); | ^ a.cc:2:29: note: in definition of macro 'rep' 2 | #define rep(i,b) for(ll i=0;i<b;i++) | ^
s722363488
p03761
C++
#include<iostream> #include<algorithm> #include<cmath> using namespace std; int main() { int n; string s; cin >> n; vector<int> a(26,50); vector<int> b(26,0); for(int i=0; i<n; i++) { cin >> s; for(int j=0; j<s.size(); j++) { b[s[j]-'a']++; } for(int j=0; j<26; j++) { a[j]=min(a[j],b[j]); b[j]=0; } } char c; for(int i=0; i<26; i++) { c='a'+i; for(int j=0; j<a[i]; j++) { cout << c; } } cout << endl; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> a(26,50); | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include<cmath> +++ |+#include <vector> 4 | using namespace std; a.cc:9:10: error: expected primary-expression before 'int' 9 | vector<int> a(26,50); | ^~~ a.cc:10:10: error: expected primary-expression before 'int' 10 | vector<int> b(26,0); | ^~~ a.cc:14:7: error: 'b' was not declared in this scope 14 | b[s[j]-'a']++; | ^ a.cc:17:7: error: 'a' was not declared in this scope 17 | a[j]=min(a[j],b[j]); | ^ a.cc:17:21: error: 'b' was not declared in this scope 17 | a[j]=min(a[j],b[j]); | ^ a.cc:24:20: error: 'a' was not declared in this scope 24 | for(int j=0; j<a[i]; j++) { | ^
s823811281
p03761
C++
#include <bits/stdc++.h> #define ld long double #define ll long long int #define ull unsigned long long int #define vi vector<int> #define vl vector<ll> #define vvi vector< vector<int> > #define vvl vector< vector<ll> > #define repd(i, a, b) for (int i=(a);i<(b);i++) #define rep(i, n) repd(i,0,n) #define ALL(v) v.begin(), v.end() #define INF 1e9 #define repd(i, a, b) for (int i=(a);i<(b);i++) #define rep(i, n) repd(i,0,n) using namespace std; /** * calculate GCD(greatest common divisor) * @param a * @param b * @return */ unsigned euclidean_gcd(unsigned a, unsigned b) { if (a < b) return euclidean_gcd(b, a); unsigned r; while ((r = a % b)) { a = b; b = r; } return b; } /** * output answer * @tparam T * @param answer * @return */ template<typename T> T output(T answer) { cout << answer << endl; return 0; } /** ----from here ---------------------------------------------------------- */ int main() { int N; cin >> N; int i; vector <string> a(N); rep(i, N) { cin >> a[i]; } // vector<int> f(26, 0); vector <vector<int> > f(N, vector<int>(26, 0)); vector <vector<int> > b(N, vector<int>(26, 0)); vector<int> c(26, 0); for (int i = 0; i < N; ++i) { string s = a[i]; for (int j = 0; j < s.length(); ++j) { b[i][s[j] - 'a']++; if (f[i][s[j] - 'a'] == 0) { f[i][s[j] - 'a'] = 1; } } } for (int j = 0; j < 26; ++j) { int maxTemp = -1 for (int i = 0; i < N; ++i) { int temp = b[i][j]; if (maxTemp == -1) { maxTemp = temp; } if (temp < maxTemp) { maxTemp = temp; } } if (maxTemp > 0) { c[j] = maxTemp; } } for (int i = 0; i < 26; ++i) { if (c[i] > 0) { for (int j = 0; j < c[i]; ++j) { char temp = i + 'a'; cout << temp; } } } cout << endl; }
a.cc: In function 'int main()': a.cc:76:9: error: expected ',' or ';' before 'for' 76 | for (int i = 0; i < N; ++i) { | ^~~ a.cc:76:35: error: expected ';' before ')' token 76 | for (int i = 0; i < N; ++i) { | ^ | ;
s810416094
p03761
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; char f; vector<string>c(a); vector<int>d(26); vector<int>e(26); for(int i=0;i<26;i++){ d[i]=1000; } for(int i=0;i<a;i++){ cin>>c[i]; } for(int i=0;i<a;i++){ for(int j=0;j<c[i].size();j++){ for(int u=0;u<26;u++){ if(c[i][j]-'a'==u){ e[u]++; } } } for(int j=0;j<26;j++){ d[j]=min(d[j],e[j]); e[j]=0; } } } for(int i=0;i<26;i++){ f='a'+i for(int j=0;j<100000;j++){ if(d[i]!=0){ cout<<f<<endl; d[i]--; } else{ break; } } } cout<<endl; }
a.cc:31:3: error: expected unqualified-id before 'for' 31 | for(int i=0;i<26;i++){ | ^~~ a.cc:31:15: error: 'i' does not name a type 31 | for(int i=0;i<26;i++){ | ^ a.cc:31:20: error: 'i' does not name a type 31 | for(int i=0;i<26;i++){ | ^ a.cc:43:1: error: 'cout' does not name a type 43 | cout<<endl; | ^~~~ a.cc:45:1: error: expected declaration before '}' token 45 | } | ^
s194097823
p03761
C++
#include<bits/stdc++.h> using namespace std; char h[1000][1000];//第一个方括号记录第i个字符串,第二个方括号记录第i个字符串的第j个字符。 int s[1000],ans1[1000],ans2[1000]; int main(){ int n,flag = 0; scanf("%d",&n); for(int i = 1;i <= n;i++){ scanf("%s",h[i]);//这里字符串的输入要注意一下 s[i] = strlen(h[i]); } for(int i = 49;i <=74;i++){ ans2[i] = 10000000;//初始化 } for(int i = 1;i <= n;i++){ for(int j = 0;j < s[i];j++){ ans1[h[i][j] - '0']++; } for(int k = 49;k <= 74;k++){ ans2[k] = min(ans1[k],ans2[k]); } memset(ans1,0,sizeof(ans1)); } char p; for(int i = 49;i <= 74;i++){ if(ans2[i] != 0){ for(int j = 1;j <= ans2[i];j++){ flag = 1; printf("%c",i + '0'); } } } if(flag == 0) printf("\n"); }
a.cc:8:19: error: expected initializer before '\U0000ff1b' 8 | char h[1000][1000];//第一个方括号记录第i个字符串,第二个方括号记录第i个字符串的第j个字符。 | ^~ a.cc: In function 'int main()': a.cc:22:28: error: 'h' was not declared in this scope 22 | scanf("%s",h[i]);//这里字符串的输入要注意一下 | ^ a.cc:24:17: error: 's' was not declared in this scope 24 | s[i] = strlen(h[i]); | ^ a.cc:30:17: error: 'ans2' was not declared in this scope 30 | ans2[i] = 10000000;//初始化 | ^~~~ a.cc:36:35: error: 's' was not declared in this scope 36 | for(int j = 0;j < s[i];j++){ | ^ a.cc:38:17: error: 'ans1' was not declared in this scope 38 | ans1[h[i][j] - '0']++; | ^~~~ a.cc:38:22: error: 'h' was not declared in this scope 38 | ans1[h[i][j] - '0']++; | ^ a.cc:44:25: error: 'ans2' was not declared in this scope 44 | ans2[k] = min(ans1[k],ans2[k]); | ^~~~ a.cc:44:39: error: 'ans1' was not declared in this scope 44 | ans2[k] = min(ans1[k],ans2[k]); | ^~~~ a.cc:48:24: error: 'ans1' was not declared in this scope 48 | memset(ans1,0,sizeof(ans1)); | ^~~~ a.cc:56:20: error: 'ans2' was not declared in this scope 56 | if(ans2[i] != 0){ | ^~~~
s352933604
p03761
C++
#include <iostream> #include <cstdio> #include <queue> #include <vector> #include <stack> #include <string> #include <tuple> #include <random> #include <map> #include <set> #include <complex> #include <algorithm> #include <cassert> #include <iterator> #include <numeric> #include <cmath> #include <stdio.h> #include <functional> #define REP(i,a) for(int (i)=0;(i)<(a);i++) #define RREP(i,a,b) for(int (i)=(a);(i)<(b);i++) #define all(c) (c).begin(),(c).end() #define sz(v) (int)(v).size() typedef long long ll; using namespace std; int main(){ int n; cin>>n; vector<string> S[n]; int h[n][26]={}; REP(i,n){ cin >>S[i]; REP(j,sz(S[i]))h[i][S[i][j]-'a']++; } string ans; REP(i,26){ int tmp=100; REP(j,n)tmp=min(tmp,h[j][i]); REP(k,tmp)ans+='a'+i; } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:34:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 34 | cin >>S[i]; | ~~~ ^~~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /u
s208120475
p03761
C++
#include <iostream> #include <cstdio> #include <queue> #include <vector> #include <stack> #include <string> #include <tuple> #include <random> #include <map> #include <set> #include <complex> #include <algorithm> #include <cassert> #include <iterator> #include <numeric> #include <cmath> #include <stdio.h> #include <functional> #define REP(i,a) for(int (i)=0;(i)<(a);i++) #define RREP(i,a,b) for(int (i)=(a);(i)<(b);i++) #define all(c) (c).begin(),(c).end() #define sz(v) (int)(v).size() typedef long long ll; using namespace std; int main(){ int n; cin>>n; vector<string> S[n]; int h[n][26]={}; REP(i,n){ cin>>S[i]; REP(j,sz(S[i]))h[i][S[i][j]-'a']++; } string ans; REP(i,26){ int tmp=100; REP(j,n)tmp=min(tmp,h[j][i]); REP(k,tmp)ans+='a'+i; } cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:34:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 34 | cin>>S[i]; | ~~~^~~~~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/i
s651509061
p03761
C++
#include <vector> #include <cstdio> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <cstdlib> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i,n) for(int i=0;i<n;i++) #define SORT(c) sort((c).begin(),(c).end()) #define ALL(a) (a).begin(),(a).end() int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int a[26]; int b[26]; for(int i = 0; i < 26; i++){ a[i] = INF; b[i] = 0; } for(int i = 0; i < n; i++){ string s; cin >> s; for(int i = 0; i < s.size(); i++){ b[s[i] - 'a']++; } for(int i = 0; i < 26; i++){ a[i] = min(a[i],b[i]); } for(int i = 0; i < 26; i++){ b[i] = 0; } } for(int i = 0; i < 26; i++){ for(int j = 0; j < a[i]; j++){ cout << static_cast<char>('a' + i); } } cout << endl; }
a.cc: In function 'int main()': a.cc:27:14: error: 'INF' was not declared in this scope 27 | a[i] = INF; | ^~~
s511684553
p03761
C++
#include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <tuple> #include <set> #include <map> #include <complex> #include <iomanip> #include <cmath> using namespace std; typedef long long ll; int main() { int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; int cnt[s[0].size()]; memset(cnt, 0, sizeof(cnt)); for (int i = 0; i < s[0].size(); i++) { for (int j = 1; j < n; j++) { for (int k = 0; k < s[j].size(); k++) { if (s[0][i] == s[j][k]) { cnt[i]++; break; } } } } string ans = ""; for (int i = 0; i < s[0].size(); i++) { if (cnt[i] == n - 1) ans += s[0][i]; } sort(ans.begin(), ans.end()); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:22:3: error: 'memset' was not declared in this scope 22 | memset(cnt, 0, sizeof(cnt)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include <cmath> +++ |+#include <cstring> 12 | using namespace std;
s664292328
p03761
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string S; vector<int> counter(26, INT_MAX); for (int i = 0; i < n; i++) { cin >> S; for (int j = 0; j < 26; j++) { counter[j] = min(counter[j], count(S.begin(), S.end(), 'a' + j)); } } string ans = ""; for (int i = 0; i < 26; i++) { for (int j = 0; j < counter[i]; j++) { ans.push_back('a' + i); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:16:29: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 16 | counter[j] = min(counter[j], count(S.begin(), S.end(), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:16:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 16 | counter[j] = min(counter[j], count(S.begin(), S.end(), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:16:29: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 16 | counter[j] = min(counter[j], count(S.begin(), S.end(), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s976857806
p03761
C++
#include "bits/stdc++.h" #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) typedef long long LL; typedef unsigned long UL; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s; vector<int> abc('z' - 'a' + 1, INT_MAX); REP(i, n) { cin >> s; for (char j = 'a'; j <= 'z'; ++j) { abc[j - 'a'] = min(count(s.begin(), s.end(), j), abc[j - 'a']); } } for (char i = 'a'; i <= 'z'; ++i) { REP(j, abc[i - 'a']) { cout << i; } } return 0; }
a.cc: In function 'int main()': a.cc:29:43: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 29 | abc[j - 'a'] = min(count(s.begin(), s.end(), j), abc[j - 'a']); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:29:43: note: deduced conflicting types for parameter 'const _Tp' ('long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 29 | abc[j - 'a'] = min(count(s.begin(), s.end(), j), abc[j - 'a']); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:29:43: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 29 | abc[j - 'a'] = min(count(s.begin(), s.end(), j), abc[j - 'a']); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s938729423
p03761
C++
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef long long int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define MOD (1000000007) int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; // 移動方向 int n; vector<string> s; void input(){ cin >> n; s.resize(n); for(int i=0;i<n;i++) cin >> s[i]; } int main() { cin.tie(0); ios::sync_with_stdio(false); input(); char az[26] = "abcdefghijklmnopqrstuwxyz"; int cnt[26]; for(int i=0;i<26;i++){ int rec = INF; int tmp; for(int j=0;j<n;j++){ tmp = count(s[j].begin(), s[j].end(), az); rec = min(rec, tmp); } cnt[i] = rec; } for(int i=0;i<26;i++){ for(int j=0;j<cnt[i];j++){ cout << az[i]; } } cout << endl; return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Value = const char [26]]': /usr/include/c++/14/bits/stl_algobase.h:2163:12: required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::__count_if(_InputIterator, _InputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const char [26]>; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]' 2163 | if (__pred(__first)) | ~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4033:29: required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Tp = char [26]; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]' 4033 | return std::__count_if(__first, __last, | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 4034 | __gnu_cxx::__ops::__iter_equals_val(__value)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:34:24: required from here 34 | tmp = count(s[j].begin(), s[j].end(), az); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:270:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~
s376491887
p03761
C++
#include <vector> #include <iostream> #include <cmath> #include <numeric> #include <cstring> #include <algorithm> using namespace std; int main(){ int n,a[26]; char c[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; cin >> n; vector<string>s(n); for(int i=0;i<n;i++){ cin>>s[i]; } for(int i=0;i<26;i++){ int b=51; for(int j=0;j<n;j++){ b=min(b,count(s[j].begin(),s[j].end(),c[i])); } a[i]=b; } for(int i=0;i<26;i++){ for(int j=0;j<a[i];j++){ cout<<c[i]; } } }
a.cc: In function 'int main()': a.cc:20:18: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 20 | b=min(b,count(s[j].begin(),s[j].end(),c[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/vector:62, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 20 | b=min(b,count(s[j].begin(),s[j].end(),c[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:6: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:20:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | b=min(b,count(s[j].begin(),s[j].end(),c[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s103515235
p03761
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,n) for(int i=0;i<n;i++) int main(){ int n,memo[100][100]={0},mini=100,v,memo2[100]; string s[100],ans; cin >> n; FOR(i,n){ cin >> s[i]; } FOR(i,n){ FOR(j,s[i].size()){ memo[i][s[i].at(j)-'`']++; } } FOR(i,23){ FOR(j,n){ v=memo[j][i]; if(mini>v){ mini=v; } } memo2[i]=mini; mini=100; } FOR(int i=1;i<24;i++){ FOR(j,memo2[i]){ ans+=('`'+i-1); } } cout << ans << endl; }
a.cc:28:23: error: macro "FOR" requires 2 arguments, but only 1 given 28 | FOR(int i=1;i<24;i++){ | ^ a.cc:3:9: note: macro "FOR" defined here 3 | #define FOR(i,n) for(int i=0;i<n;i++) | ^~~ a.cc: In function 'int main()': a.cc:28:3: error: 'FOR' was not declared in this scope 28 | FOR(int i=1;i<24;i++){ | ^~~
s779063046
p03761
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,n) for(int i=0;i<n;i++) int main(){ int n,memo[100][100]={0},mini=100,v; string s[100],ans; cin >> n; FOR(i,n){ cin >> s[i]; } FOR(i,n){ FOR(j,s[i].size()){ memo[i][s[i].at(j)-'`']++; } } FOR(i,23){ FOR(j,n){ v=memo[j][i]; if(mini>v){ mini=v; } } memo2[i]=mini; mini=100; } FOR(i,23){ FOR(j,memo2[i]){ ans+=('a'+i); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:25:5: error: 'memo2' was not declared in this scope; did you mean 'memo'? 25 | memo2[i]=mini; | ^~~~~ | memo a.cc:29:11: error: 'memo2' was not declared in this scope; did you mean 'memo'? 29 | FOR(j,memo2[i]){ | ^~~~~ a.cc:3:32: note: in definition of macro 'FOR' 3 | #define FOR(i,n) for(int i=0;i<n;i++) | ^
s775841043
p03761
C++
#include <bits/stdc++.h> #define double long double #define int long long #define mii map<int,int> #define low lower_bound #define upp upper_bound #define inf 1000000007 //10^9+7 #define rep(i,n) for(int i=0;i<n;i++) #define all(vec) vec.begin(),vec.end() #define vsort(vec) sort(all(vec)) #define vrever(vec) reverse(all(vec)); #define vunsort(vec) vsort(vec); vrever(vec); #define bisea binary_search #define cend cout<<endl; #define F first #define S second using namespace std; signed main() { int n; cin>>n; int a=inf; int cnt[n][26]; string y="abcdefghijklmnopqrstuvxxyz"; rep(i,n) rep(j,26) cnt[i][j]=0; rep(i,n) { string s; cin>>s; int m=s.size(); rep(j,m) {7 cnt[i][s[j]-'a']++; } } rep(i,26) { rep(j,n) { a=min(a,cnt[j][i]); } rep(j,a) cout<<y[i]; a=inf; } cend; }
a.cc: In function 'int main()': a.cc:29:28: error: expected ';' before 'cnt' 29 | rep(j,m) {7 | ^ | ; 30 | cnt[i][s[j]-'a']++; | ~~~
s409203242
p03761
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> C(26, n); for(int i=0; i<n; i++) { string S; cin >> S; sort(S.begin(), S.end()); char tmp = 'a'; int tmpi = 0; for(int j=0; j<26; j++) { int count = 0; while(tmpi < S.size() && S[tmpi] == tmp) { count++; tmpi++; } if(C[j] > count) C[j] = count; tmp++; } } char tmp = 'a'; string ret; for(int i=0; i<26; i++) { for(int j=0; j<C[i]; j++) ret += tmp; tmp++; } cout << ret << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(S.begin(), S.end()); | ^~~~ | short
s101469353
p03761
Java
import com.sun.javafx.collections.MappingChange; import java.awt.*; import java.io.PrintWriter; import java.util.*; import java.util.List; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in); Task task = new Task(); task.solve(sc, out); out.flush(); sc.close(); } static class Task { public void solve(Scanner sc, PrintWriter out){ int n = nint(sc); List<String> sList = getStringList(sc, n); Map<Character, Integer> map = new HashMap<>(); for (int i = 0; i < n; i++) { char[] s = sList.get(i).toCharArray(); if (i==0){ for (int j = 0; j < s.length; j++) { char c = s[j]; if (map.containsKey(c)){ int tmp = map.get(c); tmp ++; map.put(c, tmp); }else{ map.put(c, 1); } } }else{ Map<Character, Integer> tmpMap = new HashMap<>(); for (int j = 0; j < s.length; j++) { char c = s[j]; if (tmpMap.containsKey(c)){ int tmp = tmpMap.get(c); tmp ++; tmpMap.put(c, tmp); }else{ tmpMap.put(c ,1); } } for (Map.Entry<Character, Integer> e : map.entrySet()){ Character x = e.getKey(); Integer mC = tmpMap.get(x); if (mC == null){ continue; } if (mC >= e.getValue()){ tmpMap.put(x, e.getValue()); }else { tmpMap.put(x, mC); } } for (Map.Entry<Character, Integer> e : tmpMap.entrySet()){ Character x = e.getKey(); if (map.containsKey(x)){ continue; }else{ tmpMap.remove(x); } } map = new HashMap<>(tmpMap); } } String r = ""; for (Map.Entry<Character, Integer> e : map.entrySet()) { for (int i = 0; i < e.getValue(); i++) { r += String.valueOf(e.getKey()); } } char[] R = r.toCharArray(); Arrays.sort(R); out.println(String.valueOf(R)); } } static int nint(Scanner sc) { return Integer.parseInt(sc.next()); } static long nlong(Scanner sc) { return Long.parseLong(sc.next()); } static double ndouble(Scanner sc) { return Double.parseDouble(sc.next()); } static float nfloat(Scanner sc) { return Float.parseFloat(sc.next()); } static String nstr(Scanner sc) { return sc.next(); } static long[] longLine(Scanner sc, int size) { long[] lLine = new long[size]; for (int i = 0; i < size; i++) { lLine[i] = nlong(sc); } return lLine; } static int[] intLine(Scanner sc, int size) { int[] iLine = new int[size]; for (int i = 0; i < size; i++) { iLine[i] = nint(sc); } return iLine; } static String[] strLine(Scanner sc, int size) { String[] strLine = new String[size]; for (int i = 0; i < size; i++) { strLine[i] = nstr(sc); } return strLine; } static long maxFromList(List<Long> longList) { return longList.stream().max(Comparator.naturalOrder()).get(); } static long minFromList(List<Long> longList) { return longList.stream().min(Comparator.naturalOrder()).get(); } public static int sumDigits(int n) { int sum = 0; while (n != 0) { sum += n % 10; n /= 10; } return sum; } public static long sumDigits(long n) { long sum = 0; while (n != 0) { sum += n % 10; n /= 10; } return sum; } static List<Integer> getIntegerList(Scanner sc, int size) { List<Integer> list = new ArrayList<>(); for (int i = 0; i < size; i++) { list.add(nint(sc)); } return list; } static List<Long> getLongList(Scanner sc, int size) { List<Long> list = new ArrayList<>(); for (int i = 0; i < size; i++) { list.add(nlong(sc)); } return list; } static List<String> getStringList(Scanner sc, int size){ List<String> stringList = new ArrayList<>(); for (int i = 0; i < size; i++) { stringList.add(nstr(sc)); } return stringList; } private static long lcm(long a, long b) { return a * b / gcd(b, a % b); } private static long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); } private static Map<Integer, Integer> primeFactorize(long num) { Map<Integer, Integer> map = new HashMap<>(); int i = 2; while (i * i <= num) { while (num % i == 0) { num /= i; if (map.containsKey(i)) { int tmp = map.get(i); tmp++; map.put(i, tmp); } else { map.put(i, 1); } } i ++; } if (num > 1) map.put((int) num, 1); return map; } }
Main.java:1: error: package com.sun.javafx.collections does not exist import com.sun.javafx.collections.MappingChange; ^ 1 error
s090599011
p03761
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n, ans[27], a[27]; string s; cin >> n; for(int j = 0; j < 27; j++){ ans[i] = 0; } for(int i = 0; i < n; i++){ cin >> s; for(int j = 0; j < 27; j++){ a[i] = 0; } for(int j = 0; j < s.length(); j++){ for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ if(c == s[j]) a[k]++; } } for(int j = 0; j < 27; j++){ ans[i] = (a[i] > ans[i]) ? ans[i] : a[i]; } } for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ for(int j = 0; j < ans[i]; j++) cout << c; } cout << endl; }
a.cc: In function 'int main()': a.cc:10:11: error: 'i' was not declared in this scope 10 | ans[i] = 0; | ^ a.cc:18:25: error: expected unqualified-id before 'int' 18 | for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ | ^~~ a.cc:18:24: error: expected ';' before 'int' 18 | for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ | ^~~~ | ; a.cc:18:44: error: expected ')' before ';' token 18 | for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ | ~ ^ | ) a.cc:18:46: error: 'c' was not declared in this scope 18 | for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ | ^ a.cc:18:51: error: 'k' was not declared in this scope 18 | for(char c = 'a', int k = 0; c <= 'z'; c++, k++){ | ^ a.cc:26:18: error: expected unqualified-id before 'char' 26 | for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ | ^~~~ a.cc:26:17: error: expected ';' before 'char' 26 | for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ | ^~~~~ | ; a.cc:26:39: error: expected ')' before ';' token 26 | for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ | ~ ^ | ) a.cc:26:41: error: 'c' was not declared in this scope 26 | for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ | ^ a.cc:26:46: error: 'i' was not declared in this scope 26 | for(int i = 0, char c ='a'; c <= 'z'; c++, i++){ | ^
s519176887
p03761
C++
#include<bits/stdc++.h> typedef long long ll; typedef long double ld; using namespace std; int main() { ll N; cin >> N; map<char, ll>mp; map<char, ll>min_v; for (char c = 'a'; c <= 'z'; c++) { min_v[c] = 100000000; //初期化 } for (ll i = 0; i < N; i++) { string S; cin >> S; for (ll i = 0; i < S.size(); i++) { mp[S[i]]++; } for (char c = 'a'; c <= 'z'; c++) { min_v[c] = min(mp[c], min_v[c]); //最小の個数 mp[c] = 0; } } string s = ""; for (auto p : min_v) { ll x = p.first; ll y = p.second; for (ll i = 0; i < p.second; i++) { s += x; //見つかった回数だけ足す } } cout << s << endl; }
a.cc:11:38: error: extended character   is not valid in an identifier 11 | min_v[c] = 100000000; //初期化 | ^ a.cc: In function 'int main()': a.cc:11:38: error: '\U00003000' was not declared in this scope 11 | min_v[c] = 100000000; //初期化 | ^~
s265547045
p03761
C++
#include<iostream> #include<map> #include<vector> using namespace std; int main() { int n; cin >> n; vector<string> v(n); for(int i = 0; i < n; i++) cin >> v[i]; int cc[26]; fill(cc, cc+26, 1e9+1); for(int i = 0; i < n; i++) { for(char c = 'a'; c <= 'z'; c++) { cc[c-'a'] = min(cc[c-'a'], (int)count(v[i].begin(), v[i].end(), c)); } } string ans; for(int i = 0; i < 26; i++) { ans += string(cc[i], (char)i + 'a'); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:45: error: 'count' was not declared in this scope 16 | cc[c-'a'] = min(cc[c-'a'], (int)count(v[i].begin(), v[i].end(), c)); | ^~~~~
s691832501
p03761
C++
#include <iostream> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; int N, m[26][50]; int main(){ cin >> N; REP(i,N) { string s; cin >> s; for (char c: s) { m[c - 'a'][i]++; } } REP(i,26) { int me = *min_element(m[i], m[i] + N); while (me--) cout << (char)('a' + i); } return 0; }
a.cc: In function 'int main()': a.cc:16:18: error: 'min_element' was not declared in this scope 16 | int me = *min_element(m[i], m[i] + N); | ^~~~~~~~~~~
s840736236
p03761
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<climits> #include<map> #include<set> #include<queue> #include<stack> #include<bitset> #include<iomanip> using namespace std; #define rep(i,j,n) for(int i=(j);i<(n);i++) #define rep2(i,j,n) for(int i=(j);i<=(n);i++) #define all(i) i.begin(),i.end() #define INF 1e9 typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<vector<string>> vvs; typedef pair<int, int> pi; typedef long long i64; int main() { int n; cin >> n; vi cou(26, INF); rep(i, 0, n) { string s; cin >> s; rep(j, 0, 26) { cou[j] = min(cou[j], count(all(s), 'a' + j)); } } string ans; rep(i, 0, 26) { char x = 'a' + i; rep(j, 0, cou[i]) { ans += x; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:35:37: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 35 | cou[j] = min(cou[j], count(all(s), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:35:37: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 35 | cou[j] = min(cou[j], count(all(s), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:35:37: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 35 | cou[j] = min(cou[j], count(all(s), 'a' + j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s983618785
p03761
C++
#include <iostream> #include <string> #include <vector> #include <alogirhtm> using namespace std; int main(void){ int n; cin >> n; vector<int> alp(26, 1000); string s; for (int i = 0; i < n; i++){ cin >> s; vector<int> temp(26, 0); for (int j = 0; j < s.size(); j++){ temp[s[j] - 'a']++; } for (int j = 0; j < 26; j++){ alp[j] = min(alp[j], temp[j]); } } for (int i = 0; i < 26; i++){ for (int j = 0; j < alp[i]; j++) cout << (char)(alp[i] - 'a'); } cout << endl; }
a.cc:4:10: fatal error: alogirhtm: No such file or directory 4 | #include <alogirhtm> | ^~~~~~~~~~~ compilation terminated.
s128058443
p03761
C++
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <set> #include <list> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const ll INF = 1LL<<29; const ll mod = 1e9+7; #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i)) #define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d)) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset((m),(v),sizeof(m)) #define chmin(x,y) (x=min(x,y)) #define chmax(x,y) (x=max(x,y)) #define fst first #define snd second #define UNIQUE(x) (x).erase(unique(all(x)),(x).end()) template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;} #define N 26 ll a[N], b[N]; int main(){ int n; cin>>n; fill(a, a+n, INF); rep(i, n){ string s; cin>>s; mset(b, 0); rep(j, b.size()) b[s[j]-'a']++; rep(j, N) a[i] = min(a[i], b[i]); } rep(i, N) rep(j, a[i]) cout<<(char)('a'+i); cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:52:26: error: request for member 'size' in 'b', which is of non-class type 'll [26]' {aka 'long long int [26]'} 52 | rep(j, b.size()) b[s[j]-'a']++; | ^~~~ a.cc:28:41: note: in definition of macro 'rep' 28 | #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i)) | ^
s644916612
p03761
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 #define PI 3.14159265358979323846 using namespace std; // int N; int cnt[26]; string S; int main(){ cin>>N; FOR(i,0,26){ cnt[i]=INF; } FOR(i,0,N){ cin>>S; FOR(j,0,26){ cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); } } FOR(i,0,26){ FOR(j,0,cnt[i]){ char c='a'+i; cout<<c; } } return 0; }
a.cc: In function 'int main()': a.cc:37:17: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:37:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:37:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s384405509
p03761
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 #define PI 3.14159265358979323846 using namespace std; // int N; int cnt[26]; string S; int main(){ cin>>N; FOR(i,0,26){ cnt[i]=INF; } FOR(i,0,N){ cin>>S; FOR(j,0,26){ cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); } } FOR(i,0,26){ FOR(j,0,cnt[i]){ char c='a'+i; cout<<c; } } return 0; }
a.cc: In function 'int main()': a.cc:37:17: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:37:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:37:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),(char)'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s673850890
p03761
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 #define PI 3.14159265358979323846 using namespace std; // int N; int cnt[26]; string S; int main(){ cin>>N; FOR(i,0,26){ cnt[i]=INF; } FOR(i,0,N){ cin>>S; FOR(j,0,26){ cnt[j]=min(cnt[j],count(S.begin(),S.end(),'a'+j)); } } FOR(i,0,26){ FOR(j,0,cnt[i]){ cout<<'a'+i; } } return 0; }
a.cc: In function 'int main()': a.cc:37:17: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:37:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:37:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | cnt[j]=min(cnt[j],count(S.begin(),S.end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s892002831
p03761
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 #define PI 3.14159265358979323846 using namespace std; // int N; int mincnt[26]; string S[50]; int main(){ cin>>N; FOR(i,0,26){ mincnt[i]=INF; } FOR(i,0,N){ cin>>S[i]; FOR(j,0,26){ mincnt[j]=min(mincnt[j],count(S[i].begin(),S[i].end(),'a'+j)); } } FOR(i,0,26){ FOR(j,0,mincnt[i]){ cout<<'a'+i; } } return 0; }
a.cc: In function 'int main()': a.cc:37:20: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 37 | mincnt[j]=min(mincnt[j],count(S[i].begin(),S[i].end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:37:20: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 37 | mincnt[j]=min(mincnt[j],count(S[i].begin(),S[i].end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:37:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 37 | mincnt[j]=min(mincnt[j],count(S[i].begin(),S[i].end(),'a'+j)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s235540740
p03761
C
#include<stdio.h> #include<string.h> int main(){ int num; char inStr[50][51]; int moji[26][51]; memset(moji,0,sizeof(moji)); scanf("%d",&num); for(int i = 0;i < num;i++){ scanf("%s", inStr[i]); fpurge(stdin); } for(int i=0;i< num;i++){ for(int j=0;j<strlen(inStr[i]);j++){ moji[i][inStr[i][j]-97]++; } } for(int i=0;i<26;i++){ int flg = 1; int min=999999; for(int j=0;j<num;j++){ if(moji[j][i] == 0)flg = 0; else{ if(min > moji[j][i])min=moji[j][i]; } } if(flg==1){ for(int k=0;k<min;k++){ printf("%c", (char)i+97); } } } printf("\n"); return 0; }
main.c: In function 'main': main.c:11:5: error: implicit declaration of function 'fpurge' [-Wimplicit-function-declaration] 11 | fpurge(stdin); | ^~~~~~
s692363463
p03761
C++
#include <stdio.h> #include <iostream> #include <sstream> #include <algorithm> #include <functional> #include <queue> #include <string.h> #define FOR(x, z, y) for(int x = (z); y; x++) #define rep(x, y) for(int x = 0; x < (y); x++) #define REP(x, z, y) for(int x = (z); x < (y); x++) #define all(x) x.begin(), x.end() #define len(x) (sizeof(x) / sizeof(x[0])) #define split_str(str, sp_word) istringstream stream(str); string res; FOR(cnt, 0, getline(stream,res,sp_word)) #define scanln(x) fgets(x, sizeof x, stdin) #define down_queue(x) priority_queue<x> #define up_queue(x) priority_queue<x, vector<x>, greater<x>> #define i_str(x) atoi(x.c_str()) typedef long long ll; using namespace std; int main(){ int N; scanf("%d",&N); getchar(); int a[26],cnt_line[26] = {}; fill(a,a + 26,51); while(N--){ string line; getline(cin,line); for(char c:line) { a[c - 'a'] = min(a[c - 'a'], count(all(line), c)); } for(int i = 'a'; i <= 'z'; i++){ if(count(all(line), i)){ cnt_line[i - 'a']++; } } } rep(i,26){ if(cnt_line[i] >= 3 && a[i] != 51){ rep(j,a[i]){ printf("%c",i + 'a'); } } } return 0; }
a.cc: In function 'int main()': a.cc:32:23: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 32 | a[c - 'a'] = min(a[c - 'a'], count(all(line), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:32:23: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 32 | a[c - 'a'] = min(a[c - 'a'], count(all(line), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:4: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:32:23: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 32 | a[c - 'a'] = min(a[c - 'a'], count(all(line), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s138863590
p03761
C
#include <stdio.h> int main(void){ int i,j,n,min; char s[51][51]; int a[51][26]={}; int b[26]={}; scanf( "%d",&n); for( i = 0; i < n; i++ ){ scanf( "%s",s[i] ); } for( i = 0; i < n; i++ ){ for( j = 0; s[i][j] != '\0'; j++ ){ a[i][s[i][j]-97]++; } } for( j = 0; j < 26; j++ ){ min = 51; for( i = 0; i < n; i++ ){ if(a[i][j] = min ){ min = a[i][j]; } } b[j] = min; } for( i = 0; i < 26; i++ ){ for( j = 0; j < b[i]; j++ ){ printf( "%c",97+i ): } } printf("\n"); return 0; }
main.c: In function 'main': main.c:34:32: error: expected ';' before ':' token 34 | printf( "%c",97+i ): | ^ | ;
s504284511
p03761
C++
#include <iostream> #include <string> #include <algorithm> #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]; sort(s[i].begin(), s[i].end()); } int max_length = s[0].length(), it = 0; for (int i = 0; i < n; i++) { if (s[i].length() > max_length) { max_length = s[i].length(); it = i; } } int l, r, max_len = 0; for (int i = 0; i < s[it].length(); i++) { for (int j = i + 1; j <= s[it.length(); j++) { string tmp = s[it].substr(i, j); bool flag = true; for (int k = 0; k < n; k++) { if (s[k].find(tmp) == string::nops) {flag = false; break;} } if (flag) { if (tmp.length() > max_len) { l = i, r = j; max_len = tmp.length } } } } if (max_len > 0) cout << s[it].substr(l, r) << endl; else cout << endl; }
a.cc: In function 'int main()': a.cc:21:39: error: request for member 'length' in 'it', which is of non-class type 'int' 21 | for (int j = i + 1; j <= s[it.length(); j++) { | ^~~~~~ a.cc:21:47: error: expected ']' before ';' token 21 | for (int j = i + 1; j <= s[it.length(); j++) { | ^ | ] a.cc:25:47: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 25 | if (s[k].find(tmp) == string::nops) {flag = false; break;} | ^~~~ a.cc:28:75: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int' 28 | if (tmp.length() > max_len) { l = i, r = j; max_len = tmp.length } | ^~~~~~
s785089333
p03761
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define loop(i,a,b) for(i=a;i<b;i++) #define rloop(i,a,b) for(i=a;i>=b;i--) #define vi vector<int> #define vl vector<ll> #define vii vector< vector<int> > #define vll vector< vector<ll> > #define vs vector<string> const int inf=1000000001; const ll INF=1e16; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 int main(){ int n,i,j; cin>>n; vs s(n); int m=inf,mi; loop(i,0,n){ cin>>s[i]; sort(s[i].begin(),s[i].end()); m=min(m,(int)s[i].size()); if(m==s[i].size()){ mi=i; } } vector<char> ans; i=0; while(i<s[mi].size()){ m=count(s[mi].begin(),s[mi].end(),s[mi][i]); i+=m; loop(j,0,s.size()){ m=min(m,count(s[j].begin(),s[j].end(),s[mi][i-m])); } loop(j,0,m){ ans.push_back(s[mi][i-m]); } } loop(i,0,ans.size()){ cout<<ans[i]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:36:30: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 36 | m=min(m,count(s[j].begin(),s[j].end(),s[mi][i-m])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:36:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 36 | m=min(m,count(s[j].begin(),s[j].end(),s[mi][i-m])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:36:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 36 | m=min(m,count(s[j].begin(),s[j].end(),s[mi][i-m])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s290566840
p03761
C++
#include <iostream> #include <vector> #include <string> #include <sys/time.h> using namespace std; void solve(int n, vector<string> s){ //vector< vector<int> > bin(n vector<int>(26,0)); vector< vector<int> > bin(26, vector<int>(n+1,0)); string answer = ""; for (int i = 0; i < n; i++) { while (!s[i].empty()) { for (int j = 0; j < 26; j++) { if (s[i].back() == 'a'+j) { bin[j][i] += 1; s[i].pop_back(); break; } } } } for (int i = 0; i < 26; i++) { bin[i][n] = *min_element(bin[i].begin(), bin[i].end()-1); for (int j = 0; j < bin[i][n]; j++) { answer.push_back('a' + i); } } cout << answer << endl; } int main(){ struct timeval start,end; long long span; int n; gettimeofday(&start,NULL); cin >> n; vector<string> s(n); for (int i = 0; i < n; i++) { cin >> s[i]; } solve(n, s); gettimeofday(&end,NULL); span = (end.tv_sec -start.tv_sec)*1000000LL + (end.tv_usec - start.tv_usec); fprintf(stderr,"**Total time: %lld ms\n",span/1000); return 0; }
a.cc: In function 'void solve(int, std::vector<std::__cxx11::basic_string<char> >)': a.cc:24:22: error: 'min_element' was not declared in this scope 24 | bin[i][n] = *min_element(bin[i].begin(), bin[i].end()-1); | ^~~~~~~~~~~
s181112030
p03761
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) int main() { int n; string o[52],s[52],much; cin >> n; rep(i, 0, n) { cin >> o[i]; s[i] = o[i]; //cout << s[i] << " " << o[i] << endl; } rep(i, 0, s[0].size()) { char m = s[0][i]; //cout << m <<" "<<"start"<< endl; bool flag = true; rep(j, 1, n) { if (s[j].find(m) == -1) { flag = false; break; } } if (flag == true) { rep(j, 0, n) { //cout << s[j].find(m) << endl; //s[j].erase(s[j].begin() + s[j].find(m),s[j].end()); s[j].replace(s[j].find(m), 1, "*"); //cout << s[j]<< endl; } much += m; } } sort(much.begin(), much.e
a.cc: In function 'int main()': a.cc:34:33: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'e' 34 | sort(much.begin(), much.e | ^ a.cc:34:34: error: expected '}' at end of input 34 | sort(much.begin(), much.e | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s754623612
p03761
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> int main() { int n = 0; std::cin >> n; std::vector<std::string>str(n); std::vector<std::pair<char, int>>str_char_pair{}; bool enable = false; for (int i = 0; i < n; i++) { std::cin >> str[i]; for (char c = 'a'; c <= 'z'; c++) { int count = std::count(str[i].begin(), str[i].end(), c); if (count >= 1) { str_char_pair.emplace_back(c, count); } } } std::sort(str_char_pair.begin(), str_char_pair.end()); std::vector<std::pair<char, int>>enable_str_pair; for (char c = 'a'; c <= 'z'; c++) { int count = std::count_if(str_char_pair.begin(), str_char_pair.end(), [&c](std::pair<char, int>p) ->bool {return p.first == c;}); if (count == n) { auto it = std::find(str_char_pair.begin(), str_char_pair.end(), [&c](std::pair<char, int>p) ->bool {return p.first == c;}); /*auto it = str_char_pair.begin(); for (auto i = str_char_pair.begin(); i != str_char_pair.end(); i++) { bool b = [&c](std::pair<char, int>p) ->bool {return p.first == c;}(*i); if (b) { it = i; break; } }*/ for (size_t i = 0; i < n; i++) { enable_str_pair.push_back(*(it + i)); } } } for (char c = 'a'; c <= 'z'; c++) { for (auto& i : enable_str_pair) { if (i.first == c) { for (int j = 0; j < i.second; j++) { std::cout << c; enable = true; } break; } } } if (!enable)std::cout << ""; std::cout << std::endl; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<char, int>*, std::vector<std::pair<char, int> > >; _Value = const main()::<lambda(std::pair<char, int>)>]': /usr/include/c++/14/bits/stl_algobase.h:2107:14: required from '_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<char, int>*, vector<pair<char, int> > >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const main()::<lambda(pair<char, int>)> >]' 2107 | if (__pred(__first)) | ~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:2152:23: required from '_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator = __gnu_cxx::__normal_iterator<pair<char, int>*, vector<pair<char, int> > >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const main()::<lambda(pair<char, int>)> >]' 2152 | return __find_if(__first, __last, __pred, | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2153 | std::__iterator_category(__first)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:3850:28: required from '_IIter std::find(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<pair<char, int>*, vector<pair<char, int> > >; _Tp = main()::<lambda(pair<char, int>)>]' 3850 | return std::__find_if(__first, __last, | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 3851 | __gnu_cxx::__ops::__iter_equals_val(__val)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:34:23: required from here 34 | auto it = std::find(str_char_pair.begin(), str_char_pair.end(), [&c](std::pair<char, int>p) ->bool {return p.first == c;}); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:270:24: error: no match for 'operator==' (operand types are 'std::pair<char, int>' and 'const main()::<lambda(std::pair<char, int>)>') 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:1208:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator==(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1208 | operator==(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1208:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1216:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator==(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1216 | operator==(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1216:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::fpos<_StateT>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::allocator<_CharT>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::reverse_iterator<_Iterator>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::reverse_iterator<_Iterator>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::move_iterator<_IteratorL>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'const std::move_iterator<_IteratorL>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'const main()::<lambda(std::pair<char, int>)>' is not derived from 'const std::pair<_T1, _T2>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::pair<char, int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 270 | { return *__it == _M_value; } | ~~~~~~^~~~~~~~~~~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Trai
s366356890
p03761
C++
//http://abc058.contest.atcoder.jp/tasks/arc071_a #include <iostream> using namespace std; int n; string S[50]; void readInput(){ cin >> n; for(int i=0; i<n; i++){ cin >> S[i]; } } int main(void){ readInput(); int count[50][26]; for(int i=0; i<n; i++){ for(int j=0; j<S[i].size(); j++){ int c = int(S[i][j])-int('a'); count[i][c]++; } } for(int i=0; i<26; i++){ int min = 10000; for(int j=0; j<n; j++){ if(min > count[j][i]){ min = count[j][i]; } } for(int j=0; j<min; j++){ cout << char(i+a); } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:28: error: 'a' was not declared in this scope 33 | cout << char(i+a); | ^
s280659159
p03761
C++
//http://abc058.contest.atcoder.jp/tasks/arc071_a #include <iostream> using namespace std; int n; string S[50]; void readInput(){ cin >> n; for(int i=0; i<n; i++){ cin >> S[i]; } } int main(void){ readInput(); int count[50][26]; const int a = int('a'); for(int i=0; i<n; i++){ int size = S[i].size(); for(int j=0; j<size; j++){ int c = int(S[i][j])-a; ::count[i][c]++; } } int min; for(int i=0; i<26; i++){ min = 10000; for(int j=0; j<n; j++){ if(min > ::count[j][i]){ min = ::count[j][i]; } } for(int j=0; j<min; j++){ cout << char(i+a); } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:15: error: '::count' has not been declared 24 | ::count[i][c]++; | ^~~~~ a.cc:31:24: error: '::count' has not been declared 31 | if(min > ::count[j][i]){ | ^~~~~ a.cc:32:25: error: '::count' has not been declared 32 | min = ::count[j][i]; | ^~~~~
s105917470
p03761
C++
#include <iostream> using namespace std; string s[60]; int main(void){ int N; cin >> N; int i; for (int i=0;i<N;i++) cin >> s[i]; string ans; for(char c="a";c<="z";c++){ int small = 60; for (int i=0;i<N;i++){ int cnt = 0; for(int j=0;j<s[i].length();j++)//cが何回現れるか if(s[i][j]==c) cnt++; small = min(small,cnt); } for(int i=0;i<small;i++) ans+=c; } cout << ans <<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 11 | for(char c="a";c<="z";c++){ | ^~~ | | | const char* a.cc:11:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | for(char c="a";c<="z";c++){ | ~^~~~~
s754132737
p03761
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; string s[n]; int m[n][26] = {}; for (int i = 0; i < n; i++) { cin >> s[i]; for (int j = 0; s[i][j] != '\0'; j++) { m[i][s[i][j] - 'a']++; } } for (int i = 0; i < 26; i++) { int cn = 50; for (int j = 0; j < n; j++) { cn = min(cn, s[j][i]); } cout << string(cn, i + 'a'); } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:15: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 19 | cn = min(cn, s[j][i]); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:15: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 19 | cn = min(cn, s[j][i]); | ~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
s468462122
p03761
Java
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Sample { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); List<Character> a = new ArrayList<Character>(51); List<String> list = new ArrayList<String>(); for(int i=0;i<n;i++){ list.add(scan.next()); } List<Character > b =new ArrayList<Character > () ; List<Character > c = new ArrayList<Character > () ; b= cha(list.get(0)); Collections.sort(b); if(n==1){ for(char t:b){ System.out.print(t); } }else{ c = cha(list.get(1)); Collections.sort(c); b.retainAll(c); a=b; for(int i=0;i<n-1;i++){ List<Character > d =new ArrayList<Character > () ; List<Character > e = new ArrayList<Character > () ; d= cha(list.get(i)); e = cha(list.get(i+1)); Collections.sort(d); Collections.sort(e); d.retainAll(e); a.retainAll(d); } for(char g:a){ System.out.print(g); } } } public static List<Character > cha(String s){ List<Character > a = new ArrayList<Character >(); for(int i=0;i<s.length();i++){ a.add(s.charAt(i)); } return a; } }
Main.java:5: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s981249402
p03761
Java
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Sample { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); List<Character> a = new ArrayList<Character>(50); List<String> list = new ArrayList<String>(); for(int i=0;i<n;i++){ list.add(scan.next()); } List<Character > b =new ArrayList<Character > () ; List<Character > c = new ArrayList<Character > () ; b= cha(list.get(0)); c = cha(list.get(1)); b.retainAll(c); Collections.sort(b); Collections.sort(c); a=b; for(int i=0;i<n-1;i++){ List<Character > d =new ArrayList<Character > () ; List<Character > e = new ArrayList<Character > () ; d= cha(list.get(i)); e = cha(list.get(i+1)); Collections.sort(d); Collections.sort(e); d.retainAll(e); a.retainAll(d); } for(char g:a){ System.out.print(g); } } public static List<Character > cha(String s){ List<Character > a = new ArrayList<Character >(); for(int i=0;i<s.length();i++){ a.add(s.charAt(i)); } return a; } }
Main.java:5: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s866848580
p03761
C++
#include <iostream> #include <sstream> #include <vector> #include <cmath> #include <ctime> #include <cassert> #include <iomanip> #include <cstdio> #include <float.h> #include <queue> #include <set> #include <map> #include <fstream> #include <cstdlib> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <stack> #include <functional> using namespace std; #define endl '\n' #define MOD 1000000007 #define INF 1ll<<30 // #define MAX 100010 #define eps 1e-11 #define bit_max 1ll<<32 #define _USE_MATH_DEFINES // long long binpow(long long a,long long b) // { // if (b == 1) return a; // long long res = binpow(a, b/2)%MOD; // if (b % 2) return (res*((res*a)%MOD))%MOD; // else return (res * res)%MOD; // } // long long int fact(long long int a) // { // if(a==0||a==1) // return 1; // long long int ans = 1; // for(int i=a;i>=1;i--) // ans = (ans * i); // return ans; // } // long long int ivmod(long long int a) // { // return binpow(a,MOD-2); // } // long long int ncr(long long int a,long long int b) // { // long long int pans=1; // for(int i =a;i>max(b,a-b);i--) // pans=pans*i; // long long int div = fact(min(b,a-b)); // // cout<<ans<<" "<<div<<endl; // pans = pans/div; // return pans; // } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // #ifndef ONLINE_JUDGE // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); // #endif int n; cin>>n; map<char,int> mm; for(int i=0;i<n;i++) { string a; cin>>a; if(i==0) { for(int j=0;j<a.length();j++) { mm[a[j]]++; } } else { map<char,int> mmt; for(int j=0;j<a.length();j++) { mmt[a[j]]++; } map<char,int>::iterator itt = mmt.begin(); for(map<char,int>::iterator it = mm.begin();it!=mm.end();it++) { it->second = min(it->second,itt->second) itt++; } } } char arr[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; int c = 0; for(map<char,int>::iterator it = mm.begin();it!=mm.end();it++) { int temp = it->second; for(int i=0;i<temp;i++) { cout<<arr[c]; } c++; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:102:57: error: expected ';' before 'itt' 102 | it->second = min(it->second,itt->second) | ^ | ; 103 | itt++; | ~~~
s919113286
p03761
C++
#include <iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<string> #include<stack> #include <queue> #include<algorithm> typedef long long int ll; using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define REP(i,n) for (int i=0;i<(n);i++) #define EREP(i,n) for (int i=1;i<=(n);i++) #define EVEL 1 #ifndef EVEL #define DEB(X) cout << #X << ":" <<X<<" " ; #define TF(f) f ? cout<<"true " : cout<<"false "; #define END cout<<"\n"; #else #define DEB(X) {X=X;} #define TF(f) {f=f;} #define END {} #endif const ll MOD = 1000000007; ll N,sum=0,c; std::vector<std::string> S; string saw; string as="",ans=""; int m[30]; int yui[30]; int main(){ ios_base::sync_with_stdio(false); cin>>N; REP(i,N){ string s; cin>>s; for(auto x:s){ DEB((int)x-(int)'a') yui[(int)x-(int)'a']++; DEB(yui[(int)x-(int)'a'])END } REP(j,(int)'z'-(int)'a'+1){ if(i==0){ m[j]=yui[j]; }else{ DEB(j)DEB(m[j])DEB(yui[j])END m[j]=min(yui[j],m[j]); } if(m[j]==0&&yui[j]==0)break; } REP(k,30)yui[k]=0; } DEB(m[0])DEB(m[1])DEB(m[2])END REP(i,(int)'z'-(int)'a'+1){ REP(j,m[i]){ cout<<(char)(i+(int)'a'); } } cout<<endl; //cout<<ans; return 0; }
a.cc: In function 'int main()': a.cc:40:11: error: lvalue required as left operand of assignment 40 | DEB((int)x-(int)'a') | ~~~~~~^~~~~~~~~ a.cc:21:17: note: in definition of macro 'DEB' 21 | #define DEB(X) {X=X;} | ^
s361590746
p03761
Java
package AtCoder; public class DubiousDocument { public static void main(String[] args) { String count = System.console().readLine(); int iCount = Integer.parseInt(count); int[] alphabetTable = new int[26]; for (int i = 0; i < 26; i++) { alphabetTable[i] = 1000; } for (int i = 0; i < iCount; i++) { String tempStr = System.console().readLine(); for (int j = 0; j < 26; j++) { alphabetTable[j] = Math.min(CountChar(tempStr, (char) (0x61 + j)), alphabetTable[j]); } } for (int i = 0; i < 26; i++) { for (int j = 0; j < alphabetTable[i]; j++) { System.out.print((char) (0x61 + i)); } } System.out.println(""); } private static int CountChar(String input, char needle) { int count = 0; int now = 0; int index; while ((index = input.indexOf(needle, now)) >= 0) { count++; now = index; } return count; } }
Main.java:3: error: class DubiousDocument is public, should be declared in a file named DubiousDocument.java public class DubiousDocument { ^ 1 error
s562453054
p03761
C++
#include <string> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin >> n; //初期条件 int x[27] = {}; string str; cin >> str; for (int i = 0; i < str.size(); ++i){ x[str[i]-'a']++; } //比較 for (int i = 1; i < n; ++i){ string str2; cin >> str2; int x2[27] = {}; for (int j = 0; j < 27; ++j){ x2[str2[j]-'a']++; } for (int j = 0; j < 27; ++j){ x[j] = min(x[j], x2[j]); } } //出力 for (int i = 0; i < 27; ++i){ for (int j = 0; j < x[i]; ++j){ cout << (char)('a'+i); } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin >> n; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <algorithm> +++ |+#include <iostream> 4 | a.cc:35:13: error: 'cout' was not declared in this scope 35 | cout << (char)('a'+i); | ^~~~ a.cc:35:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:38:5: error: 'cout' was not declared in this scope 38 | cout << endl; | ^~~~ a.cc:38:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:38:13: error: 'endl' was not declared in this scope 38 | cout << endl; | ^~~~ a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 3 | #include <algorithm> +++ |+#include <ostream> 4 |
s460294193
p03761
C++
#include <iostream> #include <string> #include <algorithm> #include <map> using namespace std; int main() { int n; cin >> n; string buf, ans; map<char, int> word_map, tmp_map; cin >> buf; map<char, int>::iterator it; for (int i = 0; i < buf.size(); i++) { word_map[buf[i]]++; } for (int i = 1; i < n; i++) { cin >> buf; for (int j = 0; j < buf.size(); j++) { tmp_map[buf[j]]++; } for(it = word_map.begin(); it!=word_map.end(); it++ ) { if (word[it->first] > tmp[it->first]) word_map[it-first] = tmp[it-first]; } } //cout << "OK" << endl; //map<char, int>::iterator it; for(it = word_map.begin(); it!=word_map.end(); it++ ) { for(int i = 0; i < it->second; i++) cout << it->first; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:17: error: 'word' was not declared in this scope 30 | if (word[it->first] > tmp[it->first]) | ^~~~ a.cc:30:35: error: 'tmp' was not declared in this scope; did you mean 'tm'? 30 | if (word[it->first] > tmp[it->first]) | ^~~ | tm a.cc:31:29: error: 'first' was not declared in this scope 31 | word_map[it-first] = tmp[it-first]; | ^~~~~
s923429328
p03761
C++
#include <iostream> #include <string> #include <algorithm> #include <map> using namespace std; int main() { int n; cin >> n; string buf, ans; map<char, int> word_map, tmp_map; cin >> buf; for (int i = 0; i < buf.size(); i++) { word_map[buf[i]]++; } for (int i = 1; i < n; i++) { cin >> buf; for (int j = 0; j < buf.size(); j++) { tmp_map[buf[j]]++; } for(it = word_map.begin(); it!=word_map.end(); it++ ) { if (word[it->first] > tmp[it->first]) word_map[it-first] = tmp[it-first]; } } //cout << "OK" << endl; //map<char, int>::iterator it; map<char, int>::iterator it; for(it = word_map.begin(); it!=word_map.end(); it++ ) { for(int i = 0; i < it->second; i++) cout << it->first; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:13: error: 'it' was not declared in this scope; did you mean 'i'? 27 | for(it = word_map.begin(); it!=word_map.end(); it++ ) { | ^~ | i a.cc:28:17: error: 'word' was not declared in this scope 28 | if (word[it->first] > tmp[it->first]) | ^~~~ a.cc:28:35: error: 'tmp' was not declared in this scope; did you mean 'tm'? 28 | if (word[it->first] > tmp[it->first]) | ^~~ | tm a.cc:29:29: error: 'first' was not declared in this scope 29 | word_map[it-first] = tmp[it-first]; | ^~~~~
s748082266
p03761
C
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s288649647
p03761
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> using namespace std; int main() { int i,j,k,n; string S[50]; char T[100],Temp1[100]; string Temp; char A[1000]={}; cin >> n; j=0; for(i=0;i<n;i++){ cin >> T; sort(T,T+strlen(T)); S[i]=T; } Temp=S[0]; int l=0; for(i=1;i<n;i++){ j=0;k=0;l=0; while((Temp[k]!=0)&&(S[i][j]!=0)) if(S[i][j]==Temp[k]){ j++;k++; Temp1[l]=S[i][j]; l++; }else if(Temp[k]>S[i][j]){ j++; }else if(Temp[k]<S[i][j]){ k++; } Temp=Temp1; } cout << Temp; cin >> n; return 0; }
a.cc: In function 'int main()': a.cc:22:26: error: 'strlen' was not declared in this scope 22 | sort(T,T+strlen(T)); | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <vector> +++ |+#include <cstring> 5 | #include <string>
s574810764
p03761
C++
#include<stdio.h> #include<string.h> main(){ int l,n,i,j; char b[100],a[100]; int x[200]={0},h[200]={0}; scanf("%d",&n); getchar(); gets(a); n--; for(i=0;i<strlen(a);i++) h[a[i]]+=1; while(n--){ gets(b); for(i=0;i<strlen(b);i++) { x[b[i]]+=1; } for(i=0;i<strlen(a);i++) { if (x[a[i]]==0&&h[a[i]]!=0) h[a[i]]=0; } memset(x,0,sizeof(x)); } for(i=0;i<26;i++){ if (h['a'+i]!=0) for(j=1;j<=h['a'+i];j++) { printf("%c",'a'+i); } } }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a); | ^~~~ | getw
s628505178
p03761
C++
#include<bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(0); string a, b; int n; cin >> n; int c[26]; for(int i = 0; i < 26; i++){ c[i] = 1 << 25; } for(int i = 0; i < n; i++){ string str; cin >> str; sort(str.begin(), str.end()); for(int j = 0; j < 26; j++){ c[j] = min(c[j], upper_bound(str.begin(), str.end(), j + 'a') - lower_bound(str.begin(), str.end(), j + 'a')); } } for(int i = 0; i < 26; i++){ while(c[i]--) cout << char(i + 'a'); } cout << "\n"; }
a.cc: In function 'int main()': a.cc:21:17: error: no matching function for call to 'min(int&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)' 21 | c[j] = min(c[j], upper_bound(str.begin(), str.end(), j + 'a') - lower_bound(str.begin(), str.end(), j + 'a')); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:21:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type' {aka 'long int'}) 21 | c[j] = min(c[j], upper_bound(str.begin(), str.end(), j + 'a') - lower_bound(str.begin(), str.end(), j + 'a')); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:21:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 21 | c[j] = min(c[j], upper_bound(str.begin(), str.end(), j + 'a') - lower_bound(str.begin(), str.end(), j + 'a')); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s688537999
p03762
C++
#include "bits/stdc++.h" using namespace std; using ll=long long; using vll=vector< ll>; using vvll=vector< vll>; using vvvll=vector< vvll>; using vvvvll=vector<vvvll>; constexpr ll INF = 1LL << 60; struct Fast{ //cin,cout高速化のおまじない+桁数指定 Fast(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(std::numeric_limits<double>::max_digits10); } } fast; #define rep(i, S, E) for (ll i = (S); i <= (E); i++) #define dep(i, E, S) for (ll i = (E); i >= (S); i--) #define each(e, v) for (auto&& e : v) #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; }return false; } template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; }return false; } template<class T> inline T MaxE(vector<T>&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmax(m,v[i]); return m; } template<class T> inline T MinE(vector<T>&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmin(m,v[i]); return m; } template<class T> inline T MaxE(vector<T> &v) { return MaxE(v,0,(ll)v.size()-1); } template<class T> inline T MinE(vector<T> &v) { return MinE(v,0,(ll)v.size()-1); } template<class T> inline T Sum(vector<T> &v,ll S,ll E){ T s=T(); rep(i,S,E)s+=v[i]; return s; } template<class T> inline T Sum(vector<T> &v) { return Sum(v,0,v.size()-1); } template<class T> inline ll sz(T &v){ return (ll)v.size(); } template<class T> inline T POW(T a, ll n){ T r=1; for (; n>0; n>>=1, a*=a){ if (n&1)r*=a; } return r; } inline ll POW(int a, ll n){ return POW((ll)a, n); } inline ll CEIL(ll a, ll b){ return (a+b-1)/b; } template<ll MOD> struct mll_{ ll val; mll_(ll v = 0): val(v % MOD){ if (val < 0) val += MOD; } mll_ operator - () const { return -val; } mll_ operator + (const mll_ &b) const { return val + b.val; } mll_ operator - (const mll_ &b) const { return val - b.val; } mll_ operator * (const mll_ &b) const { return val * b.val; } mll_ operator / (const mll_ &b) const { return mll_(*this) /= b; } mll_ operator + (ll b) const { return *this + mll_(b); } mll_ operator - (ll b) const { return *this - mll_(b); } mll_ operator * (ll b) const { return *this * mll_(b); } friend mll_ operator + (ll a,const mll_ &b) { return b + a; } friend mll_ operator - (ll a,const mll_ &b) { return -b + a; } friend mll_ operator * (ll a,const mll_ &b) { return b * a; } friend mll_ operator / (ll a,const mll_ &b) { return mll_(a)/b; } mll_ &operator += (const mll_ &b) { val=(val+b.val)%MOD; return *this; } mll_ &operator -= (const mll_ &b) { val=(val+MOD-b.val)%MOD; return *this; } mll_ &operator *= (const mll_ &b) { val=(val*b.val)%MOD; return *this; } mll_ &operator /= (const mll_ &b) { ll c=b.val,d=MOD,u=1,v=0; while (d){ ll t = c / d; c -= t * d; swap(c,d); u -= t * v; swap(u,v); } val = val * u % MOD; if (val < 0) val += MOD; return *this; } mll_ &operator += (ll b) { return *this += mll_(b); } mll_ &operator -= (ll b) { return *this -= mll_(b); } mll_ &operator *= (ll b) { return *this *= mll_(b); } mll_ &operator /= (ll b) { return *this /= mll_(b); } bool operator == (const mll_ &b) { return val == b.val; } bool operator != (const mll_ &b) { return val != b.val; } bool operator == (ll b) { return *this == mll_(b); } bool operator != (ll b) { return *this != mll_(b); } friend bool operator == (ll a,const mll_ &b) { return mll_(a) == b.val; } friend bool operator != (ll a,const mll_ &b) { return mll_(a) != b.val; } friend ostream &operator << (ostream &os,const mll_ &a) { return os << a.val; } friend istream &operator >> (istream &is,mll_ &a) { return is >> a.val; } static mll_ Combination(ll a,ll b){ chmin(b,a-b); if (b<0) return mll_(0); mll_ c = 1; REP(i,b) c *= a-i; REP(i,b) c /= i+1; return c; } }; using mll = mll_<1000000007LL>; using vmll = std::vector<mll>; using vvmll = std::vector<vmll>; using vvvmll = std::vector<vvmll>; using vvvvmll = std::vector<vvvmll>; void solve() { ll n,m; cin >> n >> m; vector<ll> x(n); rep(i,0,n-1){ ll x_; cin>>x_; x[i]=x_; } vector<ll> y(m); rep(i,0,m-1){ ll y_; cin>>y_; y[i]=y_; } mll smx=0; rep(i,1,n-1){ mll s=(x[i]-x[i-1]); s*=i; s*=n-i; smx+=s; } mll smy=0; rep(i,1,m-1){ mll s=(y[i]-y[i-1]); s*=i; s*=m-i; smy+=s; } mll ans=smx*smy; cout << ans << '\n'; } int main(){ #if 1 solve(); #else ll t; cin >> t; rep(i, 0, t-1){ solve(); } #endif return 0; }
a.cc: In static member function 'static mll_<MOD> mll_<MOD>::Combination(ll, ll)': a.cc:75:21: error: 'i' was not declared in this scope 75 | REP(i,b) c *= a-i; | ^ a.cc:75:17: error: there are no arguments to 'REP' that depend on a template parameter, so a declaration of 'REP' must be available [-fpermissive] 75 | REP(i,b) c *= a-i; | ^~~ a.cc:75:17: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) a.cc:75:26: error: expected ';' before 'c' 75 | REP(i,b) c *= a-i; | ^ a.cc:76:17: error: there are no arguments to 'REP' that depend on a template parameter, so a declaration of 'REP' must be available [-fpermissive] 76 | REP(i,b) c /= i+1; | ^~~ a.cc:76:26: error: expected ';' before 'c' 76 | REP(i,b) c /= i+1; | ^
s260332305
p03762
C++
#include <bits/stdc++.h> using namespace std; constexpr int mod = 1e9 + 7; int main() { int n, m; cin >> n >> m; vector<int> x(n), y(m); for (int i=0; i<n; ++i) cin >> x.at(i); for (int i=0; i<m; ++i) cin >> y.at(i); cout << ((((x.back() - x.front()) % mod) * ((y.back() - y.front()) % mod)) % mod) * ((n-1) * (m-1) % mod)) % mod << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:108: error: expected ';' before ')' token 13 | cout << ((((x.back() - x.front()) % mod) * ((y.back() - y.front()) % mod)) % mod) * ((n-1) * (m-1) % mod)) % mod << endl; | ^ | ;
s899018113
p03762
C++
#include<bits/stdc++.h> using namespace std; static const int64_t mod=1000000007; int main(){ int N,M; cin>>N>>M; vector<int64_t>x(N); for(int i=0;i<N;i++) cin>>x.at(i); vector<int64_t>y(M); for(int i=0;i<M;i++) cin>>y.at(i); int64_t X=0; for(int i=0;i<N;i++){ int64_t k=(mod+2*i-N+1)%mod; k=(k*X.at(i))%mod; X=(X+k)%mod; } int64_t Y=0; for(int i=0;i<M;i++){ int64_t k=(mod+2*i-M+1)%mod; k=(k*Y.at(i))%mod; Y=(X+k)%mod; }int64_t ans=(X*Y)%mod; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:12: error: request for member 'at' in 'X', which is of non-class type 'int64_t' {aka 'long int'} 16 | k=(k*X.at(i))%mod; | ^~ a.cc:21:12: error: request for member 'at' in 'Y', which is of non-class type 'int64_t' {aka 'long int'} 21 | k=(k*Y.at(i))%mod; | ^~
s773429085
p03762
C++
#include<bits/stdc++.h> #define inf ((1<<30)-1) #define linf ((1<<62)ll-1) #define LL long long #define F(i,a,b,c) for(register int i=(a);(b);i=(c)) #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) #define Fd(i,a,b) for(register int i=(a);i>=(b);--i) #define Fn(i,a) for(register int i=las[(a)];i;i=nex[i]) #define COND(c) (isprint(c)) int Fl,Pn,SI=100;char mch=' ',ch,Bf[21]; void chin(char&c){while(!COND(c=getchar()));} template<typename t>void in(t&a){a=0;ch=getchar();Fl=1;while(((ch<'0')||(ch>'9'))&&ch!=EOF)Fl=(ch=='-')?-Fl:Fl,ch=getchar();while((ch>='0')&&(ch<='9'))a=a*10+ch-'0',ch=getchar();a*=Fl;}template<typename t>void out(t a){if(a<0)putchar('-'),a=-a;if(a==0)putchar('0');while(a)Bf[++Pn]=a%10+'0',a/=10;while(Pn)putchar(Bf[Pn]),--Pn;putchar(mch);} template<typename t,typename ...ARGS>void in(t&a,ARGS&...args){in(a);in(args...);} template<typename t,typename ...ARGS>void out(t a,ARGS... args){out(a);out(args...);} using namespace std; int n,m,a[100001],b[100001];LL sum; #define mod 1000000007 int main() { in(n,m); Fu(i,1,n)in(a[i]); Fu(i,1,m)in(b[i]); Fu(i,1,n) Fu(j,i+1,n) Fu(k,1,m) Fu(j,k+1,m) (sum+=((LL)((a[j]-a[i])%mod)*(b[l]-b[k])%mod)%mod)%=mod; cout<<sum<<endl; return 0; } //BY Segment_Tree_Juruo (2020严誉沣)
a.cc: In function 'int main()': a.cc:21:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 21 | Fu(i,1,n)in(a[i]); | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:22:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 22 | Fu(i,1,m)in(b[i]); | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:23:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 23 | Fu(i,1,n) | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:24:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 24 | Fu(j,i+1,n) | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:25:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 25 | Fu(k,1,m) | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:26:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 26 | Fu(j,k+1,m) | ^ a.cc:6:36: note: in definition of macro 'Fu' 6 | #define Fu(i,a,b) for(register int i=(a);i<=(b);++i) | ^ a.cc:27:41: error: 'l' was not declared in this scope 27 | (sum+=((LL)((a[j]-a[i])%mod)*(b[l]-b[k])%mod)%mod)%=mod; | ^
s628627802
p03762
C++
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools from collections import deque sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 DR = [1, -1, 0, 0] DC = [0, 0, 1, -1] def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def F(): return float(sys.stdin.readline()) def S(): return input() fac = [-1] * (10**7+1) inv = [-1] * (10**7+1) finv = [-1] * (10**7+1) fac[0] = fac[1] = 1 inv[1] = 1 finv[0] = finv[1] = 1 def main(): n, m = LI() x = sorted(LI()) y = sorted(LI()) ans = 0 for i in range(len(x)): k = i + 1 ans += (k - 1 - n + k) * x[i] ysum = 0 for j in range(len(y)): k = j + 1 ysum += (k - 1 - m + k) * y[j] ans *= ysum ans %= mod print(ans) main()
a.cc:1:1: error: 'import' does not name a type 1 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s231237815
p03762
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; int n, m; const long long MOD = 1000000007; long long C(long long a) { return a * (a - 1) / 2; } int main() { cin >> n >> m; long long ansn = 0; long long resn = 0; cin >> resn; for (int i = 0; i < n-1; ++i) { long long tmp = C(n) - C(i+1) - C(n-1-i); long long x; cin >> x; ansn += (x - resn) * tmp % MOD; ansn %= MOD; resn = x; } long long ansm = 0; long long resm = 0; cin >> resm; for (int i = 0; i < m-1; ++i) { long long tmp = C(m) - C(i+1) - C(m-1-i); long long y; cin >> y; ansm += (y - resm) * tmp % MOD; ansm %= MOD; resm = y; } cout << (ansn * ansm) % MOD << endl; } }
a.cc:40:1: error: expected declaration before '}' token 40 | } | ^
s456535353
p03762
C++
#include <bits/stdc++.h> using namespace std; #define repr(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) for(int i=0;i<n;i++) #define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b) #define reprev(i,n) reprrev(i,0,n) typedef long long ll; typedef unsigned long long ull; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } /* attention long longのシフト演算には気をつけよう タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも sizeは(int)とキャストしよう cin.tie(0); ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう */ const ll mod = 1e9+7; void chmod(ll &M){ if(M >= mod) M %= mod; else if(M < 0){ M += (abs(M)/mod + 1)*mod; M %= mod; } } ll modpow(ll x, ll n){ if(n==0) return 1; ll res=modpow(x, n/2); if(n%2==0) return res*res%mod; else return res*res%mod*x%mod; } int getl(int i, int N) { return i==0? N-1:i-1; }; int getr(int i, int N) { return i==N-1? 0:i+1; }; // 線分 ab の偏角 返り値は[-π, π] double argument(const pair<double, double> &a, const pair<double, double> &b){ double ax=a.first, ay=a.second, bx=b.first, by=b.second; return atan2(by-ay, bx-ax); } /* <-----------------------------------------------------------------------------------> */ /* <-----------------------------------------------------------------------------------> */ /* <-----------------------------------------------------------------------------------> */ /* <-----------------------------------------------------------------------------------> */ template <std::uint_fast64_t Modulus> class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x%Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr modint operator +(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator -(const modint rhs) const noexcept { return modint(*this) -= rhs; } constexpr modint operator *(const modint rhs) const noexcept { return modint(*this) *= rhs; } constexpr modint operator /(const modint rhs) const noexcept { return modint(*this) /= rhs; } constexpr modint & operator +=(const modint rhs) noexcept { a += rhs.a; if(a >= Modulus) a -= Modulus; return *this; } constexpr modint & operator -=(const modint rhs) noexcept { if(a < rhs.a) a += Modulus; a -= rhs.a; return *this; } constexpr modint & operator *=(const modint rhs) noexcept { a = a * rhs.a % Modulus; return *this; } constexpr modint & operator /=(modint rhs) noexcept { u64 exp = Modulus - 2; while(exp){ if(exp % 2) { *this *= rhs; } rhs *= rhs; exp /= 2; } return *this; } }; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); using mint = modint<mod>; int n, m; cin >> n >> m; vector<ll> x(n), y(m); rep(i, n) cin >> x[i]; rep(i, m) cin >> y[i]; mint X = 0, Y = 0; rep(i, n) X += (2*i+1-n) * x[i]; rep(i, m) Y += (2*i+1-m) * y[i]; cout << (X*Y) << endl; return 0; }
a.cc: In function 'int main()': a.cc:109:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'modint<1000000007>') 109 | cout << (X*Y) << endl; | ~~~~ ^~ ~~~~~ | | | | | modint<1000000007> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'modint<1000000007>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'modint<1000000007>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'modint<1000000007>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'modint<1000000007>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'modint<1000000007>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'modint<1000000007>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'modint<1000000007>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'modint<1000000007>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'modint<1000000007>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'modint<1000000007>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'modint<1000000007>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'modint<1000000007>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'modint<1000000007>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'modint<1000000007>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'modint<1000000007>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'modint<1000000007>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'modint<1000000007>' to 'std::nullptr_t' 306 |
s473963531
p03762
C++
#include <iostream> using namespace std; int main(){ int mod=10^9+7; int n,m; int xi[2]={0,0}; int yi[2]={0,0}; int xf=0,yf=0; std::cin>>n>>m; while(cin>>l){ xi[xf]=l; xf=1; } while(cin>>l){ yi[yf]=l; yf=1; } return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); }
a.cc: In function 'int main()': a.cc:10:16: error: 'l' was not declared in this scope 10 | while(cin>>l){ | ^ a.cc:14:16: error: 'l' was not declared in this scope 14 | while(cin>>l){ | ^ a.cc:18:32: error: expected primary-expression before ')' token 18 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ^ a.cc:18:89: error: expected ')' before ';' token 18 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ~ ^ | )
s786922991
p03762
C++
#include <iostream> int main(){ int mod=10^9+7; int n,m; int xi[2]={0,0}; int yi[2]={0,0}; int xf=0,yf=0; std::cin>>n>>m; while(cin>>l){ xi[xf]=l; xf=1; } while(cin>>l){ yi[yf]=l; yf=1; } return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); }
a.cc: In function 'int main()': a.cc:9:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | while(cin>>l){ | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:16: error: 'l' was not declared in this scope 9 | while(cin>>l){ | ^ a.cc:13:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 13 | while(cin>>l){ | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:13:16: error: 'l' was not declared in this scope 13 | while(cin>>l){ | ^ a.cc:17:32: error: expected primary-expression before ')' token 17 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ^ a.cc:17:89: error: expected ')' before ';' token 17 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ~ ^ | )
s971761470
p03762
C++
#include <iostream> int main(){ int mod=10^9+7; int n,m; int xi[2]={0,0}; int yi[2]={0,0}; int xf,yf=0,0; std::cin>>n>>m; while(cin>>l){ xi[xf]=l; xf=1; } while(cin>>l){ yi[yf]=l; yf=1; } return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); }
a.cc: In function 'int main()': a.cc:7:17: error: expected unqualified-id before numeric constant 7 | int xf,yf=0,0; | ^ a.cc:9:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | while(cin>>l){ | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:16: error: 'l' was not declared in this scope 9 | while(cin>>l){ | ^ a.cc:13:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 13 | while(cin>>l){ | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:13:16: error: 'l' was not declared in this scope 13 | while(cin>>l){ | ^ a.cc:17:32: error: expected primary-expression before ')' token 17 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ^ a.cc:17:89: error: expected ')' before ';' token 17 | return ((((n-1)%mod)*((m-1%)%mod)%mod)*(((yi[1]-yi[0])%mod)*((xi[1]-xi[0])%mod)%mod); | ~ ^ | )
s138271268
p03762
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; typedef double db; typedef string str; typedef pair<ll, ll> p; constexpr int MOD = 1000000007; using ll = long long; template <class T> inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } void print(const std::vector<int> &v) { std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; }); std::cout << std::endl; } ll modpow(ll a, ll p) { if(p == 0) return 1; if(p % 2 == 0) { ll halfp = p / 2; ll half = modpow(a, halfp); return half * half % MOD; } else { return a * modpow(a, p - 1) % MOD; } } int main() { ll n, m; cin >> n >> m; //したから vector<ll> x(n); REP(i, n) { cin >> x[i]; } //左から vector<ll> y(m); REP(i, m) { cin >> y[i]; } ll x_sum = 0; ll y_sum = 0; for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { ll x_sum += (x[j] - x[i]) % MOD; } } for(int k = 0; k < m; k++) { for(int l = k + 1; l < m; l++) { ll y_sum += (y[l] - y[k]) % MOD; } } area += x_sum * y_sum % MOD; cout << area % MOD << endl; return 0; }
a.cc: In function 'int main()': a.cc:58:22: error: expected initializer before '+=' token 58 | ll x_sum += (x[j] - x[i]) % MOD; | ^~ a.cc:63:22: error: expected initializer before '+=' token 63 | ll y_sum += (y[l] - y[k]) % MOD; | ^~ a.cc:66:5: error: 'area' was not declared in this scope 66 | area += x_sum * y_sum % MOD; | ^~~~
s801215588
p03762
C++
v#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < int(n); i++) #define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--) #define reps(i, n) for (int i = 1; i <= int(n); i++) #define rreps(i, n) for (int i = int(n); i >= 1; i--) #define repi(i, a, b) for (int i = int(a); i < int(b); i++) #define each(x, y) for (auto &x : y) #define all(a) (a).begin(), (a).end() #define bit(b) (1ll << (b)) #define uniq(v) (v).erase(unique(all(v)), (v).end()) #define rsort(v) sort(all(v)); reverse(all(v)) using namespace std; using i32 = int; using i64 = long long; using f80 = long double; using vi32 = vector<i32>; using vi64 = vector<i64>; using vf80 = vector<f80>; using vstr = vector<string>; inline void yes() { cout << "Yes" << '\n'; exit(0); } inline void no() { cout << "No" << '\n'; exit(0); } inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); } inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; } void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {}; template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {}; template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; } template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; } template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; } template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; } template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; } template<int mod> struct ModInt { int x; ModInt(): x(0) {} ModInt(int a) { x = a % mod; if (x < 0) x += mod; } ModInt &operator+=(ModInt that) { x = (x + that.x) % mod; return *this; } ModInt &operator-=(ModInt that) { x = (x + mod - that.x) % mod; return *this; } ModInt &operator*=(ModInt that) { x = (i64) x * that.x % mod; return *this; } ModInt &operator/=(ModInt that) { return *this *= that.inverse(); } ModInt operator-() { return ModInt(-this->x); } friend ostream& operator<<(ostream &os, ModInt m) { return os << m.x; } ModInt inverse() { int a = x, b = mod, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); } return ModInt(u); } #define op(o, p) ModInt operator o(ModInt that) { return ModInt(*this) p that; } op(+, +=) op(-, -=) op(*, *=) op(/, /=) #undef op #define op(o) bool operator o(ModInt that) const { return x o that.x; } op(==) op(!=) op(<) op(<=) op(>) op(>=) #undef op }; using mint = ModInt<1000000007>; void solve() { int n, m; cin >> n >> m; vi32 x(n), y(m); cin >> x >> y; mint ansx = 0, ansy = 0; reps(i, n - 1) { ansx += ((mint) n * i - (mint) i * i) * (x[i] - x[i - 1]); } reps(i, m - 1) { ansy += ((mint) m * i - (mint) i * i) * (y[i] - y[i - 1]); } cout << ansx * ansy << '\n'; }
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc:19:14: error: 'vector' does not name a type 19 | using vi32 = vector<i32>; | ^~~~~~ a.cc:20:14: error: 'vector' does not name a type 20 | using vi64 = vector<i64>; | ^~~~~~ a.cc:21:14: error: 'vector' does not name a type 21 | using vf80 = vector<f80>; | ^~~~~~ a.cc:22:14: error: 'vector' does not name a type 22 | using vstr = vector<string>; | ^~~~~~ a.cc: In function 'void yes()': a.cc:24:21: error: 'cout' was not declared in this scope 24 | inline void yes() { cout << "Yes" << '\n'; exit(0); } | ^~~~ a.cc:24:44: error: 'exit' was not declared in this scope 24 | inline void yes() { cout << "Yes" << '\n'; exit(0); } | ^~~~ a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' +++ |+#include <cstdlib> 1 | v#include <bits/stdc++.h> a.cc: In function 'void no()': a.cc:25:20: error: 'cout' was not declared in this scope 25 | inline void no() { cout << "No" << '\n'; exit(0); } | ^~~~ a.cc:25:42: error: 'exit' was not declared in this scope 25 | inline void no() { cout << "No" << '\n'; exit(0); } | ^~~~ a.cc:25:42: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' a.cc: In function 'i64 gcd(i64, i64)': a.cc:26:36: error: 'min' was not declared in this scope 26 | inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); } | ^~~ a.cc:26:59: error: 'max' was not declared in this scope 26 | inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); } | ^~~ a.cc: In function 'int main()': a.cc:28:28: error: 'ios' has not been declared 28 | void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } | ^~~ a.cc:28:53: error: 'cin' was not declared in this scope 28 | void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } | ^~~ a.cc:28:65: error: 'cout' was not declared in this scope 28 | void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } | ^~~~ a.cc:28:73: error: 'fixed' was not declared in this scope 28 | void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } | ^~~~~ a.cc:28:82: error: 'setprecision' was not declared in this scope 28 | void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; } | ^~~~~~~~~~~~ a.cc: At global scope: a.cc:29:57: error: expected template-name before '<' token 29 | template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {}; | ^ a.cc:29:57: error: expected '{' before '<' token a.cc:30:58: error: expected template-name before '<' token 30 | template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {}; | ^ a.cc:30:58: error: expected '{' before '<' token a.cc:34:22: error: 'istream' does not name a type 34 | template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; } | ^~~~~~~ a.cc:35:22: error: 'ostream' does not name a type 35 | template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; } | ^~~~~~~ a.cc:47:10: error: 'ostream' does not name a type 47 | friend ostream& operator<<(ostream &os, ModInt m) { return os << m.x; } | ^~~~~~~ a.cc: In member function 'ModInt<mod> ModInt<mod>::inverse()': a.cc:50:56: error: there are no arguments to 'swap' that depend on a template parameter, so a declaration of 'swap' must be available [-fpermissive] 50 | while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); } | ^~~~ a.cc:50:56: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) a.cc:50:68: error: there are no arguments to 'swap' that depend on a template parameter, so a declaration of 'swap' must be available [-fpermissive] 50 | while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); } | ^~~~ a.cc: In function 'void solve()': a.cc:64:13: error: 'cin' was not declared in this scope 64 | int n, m; cin >> n >> m; | ^~~ a.cc:65:3: error: 'vi32' was not declared in this scope; did you mean 'i32'? 65 | vi32 x(n), y(m); cin >> x >> y; | ^~~~ | i32 a.cc:65:27: error: 'x' was not declared in this scope 65 | vi32 x(n), y(m); cin >> x >> y; | ^ a.cc:65:32: error: 'y' was not declared in this scope 65 | vi32 x(n), y(m); cin >> x >> y; | ^ a.cc:73:3: error: 'cout' was not declared in this scope 73 | cout << ansx * ansy << '\n'; | ^~~~
s721449575
p03762
C++
#include<iostream> #include<cmath> #include<numeric> #include<string> #include<algorithm> #include<vector> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define int64 long long #define yokuwaruprime (10*10*10*10*10*10*10*10*10+7) using namespace std; int main(){ int n,m cin>>n>>m; int64 x[n],y[m]; rep(i,n){ cin>>x[i]; } rep(i,m){ cin>>y[i]; } int64 bigX=0,bigY=0; rep(i,n){ bigX+=(2*i-n+1)*x[i]; bigX%=yokuwaruprime; } rep(i,m){ bigY+=(2*i-m+1)*y[i]; bigY%=yokuwaruprime; } cout<<(bigX*bigY)%yokuwaruprime<<endl; }
a.cc: In function 'int main()': a.cc:15:3: error: expected initializer before 'cin' 15 | cin>>n>>m; | ^~~ a.cc:16:16: error: 'm' was not declared in this scope 16 | int64 x[n],y[m]; | ^ a.cc:21:10: error: 'y' was not declared in this scope 21 | cin>>y[i]; | ^ a.cc:29:21: error: 'y' was not declared in this scope 29 | bigY+=(2*i-m+1)*y[i]; | ^
s895313638
p03762
C++
#include<iostream> #include<cmath> #include<numeric> #include<string> #include<algorithm> #include<vector> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define int64 long long #define yokuwaruprime (10*10*10*10*10*10*10*10*10+7) using namespace std; int main(){ int n,m cin>>n>>m; int64 x[n],y[m]; rep(i,n){ cin>>x[i]; } rep(i,m){ cin>>y[i]; } int64 bigX,bigY; }
a.cc: In function 'int main()': a.cc:15:3: error: expected initializer before 'cin' 15 | cin>>n>>m; | ^~~ a.cc:16:16: error: 'm' was not declared in this scope 16 | int64 x[n],y[m]; | ^ a.cc:21:10: error: 'y' was not declared in this scope 21 | cin>>y[i]; | ^
s669282789
p03762
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); long[] x=new long[n]; long[] y=new long[m]; long mod=1000000007; for(int i = 0; i<n; i++){ x[i]= sc.nextLong(); } for(int i=0; i<m; i++){ y[i]= sc.nextLong(); } Arrays.sort(x); Arrays.sort(y); long xsum=0; long ysum=0; for(long i = 0; i<n; i++){ xsum+=((x[i]*i)%mod)-((x[i]*(n-1-i))%mod); xsum%=mod; } for(long i = 0; i<m; i++){ ysum+=((y[i]*i)%mod)-((y[i]*(m-1-i))%mod); ysum%=mod; } System.out.println((xsum*ysum)%mod); } }
Main.java:22: error: incompatible types: possible lossy conversion from long to int xsum+=((x[i]*i)%mod)-((x[i]*(n-1-i))%mod); ^ Main.java:22: error: incompatible types: possible lossy conversion from long to int xsum+=((x[i]*i)%mod)-((x[i]*(n-1-i))%mod); ^ Main.java:26: error: incompatible types: possible lossy conversion from long to int ysum+=((y[i]*i)%mod)-((y[i]*(m-1-i))%mod); ^ Main.java:26: error: incompatible types: possible lossy conversion from long to int ysum+=((y[i]*i)%mod)-((y[i]*(m-1-i))%mod); ^ 4 errors