submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s756253925
p03762
C++
3 3 1 3 4 1 3 6
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s809046097
p03762
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.util.StringTokenizer; public class D58 { public static void main(String[] args) { SC sc=new SC(System.in); int W=sc.nextInt(); for(long i=0; i<W-1; i++) { //pl((i+1)*(W-1-i)); //pl(2 * i - W + 1); } int H=sc.nextInt(); long sum=0; long MOD=1000000007; long[] X=new long[W]; long[] Y=new long[H]; for(int i=0; i<W; i++) { X[i]=sc.nextLong(); } for(int i=0; i<H; i++) { Y[i]=sc.nextLong(); } long xsum=0; long ysum=0; for(int i=0; i<W; i++) { xsum+=(2*i+1-W)*X[i]; xsum%=MOD; } for(int i=0; i<H; i++) { xsum+=(2*i+1-H)*Y[i]; xsum%=MOD; } pl((xsum*ysum)%MOD); } static class SC { private BufferedReader reader = null; private StringTokenizer tokenizer = null; public SC(InputStream in) { reader = new BufferedReader(new InputStreamReader(in)); } public String next() { if (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new UncheckedIOException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String nextLine() { try { return reader.readLine(); } catch (IOException e) { throw new UncheckedIOException(e); } } } public static void pl(Object o) { System.out.println(o); } public static void pl() { System.out.println(); } public static void p(Object o) { System.out.print(o); } }
Main.java:8: error: class D58 is public, should be declared in a file named D58.java public class D58 { ^ 1 error
s360970495
p03762
C++
//file_name:ABC58_D.cpp #include <bits/stdc++.h> #define fi first #define se second #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 srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define maxs(x,y) (x = max(x,y)) #define mins(x,y) (x = min(x,y)) #define limit(x,l,r) max(l,min(x,r)) #define lims(x,l,r) (x = max(l,min(x,r))) #define isin(x,l,r) ((l) <= (x) && (x) < (r)) #define pb push_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll #define uni(x) x.erase(unique(rng(x)),x.end()) #define snuke srand((unsigned)clock()+(unsigned)time(NULL)); #define show(x) cout<<#x<<" = "<<x<<endl; #define PQ(T) priority_queue<T,v(T),greater<T> > #define bn(x) ((1<<x)-1) #define dup(x,y) (((x)+(y)-1)/(y)) #define newline puts("") #define v(T) vector<T> #define vv(T) v(v(T)) using namespace std; typedef long long int ll; typedef unsigned uint; typedef unsigned long long ull; typedef pair<int,int> P; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<P> vp; inline int in() { int x; scanf("%d",&x); return x;} template<typename T>inline istream& operator>>(istream&i,v(T)&v) {rep(j,sz(v))i>>v[j];return i;} template<typename T>string join(const v(T)&v) {stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);} template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v) {if(sz(v))o<<join(v);return o;} template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v) {return i>>v.fi>>v.se;} template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v) {return o<<v.fi<<","<<v.se;} template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;} const double eps = 1e-10; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define dame { puts("-1"); return 0;} #define yn {puts("Yes");}else{puts("No");} const int MX = 200005; // int scan /* int x; scanf("%d",&x); int y; scanf("%d",&y); int z; scanf("%d",&z); // matrix scan /* ll a[n] = {}; rep(i,n){ scanf("%lld",&a[i]); } */ // string scan /* string s; cin >> s; */ int main() { ll mod = 1000000007; int n,m; scanf("%d%d",&n,&m); ll x[n] = {}; rep(i,n){ scanf("%lld",&x[i]); } ll y[m] = {}; rep(i,m){ scanf("%lld",&y[i]); } ll yoko = 0; ll now = x[0]; ll wa = 0; srep(i,1,n){ yoko += (x[i]-now)*i; yoko += wa; wa += (x[i]-now)*i; now = x[i]; yoko %= mod; wa %= mod; } ll ans = 0; wa = 0; now = y[0]; srep(i,1,m){ ans += (((y[i]-now)*i+wa)%=mod)*yoko; ans %= mod; wa += (y[i]-now)*i; wa %= mod; now = y[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:110:30: error: lvalue required as left operand of assignment 110 | ans += (((y[i]-now)*i+wa)%=mod)*yoko; | ~~~~~~~~~~~~~^~~~
s447401143
p03762
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n,m; cin>>n>>m; ll x=0,y=0,aj=n*(-1)+1; for(int i=0;i<n;i++){ cin>>a; x+=a*j; j+=2; } x%=1000000007; j=m*(-1)+1; for(int i=0;i<m;i++){ cin>>a; y+=a*j; j+=2; } y%=1000000007; cout<<x*y%1000000007; }
a.cc: In function 'int main()': a.cc:9:6: error: 'a' was not declared in this scope 9 | cin>>a; | ^ a.cc:10:6: error: 'j' was not declared in this scope 10 | x+=a*j; | ^ a.cc:14:1: error: 'j' was not declared in this scope; did you mean 'aj'? 14 | j=m*(-1)+1; | ^ | aj a.cc:16:6: error: 'a' was not declared in this scope 16 | cin>>a; | ^
s578398465
p03762
Java
import java.util.*; class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); long[] a = new long[n]; long[] x = new long[n]; long[] b = new long[m]; long[] y = new long[m]; long MOD = (long) (Math.pow(10, 9) + 7); a[0] = sc.nextLong(); for(int i = 1; i < n; i++){ a[i] = sc.nextLong(); x[i] = a[i] - a[i-1]; x[i] %= MOD; } b[0] = sc.nextLong(); for(int i = 1; i < m; i++){ b[i] = sc.nextLong(); y[i] = b[i] - b[i-1]; y[i] %= MOD; } long ans = 0; /* long x_sum = 0; for(int i = 1; i < n; i++){ long xx = (n - i) * ( i ); xx %= MOD; x[i] *= xx; x[i] %= MOD; x_sum += x[i]; x_sum %= MOD; } long y_sum = 0; for(int i = 1; i < m; i++){ long yy = (m - i) * ( i ); yy %= MOD; y[i] *= yy; y[i] %= MOD; y_sum += y[i]; y_sum %= MOD; }*/ long a_sum = 0; for(int i = 0; i < n; i++){ a_sum += ( i * 2 - n + 1 ) * a[i]; a_sum %= MOD; } long b_sum = 0; for(int i = 0; i < m; i++){ b_sum += i * 2 - m + 1 ) * b[i]; b_sum %= MOD; } // ans = x_sum * y_sum; ans = a_sum * b_sum; ans %= MOD; System.out.println(ans); } }
Main.java:62: error: ';' expected b_sum += i * 2 - m + 1 ) * b[i]; ^ Main.java:62: error: not a statement b_sum += i * 2 - m + 1 ) * b[i]; ^ 2 errors
s888861919
p03762
C++
#include<iostream> #include<cstdio> using namespace std; long long n,m,x[100001],y[100001]; int main() { cin>>n>>m; for(int i=1;i<=n;i++) cin>>x[i]; for(int j=1;j<=m;j++) cin>>y[i]; long long h=0,w=0; for(int l=1,r=n;l<r;++l,--r) w=(w+(x[r]-x[l])*(r-l)%mod)%mod; for(int i=1,r=m;l<r;++l,--r) h=(h+(y[r]-y[l])*(r-l)%mod)%mod; cout<<h*w%mod; return 0; }
a.cc: In function 'int main()': a.cc:9:38: error: 'i' was not declared in this scope 9 | for(int j=1;j<=m;j++) cin>>y[i]; | ^ a.cc:11:61: error: 'mod' was not declared in this scope 11 | for(int l=1,r=n;l<r;++l,--r) w=(w+(x[r]-x[l])*(r-l)%mod)%mod; | ^~~ a.cc:12:25: error: 'l' was not declared in this scope 12 | for(int i=1,r=m;l<r;++l,--r) h=(h+(y[r]-y[l])*(r-l)%mod)%mod; | ^ a.cc:12:61: error: 'mod' was not declared in this scope 12 | for(int i=1,r=m;l<r;++l,--r) h=(h+(y[r]-y[l])*(r-l)%mod)%mod; | ^~~ a.cc:13:19: error: 'mod' was not declared in this scope 13 | cout<<h*w%mod; | ^~~
s150035495
p03762
C++
#include "bits/stdc++.h" #ifndef err #define err(...)(void)0 #endif using namespace std; using ll = long long; using ull = decltype(1ull); template<class T>int size(T&&a) { return a.size(); } #define REP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.first,_l##t=a.second;t<_l##t;t++) #define RREP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.second-1,_l##t=a.first;t>=_l##t;t--) template<class B>pair<int, B>make_pair(B b) { return{ 0,b }; } #define rep(t,...)REP(t,make_pair(__VA_ARGS__)) #define rrep(t,...)RREP(t,make_pair(__VA_ARGS__)) #define all(a)begin(a),end(a) #define rall(a)a.rbegin(),a.rend() #define var(t, ...) t __VA_ARGS__;in,__VA_ARGS__; void Calc(); int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin.exceptions(istream::failbit | istream::badbit); cout << fixed << setprecision(15); Calc(); cout.flush(); return 0; } template<class A>void amax(A&a, A b) { a = max(a, b); } template<class A>void amin(A&a, A b) { a = min(a, b); } template<class A>int comp(A a, A b) { return a < b ? 1 : b < a ? -1 : 0; } struct Scanner { template<class A = string>A Next() { A a; cin >> a; return a; } template<class A = int>vector<A>Array(int n) { vector<A>a(n); for (A&i : a) cin >> i; return a; } string Line() const { string s; getline(cin, s); return s; } template<class A>Scanner&operator,(A&a) { a = Next<A>(); return *this; } template<class A>operator A() { return Next<A>(); } }in; /*---------------------------------------------------------------------*/ template<class ...T>tuple<T...>Init(T... t) { return tuple<T...>{ t... }; } template<class T>tuple<T> Init(T t) { return tuple<T>{ t }; } template<int N, int...I>struct idx_seq : idx_seq<N - 1, 0, (I + 1)...> { }; template<int...I>struct idx_seq<0, I...> { }; template<class R, class T, int...I>R InitInternal(T&&a, idx_seq<0, I...>) { return R{ get<I>(a)... }; } template<class T, class B, class...V>struct Vec { typedef Vec<T, V...>A; typedef vector<typename A::t>t; t nvec(B a, V...b) { return t(a, A().nvec(b...)); } }; template<class T, class B>struct Vec<T, B> { using X = typename conditional<is_same<T, nullptr_t>::value, int, T>::type; typedef vector<X>t; t nvec(B a) { return t(a); } }; template<class T, class ...C>struct Vec<T, tuple<C...>> { template<class A, class B>static pair<A, B> X(A, B); template<class...A>static tuple<A...> X(A...); using t = typename conditional < is_same<T, nullptr_t>::value, decltype(X(C{}...)), T > ::type; t nvec(tuple<C...> a) { return InitInternal<t>(a, idx_seq<sizeof...(C)>()); } }; template<class T, class C>struct Vec<T, tuple<C>> { using X = typename conditional<is_same<T, nullptr_t>::value, C, T>::type; using t = X; t nvec(tuple<C> a) { return { get<0>(a) }; } }; template<class T = nullptr_t, class...B> typename Vec<T, B...>::t nvec(B...b) { return Vec<T, B...>().nvec(b...); } const ll mod = (ll)1e9 + 7; template<ll MOD>struct Mint { typedef const Mint&T; ll x = 0; Mint() { } Mint(ll a) { x = a % MOD; if (x < 0) x += MOD; } Mint&operator+=(T a) { if ((x += a.x) >= MOD) x -= MOD; return *this; } Mint&operator-=(T a) { if ((x += MOD - a.x) >= MOD) x -= MOD; return *this; } Mint&operator*=(T a) { x = x * a.x % MOD; return *this; } Mint&operator/=(T a) { return *this *= a.Pow(MOD - 2); } Mint operator+(T a)const { return Mint(*this) += a; } Mint operator-(T a)const { return Mint(*this) -= a; } Mint operator*(T a)const { return Mint(*this) *= a; } Mint operator/(T a)const { return Mint(*this) /= a; } bool operator<(T a)const { return x < a.x; } bool operator==(T a)const { return x == a.x; } Mint Pow(ll k)const { if (k == 0) return 1; Mint t = Pow(k / 2); return t *= (k & 1) ? t * *this : t; } }; template<ll MOD>istream&operator >> (istream&i, Mint<MOD>&a) { return i >> a.x; } template<ll MOD>ostream&operator<<(ostream&o, const Mint<MOD>&a) { return o << a.x; } typedef Mint<mod>mint; template<ll MOD = mod>Mint<MOD> CombMod(int n, int r) { Mint<MOD> a = 1, b = 1; rep(i, r) { a *= (n - i); } repa(i, 2, r + 1) { b *= i; } err(a, b); return a / b; } void Calc() { var(int, n, m); //n = 4, m = 4; auto x = in.Array(n); auto y = in.Array(m); auto u = nvec(n - 1); auto v = nvec(m - 1); rep(i, n - 1) { if (i == 0 || i == n - 2) u[i] = n - 1; else u[i] = min(abs(0 - i), abs(n - 2 - i)) + (n - 2) * 2 - 1; } err(u); rep(i, m - 1) { if (i == 0 || i == m - 2) v[i] = m - 1; else v[i] = min(abs(0 - i), abs(m - 2 - i)) + (m - 2) * 2 - 1; } err(v); //auto c = nvec(n - 1, m - 1); //rep(i, n)rep(j, m)rep(k, i + 1, n)rep(l, j + 1, m)rep(o, i, k)rep(p, j, l) { // c[o][p]++; //} //err(c); mint ans = 0; mint xx = 0; rep(i, n - 1){ xx += mint(u[i]) * (x[i+1] - x[i]); } rep(i, m - 1){ ans += mint(v[i]) * (y[i+1] - y[i]) * xx; } cout << (ans) << endl; }
a.cc: In function 'Mint<MOD> CombMod(int, int)': a.cc:92:8: error: 'i' was not declared in this scope 92 | repa(i, 2, r + 1) { b *= i; } | ^ a.cc:92:3: error: there are no arguments to 'repa' that depend on a template parameter, so a declaration of 'repa' must be available [-fpermissive] 92 | repa(i, 2, r + 1) { b *= i; } | ^~~~ a.cc:92:3: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) a.cc:92:20: error: expected ';' before '{' token 92 | repa(i, 2, r + 1) { b *= i; } | ^~ | ;
s428387790
p03762
C++
#include <iostream> #include <string> #include <vector> #include <climits> #include <algorithm> #include <set> #include <unordered_map> #include <queue> #include <iomanip> #include <map> #define rep(i,n) for(int i=0; i<(int)(n); i++) #define ll long long #define P pair<int, int> using namespace std; int mod = 1000000007; ll n, m; int main() { cin >> n >> m; vector<ll> x(n); vector<ll> y(m); rep(i, n) { cin >> x.at(i); } rep(i, m) { cin >> y.at(i); } n--; m--; ll sumx = 0; ll sumy = 0; for(ll i=0; i<n; i++) { ll mul = ((n-i)*(i+1))%mod; sumx += (x.at(i+1)-x.at(i)*mul%mod; sumx %= mod; } for(ll i=0; i<m; i++) { ll mul = ((m-i)*(i+1))%mod; sumy += (y.at(i+1)-y.at(i))*mul%mod; sumy %= mod; } cout << (sumx*sumy)%mod << endl; }
a.cc: In function 'int main()': a.cc:38:39: error: expected ')' before ';' token 38 | sumx += (x.at(i+1)-x.at(i)*mul%mod; | ~ ^ | )
s874102274
p03762
C
#include <stdio.h> int main(void) { int n,m; scanf("%d %d",&n,&m); int x[n],y[m]; int i; for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<m;i++){ scanf("%d",&y[i]); } int s=0,t=0; for(i=0;i<n;i++){ s = s+(2*i-n+1)*x[i]; } for(i=0;i<m;i++){ t = t+(2*i-m+1)*y[i]; } s=s%1000000007; t=t%1000000007; int u; u=(s*t)%1000000007; printf("%d",u); return 0;
main.c: In function 'main': main.c:29:5: error: expected declaration or statement at end of input 29 | return 0; | ^~~~~~
s453176762
p03762
C
#include <stdio.h> int main(void) { int n,m; scanf("%d %d",&n,&m); int x[n],y[m]; int i; for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<m;i++){ scanf("%d",&y[i]); } int s=0,t=0; for(i=0;i<n;i++){ s = s+(2*i-n+1)*x[i]; } for(i=0;i<m;i++){ t = t+(2*i-m+1)*y[i]; } s=s%1000000007; t=t%1000000007; int u; u=(s*t)%1000000007; printf("%d",u); return 0;
main.c: In function 'main': main.c:29:5: error: expected declaration or statement at end of input 29 | return 0; | ^~~~~~
s831818003
p03762
C
int main(void) { int n,m; scanf("%d %d",&n,&m); int x[n],y[m]; int i; for(i=0;i<n;i++){ scanf("%d",&x[i]); } for(i=0;i<m;i++){ scanf("%d",&y[i]); } int s=0,t=0; for(i=0;i<n;i++){ s = s+(2*i-n+1)*x[i]; } for(i=0;i<m;i++){ t = t+(2*i-m+1)*y[i]; } int u; u=(s*t)%1000000007 printf("%d",u); return 0; }
main.c: In function 'main': main.c:4:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d %d",&n,&m); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d %d",&n,&m); | ^~~~~ main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:23:23: error: expected ';' before 'printf' 23 | u=(s*t)%1000000007 | ^ | ; 24 | printf("%d",u); | ~~~~~~
s526546037
p03762
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<deque> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define ll __int64 //#define ll long long #define P pair<ll,ll> const ll mod=1000000007; int n,m; ll x[111111],y[111111]; ll rx[111111],ry[111111]; ll a1,a2; int main(){ cin>>n>>m; rep(i,n)cin>>x[i]; rep(i,m)cin>>y[i]; rep(i,n)rx[i]=(i-(n-1))+i; rep(i,m)ry[i]=(i-(m-1))+i; rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod; rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod; cout<<(a1*a2)%mod<<endl; }
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:19:7: note: in expansion of macro 'll' 19 | const ll mod=1000000007; | ^~ a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:21:1: note: in expansion of macro 'll' 21 | ll x[111111],y[111111]; | ^~ a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:22:1: note: in expansion of macro 'll' 22 | ll rx[111111],ry[111111]; | ^~ a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:23:1: note: in expansion of macro 'll' 23 | ll a1,a2; | ^~ a.cc: In function 'int main()': a.cc:27:22: error: 'x' was not declared in this scope 27 | rep(i,n)cin>>x[i]; | ^ a.cc:28:22: error: 'y' was not declared in this scope 28 | rep(i,m)cin>>y[i]; | ^ a.cc:29:17: error: 'rx' was not declared in this scope 29 | rep(i,n)rx[i]=(i-(n-1))+i; | ^~ a.cc:30:17: error: 'ry' was not declared in this scope 30 | rep(i,m)ry[i]=(i-(m-1))+i; | ^~ a.cc:31:17: error: 'a1' was not declared in this scope 31 | rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod; | ^~ a.cc:31:24: error: 'mod' was not declared in this scope 31 | rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod; | ^~~ a.cc:31:29: error: 'rx' was not declared in this scope 31 | rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod; | ^~ a.cc:31:35: error: 'x' was not declared in this scope 31 | rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod; | ^ a.cc:32:17: error: 'a2' was not declared in this scope 32 | rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod; | ^~ a.cc:32:24: error: 'mod' was not declared in this scope 32 | rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod; | ^~~ a.cc:32:29: error: 'ry' was not declared in this scope 32 | rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod; | ^~ a.cc:32:35: error: 'y' was not declared in this scope 32 | rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod; | ^ a.cc:33:16: error: 'a1' was not declared in this scope 33 | cout<<(a1*a2)%mod<<endl; | ^~ a.cc:33:19: error: 'a2' was not declared in this scope 33 | cout<<(a1*a2)%mod<<endl; | ^~ a.cc:33:23: error: 'mod' was not declared in this scope 33 | cout<<(a1*a2)%mod<<endl; | ^~~
s787977231
p03762
Java
#include<bits/stdc++.h> #define rep(i,n) for(int i=0; i<n; i++) #define rrep(i,n) for(int i=n-1; i>=0; i--) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pi; typedef long double lb; const int INF=1<<27; const int MOD=(int)1e9+7; int main(void) { int n, m; ll x[100010]; ll y[100010]; cin >> n >> m; rep(i,n) cin >> x[i]; rep(i,m) cin >> y[i]; ll sum_x = 0; ll sum_y = 0; rep(i,n){ sum_x += (2*(i+1) - n - 1) * x[i]; sum_x %= MOD; } rep(i,m){ sum_y += (2*(i+1) - m - 1) * y[i]; sum_y %= MOD; } ll ans = (sum_x * sum_y) % MOD; cout << ans << endl; return 0; }
Main.java:1: error: illegal character: '#' #include<bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<bits/stdc++.h> ^ Main.java:2: error: illegal character: '#' #define rep(i,n) for(int i=0; i<n; i++) ^ Main.java:2: error: class, interface, enum, or record expected #define rep(i,n) for(int i=0; i<n; i++) ^ Main.java:2: error: class, interface, enum, or record expected #define rep(i,n) for(int i=0; i<n; i++) ^ Main.java:3: error: illegal character: '#' #define rrep(i,n) for(int i=n-1; i>=0; i--) ^ Main.java:3: error: class, interface, enum, or record expected #define rrep(i,n) for(int i=n-1; i>=0; i--) ^ Main.java:3: error: class, interface, enum, or record expected #define rrep(i,n) for(int i=n-1; i>=0; i--) ^ Main.java:7: error: class, interface, enum, or record expected typedef long long ll; ^ Main.java:8: error: class, interface, enum, or record expected typedef vector<int> vi; ^ Main.java:9: error: class, interface, enum, or record expected typedef pair<int,int> pi; ^ Main.java:10: error: class, interface, enum, or record expected typedef long double lb; ^ Main.java:12: error: class, interface, enum, or record expected const int INF=1<<27; ^ Main.java:13: error: class, interface, enum, or record expected const int MOD=(int)1e9+7; ^ Main.java:20: error: not a statement cin >> n >> m; ^ Main.java:21: error: not a statement rep(i,n) cin >> x[i]; ^ Main.java:22: error: not a statement rep(i,m) cin >> y[i]; ^ Main.java:34: error: not a statement cout << ans << endl; ^ Main.java:15: error: unnamed classes are a preview feature and are disabled by default. int main(void) ^ (use --enable-preview to enable unnamed classes) Main.java:15: error: <identifier> expected int main(void) ^ Main.java:18: error: ']' expected ll x[100010]; ^ Main.java:19: error: ']' expected ll y[100010]; ^ Main.java:21: error: ';' expected rep(i,n) cin >> x[i]; ^ Main.java:22: error: ';' expected rep(i,m) cin >> y[i]; ^ Main.java:25: error: ';' expected rep(i,n){ ^ Main.java:29: error: ';' expected rep(i,m){ ^ 26 errors
s213724829
p03762
C++
#include<iostream> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) using namespace std; typedef long long ll; const ll mod=1e9+7; ll abs(ll a){ return (a>0)?a:-1*a; } int main(){ int n,m; cin>>n>>m; ll x[n],y[m]; ll minx=0,miny=0; rep(i,n){ cin>>x[i]; minx=min(minx,x[i]); } if(minx<0)rep(i,n)x[i]+=abs(minx); rep(i,m){ cin>>y[i]; miny=min(miny,y[i]); } if(miny<0)rep(i,m)y[i]+=abs(miny); ll sumx=0,sumy=0; rep(i,n)sumx+=(i-(n-i-1))*x[i]; rep(i,m)sumy+=(i-(m-i-1))*y[i]; cout<<((sumx%mod)*(sumy%mod))%mod<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:36: error: call of overloaded 'abs(ll&)' is ambiguous 22 | if(minx<0)rep(i,n)x[i]+=abs(minx); | ~~~^~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:9:4: note: candidate: 'll abs(ll)' 9 | ll abs(ll a){ | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~ a.cc:27:36: error: call of overloaded 'abs(ll&)' is ambiguous 27 | if(miny<0)rep(i,m)y[i]+=abs(miny); | ~~~^~~~~~ /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:9:4: note: candidate: 'll abs(ll)' 9 | ll abs(ll a){ | ^~~ /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s639884990
p03762
C++
#include<iostream> #include<cmath> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) using namespace std; typedef long long ll; const ll mod=1e9+7; ll abs(ll a){ return (a>0)?a:-1*a; } int main(){ int n,m; cin>>n>>m; ll x[n],y[m]; ll minx=0,miny=0; rep(i,n){ cin>>x[i]; minx=min(minx,x[i]); } if(minx<0)rep(i,n)x[i]+=abs(minx); rep(i,m){ cin>>y[i]; miny=min(miny,y[i]); } if(miny<0)rep(i,m)y[i]+=abs(miny); ll sumx=0,sumy=0; rep(i,n)sumx+=(i-(n-i-1))*x[i]; rep(i,m)sumy+=(i-(m-i-1))*y[i]; cout<<((sumx%mod)*(sumy%mod))%mod<<endl; return 0; }
a.cc: In function 'int main()': a.cc:23:36: error: call of overloaded 'abs(ll&)' is ambiguous 23 | if(minx<0)rep(i,n)x[i]+=abs(minx); | ~~~^~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:10:4: note: candidate: 'll abs(ll)' 10 | ll abs(ll a){ | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~ a.cc:28:36: error: call of overloaded 'abs(ll&)' is ambiguous 28 | if(miny<0)rep(i,m)y[i]+=abs(miny); | ~~~^~~~~~ /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:10:4: note: candidate: 'll abs(ll)' 10 | ll abs(ll a){ | ^~~ /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s727489783
p03762
Java
import java.util.*; public class D { 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]; for(int i = 0; i < n; i++) { x[i] = sc.nextLong(); } for(int j = 0; j < m; j++) { y[j] = sc.nextLong(); } long widthSum = 0, heightSum = 0; for(int i = 0; i < n; i++) { widthSum += i * x[i] - (n - 1 - i) * x[i]; } for(int j = 0; j < m; j++) { heightSum += j * y[j] - (m - 1 - j) * y[j]; } long res = (widthSum * heightSum) % (1000000000 + 7); System.out.println(res); } }
Main.java:2: error: class D is public, should be declared in a file named D.java public class D { ^ 1 error
s826781839
p03762
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long MOD = 1000000007; long n = sc.nextLong(); long m = sc.nextLong(); long[] x = new long[n]; long[] y = new long[m]; for(int i = 0; i < n; i++) { x[i] = sc.nextLong(); } for(int i = 0; i < m; i++) { y[i] = sc.nextLong(); } long prod1 = 0; long prod2 = 0; for(int i = 1; i <= n; i++) { prod1 = (prod1 + ((2 * i - n - 1) * x[i - 1])) % MOD; } for(int i = 1; i <= m; i++) { prod2 = (prod2 + ((2 * i - m - 1) * y[i - 1])) % MOD; } System.out.println((prod1 * prod2) % MOD); } }
Main.java:9: error: incompatible types: possible lossy conversion from long to int long[] x = new long[n]; ^ Main.java:10: error: incompatible types: possible lossy conversion from long to int long[] y = new long[m]; ^ 2 errors
s997483641
p03762
C
#include <stdio.h> typedef long long ll; int main(void) { ll int n,m; scanf("%lld %lld",&n,&m); ll int i,j,xtotal=0,ytotal=0; ll int x[n],y[m]; for (i=0;i<n;i++) { scanf("%lld",&x[i]); xtotal += (i-1)*x[i] + (n-i)*x[i]); } for (i=0;i<m;i++) { scanf("%lld",&y[i]); ytotal += (i-1)*y[i] + (n-i)*y[i]); } xtotal = xtotal*ytotal; printf("%lld\n",xtotal%(1000000000+7)); }
main.c: In function 'main': main.c:7:6: error: two or more data types in declaration specifiers 7 | ll int n,m; | ^~~ main.c:9:6: error: two or more data types in declaration specifiers 9 | ll int i,j,xtotal=0,ytotal=0; | ^~~ main.c:10:6: error: two or more data types in declaration specifiers 10 | ll int x[n],y[m]; | ^~~ main.c:13:38: error: expected ';' before ')' token 13 | xtotal += (i-1)*x[i] + (n-i)*x[i]); | ^ | ; main.c:13:38: error: expected statement before ')' token main.c:17:38: error: expected ';' before ')' token 17 | ytotal += (i-1)*y[i] + (n-i)*y[i]); | ^ | ; main.c:17:38: error: expected statement before ')' token
s656599301
p03762
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) const int mod = 1e9+7; int n,m; int x[1000100],y[1000100]; int powmod(int n,int p,int m){ if(p==0)return 1; if(p%2==0){ int t=powmod(n,p/2,m); return t*t%m; } return n*powmod(n,p-1,m); } int ans; int memo[3000000000]; int memo2[3000000000]; signed main(){ cin>>n>>m; rep(i,n){ cin>>x[i]; } rep(i,m){ cin>>y[i]; } int tmp=0; int tmp2=0; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ memo[tmp++]=(x[j]-x[i])%mod; } } for(int k=0;k<m-1;k++){ for(int l=k+1;l<m;l++){ memo2[tmp2++]=(y[l]-y[k])%mod; } } for(int i=0;i<tmp;i++){ for(int j=0;j<tmp2;j++){ ans+=(memo[i]*memo2[j])%mod; } } cout<<ans%mod<<endl; }
/tmp/cc6AmtsX.o: in function `main': a.cc:(.text+0x2c4): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/cc6AmtsX.o a.cc:(.text+0x339): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/cc6AmtsX.o collect2: error: ld returned 1 exit status
s837275977
p03762
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) const int mod = 1e9+7; int n,m; int x[1000100],y[1000100]; int powmod(int n,int p,int m){ if(p==0)return 1; if(p%2==0){ int t=powmod(n,p/2,m); return t*t%m; } return n*powmod(n,p-1,m); } int ans; int memo[30000000000]; int memo2[30000000000]; signed main(){ cin>>n>>m; rep(i,n){ cin>>x[i]; } rep(i,m){ cin>>y[i]; } int tmp=0; int tmp2=0; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ memo[tmp++]=(x[j]-x[i])%mod; } } for(int k=0;k<m-1;k++){ for(int l=k+1;l<m;l++){ memo2[tmp2++]=(y[l]-y[k])%mod; } } for(int i=0;i<tmp;i++){ for(int j=0;j<tmp2;j++){ ans+=(memo[i]*memo2[j])%mod; } } cout<<ans%mod<<endl; }
/tmp/ccDhenxs.o: in function `main': a.cc:(.text+0x2c4): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/ccDhenxs.o a.cc:(.text+0x339): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/ccDhenxs.o collect2: error: ld returned 1 exit status
s986333175
p03762
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) const int mod = 1e9+7; int n,m; int x[1000100],y[1000100]; int powmod(int n,int p,int m){ if(p==0)return 1; if(p%2==0){ int t=powmod(n,p/2,m); return t*t%m; } return n*powmod(n,p-1,m); } int ans; int memo[300000000000]; int memo2[300000000000]; signed main(){ cin>>n>>m; rep(i,n){ cin>>x[i]; } rep(i,m){ cin>>y[i]; } int tmp=0; int tmp2=0; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ memo[tmp++]=(x[j]-x[i])%mod; } } for(int k=0;k<m-1;k++){ for(int l=k+1;l<m;l++){ memo2[tmp2++]=(y[l]-y[k])%mod; } } for(int i=0;i<tmp;i++){ for(int j=0;j<tmp2;j++){ ans+=(memo[i]*memo2[j])%mod; } } cout<<ans%mod<<endl; }
/tmp/ccqazpbp.o: in function `main': a.cc:(.text+0x2c4): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/ccqazpbp.o a.cc:(.text+0x339): relocation truncated to fit: R_X86_64_PC32 against symbol `memo2' defined in .bss section in /tmp/ccqazpbp.o collect2: error: ld returned 1 exit status
s593291339
p03762
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a;i<b;i++) #define REP(i,b) FOR(i,0,b) #define INF 1e9 using ll = long long; const ll mod = LLONG_MAX; int main(){ int n,m; long long x[100010],y[100010],sum; cin>>n>>m REP(i,n) { cin>>x[i]; } REP(i,m) { cin>>y[i]; } //小さな長方形の面積とその長方形の登場回数をかけた REP(i,n){ REP(k,m){ sum += (x[i+1]-x[i])*(y[k+1]-y[k])*(i+1)*(n-i+1)*(k+1)*(m-k+1); } } cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: expected ';' before 'for' 14 | cin>>n>>m | ^ | ; a.cc:16:7: error: 'i' was not declared in this scope 16 | REP(i,n) { | ^ a.cc:3:32: note: in definition of macro 'FOR' 3 | #define FOR(i,a,b) for(int i=a;i<b;i++) | ^ a.cc:16:3: note: in expansion of macro 'REP' 16 | REP(i,n) { | ^~~
s733576079
p03762
Java
import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger CONST = new BigInteger("0"); CONST = CONST.add(BigInteger.valueOf((long)Math.pow(10, 9) + 7)); int n = sc.nextInt(); int m = sc.nextInt(); List<Integer> xList = new ArrayList<>(); List<Integer> yList = new ArrayList<>(); for (int i = 0; i < n; i++) { xList.add(sc.nextInt()); } for (int i = 0; i < m; i++) { yList.add(sc.nextInt()); } BigInteger ans = new BigInteger("0"); for (int i = 0; i < n; i++) { for (int j = i+1; j < n; j++) { for (int k = 0; k < m; k++) { for (int l = k+1; l < m; l++) { long ver = getDistance(yList.get(k), yList.get(l)); long sid = getDistance(xList.get(j), xList.get(i)); ans = ans.add(BigInteger.valueOf(ver*sid)); ans = ans.remainder(CONST); } } } } System.out.println(ans); } public static long getDistance(int p1, int p2) { double distance = Math.sqrt(Math.pow(p1-p2, 2)); return (long)distance; }
Main.java:47: error: reached end of file while parsing } ^ 1 error
s520167672
p03762
C++
#include<cstdio> #include<cmath> #include<conio.h> using namespace std; #define MOD 1000000007 int n,m; long long x,y; long long dx[50005],dy[50005]; int main(){ scanf("%d%d",&n,&m); for(int i=0;i<n;i++){ scanf("%lld",&dx[i]); } for(int i=0;i<m;i++){ scanf("%lld",&dy[i]); } for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ x=(x+abs(dx[i]-dx[j]))%MOD; } } for (int i = 0; i<m; i++) { for (int j = i; j<m; j++) { y = (y + abs(dy[i] - dy[j]))%MOD; } } printf("%lld\n",(x*y)%MOD); getch(); return 0; }
a.cc:3:9: fatal error: conio.h: No such file or directory 3 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s272339890
p03762
C++
/* 2 次元平面上に x 軸と平行な直線が m 本と y 軸と平行な直線が n 本引いてあります。 x 軸と平行な直線のうち下から i 番目は y=yi で表せます。 y 軸と平行な直線のうち左から i 番目は x=xi で表せます。 この中に存在しているすべての長方形についてその面積を求め、 合計を 109+7 で割ったあまりを出力してください。 つまり、1≤i<j≤n と 1≤k<l≤m を満たすすべての組 (i,j,k,l) について、 直線 x=xi, x=xj, y=yk, y=yl で囲まれる 長方形の面積を求め、合計を 109+7 で割ったあまりを出力してください。 制約 2≤n,m≤105 −109≤x1<…<xn≤109 −109≤y1<…<ym≤109 xi,yi は整数である。 入力 入力は以下の形式で標準入力から与えられる。 n m x1 x2 … xn y1 y2 … ym 出力 長方形の面積の合計を 109+7 で割ったあまりを 1 行に出力せよ。 */ #include<stdio.h> int main() { int m,n,k; int x[105],y[105]; scanf("%d %d",&n,&m); for(k=0;k<n,k++) scanf("%d",&x[k]); for(k=0;k<m,k++) scanf("%d",&y[k]); int sum=0; int a,b,c,d; for(a=0;a<n-1;a++) for(b=a+1;b<n,b++) for(c=0;c<m-1;c++) for(d=c+1;d<m;d++) sum=(b-a)*(c-d); printf("%d",sum/1000000007); return 0; }
a.cc: In function 'int main()': a.cc:26:16: error: expected ';' before ')' token 26 | for(k=0;k<n,k++) | ^ | ; a.cc:28:16: error: expected ';' before ')' token 28 | for(k=0;k<m,k++) | ^ | ; a.cc:33:18: error: expected ';' before ')' token 33 | for(b=a+1;b<n,b++) | ^ | ;
s644255644
p03763
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; string S, T, B = "~"; bool isOK(string A1, string A2) { for (int i = 0; i < A1.size(); i++) { if (A1[i] != '?' && A1[i] != A2[i])return false; } return true; } int main() { cin >> S >> T; for (int i = 0; i <= (int)S.size() - (int)T.size(); i++) { string U = S.substr(i, T.size()); if (isOK(U, T) == true) { string V = S; for (int j = i; j < i + T.size(); j++)V[j] = T[j - i]; for (int j = 0; j < i; j++) { if (V[j] == '?')V[j] = 'a'; } for (int j = i + T.size(); j < V.size(); j++) { if (V[j] == '?')V[j] = 'a'; } B = min(B, V); } } if (B == "~")cout << "UNRESTORABLE" << endl; else cout << B << endl; return 0; } #include <iostream> #include <fstream> #include <cstdio> #include <cmath> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <algorithm> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define FOR(i,a,b) for(int i=a; i<=b; ++i) #define FORR(i,a,b) for (int i=a; i>=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef vector<VI> VVI; typedef pair<int,int> P; typedef pair<ll,ll> PL; int main() { string s, t; cin >> s >> t; int n = s.length(), m = t.length(); string ans; REP(i,n-m+1){ bool ok = true; REP(j,m){ if (s[i+j] != '?' && s[i+j] != t[j]) ok = false; } // cout << i << ok << endl; if (ok){ string tmp = s; REP(j,m) tmp[i+j] = t[j]; REP(i,n) if (tmp[i] == '?') tmp[i] = 'a'; if (ans.empty()) ans = tmp; else ans = min(ans, tmp); } } cout << (ans.empty() ? "UNRESTORABLE" : ans) << endl; return 0; }
a.cc:59:5: error: redefinition of 'int main()' 59 | int main() { | ^~~~ a.cc:12:5: note: 'int main()' previously defined here 12 | int main() { | ^~~~
s225347905
p03763
C++
#include<iostream> #include<algorithm> #include<cstring> #include<math.h> #include<queue> #include<deque> #include<map> #include<set> #include<vector> int az[26]; using namespace std; int main() { string s; int n; cin >> n; int i,j; for (j = 0; j < 26; j++) { az[j] = 100; } for (i = 0; i < n; i++) { cin >> s; for (j = 0; j < 26; j++) { az[j] = min(count(s.cbegin(), s.cend(), 'a' + j), az[j]); } } char c; for (i = 0; i < 26; i++) { for (j = 0; j < az[i]; j++) { c = 'a' + i; cout << c; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:36: error: no matching function for call to 'min(std::__iterator_traits<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, void>::difference_type, int&)' 25 | az[j] = min(count(s.cbegin(), s.cend(), 'a' + j), az[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:25:36: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 25 | az[j] = min(count(s.cbegin(), s.cend(), 'a' + j), az[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:2: /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:25:36: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 25 | az[j] = min(count(s.cbegin(), s.cend(), 'a' + j), az[j]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s168514766
p03763
C++
#include <bits/stdc++.h> using namespace::std; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; typedef array<int, 3> tri; typedef long double ld; template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;} template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;} void _main() { int n; cin >> n; vector<string> v(n); cin >> v; string s; for (char c = 'a'; c <= 'z'; c++) { int freq = 1e9; for (int i = 0; i < n; i++) { freq = min(freq, count(all(v[i]), c)); } s += string(freq, c); } cout << s; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); int _t = 1; // cin >> _t; while (_t--) _main(); return 0; }
a.cc: In function 'void _main()': a.cc:25:35: 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)' 25 | freq = min(freq, count(all(v[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:25:35: 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'}) 25 | freq = min(freq, count(all(v[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:25:35: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | freq = min(freq, count(all(v[i]), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
s884159200
p03763
C++
#include <bits/stdc++.h> using namespace::std; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() typedef long long ll; typedef array<int, 3> tri; typedef long double ld; template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;} template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;} void _main() { int n; cin >> n; vector<string> v(n); cin >> v; string s; for (char c = 'a'; c <= 'z'; c++) { int freq = 1e9; for (int i = 0; i < n; i++) { freq = min(freq, count(all(v[i]), c)); } s += string(freq, c); } cout << s; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); int _t = 1; // cin >> _t; while (_t--) _main(); return 0; }
a.cc: In function 'void _main()': a.cc:25:35: 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)' 25 | freq = min(freq, count(all(v[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:25:35: 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'}) 25 | freq = min(freq, count(all(v[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:25:35: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 25 | freq = min(freq, count(all(v[i]), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
s530391392
p03763
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-i); } return res;} int main() { ll n; cin>>n; string s[n]={}; for(ll i=0; i<n; i++){ cin>>s[i];} ll a[30]={}; ll b[30]={}; for(ll i=0; i<30; i++){ b[i]=100;} for(ll i=0; i<n; i++){ ll q=s[i].size(); while(q>=0){ ll w=s[i].at(q-1)-'a'+1; a[w]++; q--;} for(ll k=0; k<30; k++){ b[k]=min(a[k];b[k]);} } for(ll i=0; i<30; i++){ while(b[k]>0){ char h='a'+k; cout<<b; b[k]--;}}
a.cc: In function 'int main()': a.cc:36:14: error: expected ')' before ';' token 36 | b[k]=min(a[k];b[k]);} | ~ ^ | ) a.cc:36:19: error: expected ';' before ')' token 36 | b[k]=min(a[k];b[k]);} | ^ | ; a.cc:39:9: error: 'k' was not declared in this scope 39 | while(b[k]>0){ | ^ a.cc:42:10: error: expected '}' at end of input 42 | b[k]--;}} | ^ a.cc:19:12: note: to match this '{' 19 | int main() { | ^
s415303560
p03763
C++
n=int(input()) it=[input() for i in range(n)] s="abcdefghijklmnopqrstuvwxyz" ss={} j=0 for i in s: ss[i]=j j+=1 st=[0 for i in range(26)] for i in it[0]: st[ss[i]]+=1 for i in range(1,n): aa={} for j in it[i]: try: aa[j]+=1 except: aa[j]=1 k=[0]*26 for i in aa: k[ss[i]]=aa[i] for i in range(26): st[i]=min(st[i],k[i]) for i in range(26): print(s[i]*st[i],end="")
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^ a.cc:5:1: error: 'j' does not name a type 5 | j=0 | ^ a.cc:14:5: error: expected unqualified-id before 'for' 14 | for j in it[i]: | ^~~
s528698596
p03763
Java
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Scanner; import java.util.TreeMap; //@Slf4j public class test1 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); // System.out.println(first); TreeMap<Integer, TreeMap<String, Integer>> stringMapMap = new TreeMap<>(); for (int i = 0; i < n; i++) { TreeMap<String, Integer> stringMap = createStringTreeMap(); stringMapMap.put(i, stringMap); } // log.info("finish reading"); HashMap<String, List<Integer>> strListMap = new HashMap<>(); for (TreeMap<String, Integer> stringMap : stringMapMap.values()) { for (String s : stringMap.keySet()) { if (strListMap.get(s) == null) { List<Integer> strList = new ArrayList<>(); strList.add(stringMap.get(s)); strListMap.put(s, strList); } else { strListMap.get(s).add(stringMap.get(s)); } } } ; int ab = 0; strListMap.entrySet().stream().filter((entry) -> entry.getValue().size() == n) .forEach(entry -> { // System.out.println(entry.getKey() + " : " + Collections.min(entry.getValue())); int repeatNum = Collections.min(entry.getValue()); for(int i = 0; i < repeatNum ; i++) { System.out.print(entry.getKey()); } }); // stringMapMap.entrySet().stream(). } private static TreeMap<String, Integer> createStringTreeMap() { TreeMap<String, Integer> stringMap = new TreeMap<>(); Scanner sc = new Scanner(System.in); String Si = sc.next(); for (char c : Si.toLowerCase().toCharArray()) { String s = String.valueOf(c); if (stringMap.containsKey(s)) { stringMap.put(s, stringMap.get(s) + 1); } else { stringMap.put(s, 1); } } return stringMap; } }
Main.java:10: error: class test1 is public, should be declared in a file named test1.java public class test1 { ^ 1 error
s755417300
p03763
C++
#include<bits/stdc++.h> #include <iostream> #include <string> 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 vvll = vector<vll>; using vstr = vector<string>; using pll = pair<ll, ll>; int main(){ ll n; cin>>n; vstr s(n); rep(i,n) cin>>s[i]; vll ans(26); rep(i,s[0].size()){ ans[s[0][i]-'a']++; } for(int i=1;i<n;i++){ sort(all(s[i])); ll cu=1; for(int j=0;j<s[i].size();j++){ if(ans[s[i][j]-'a']==0) continue; if(j<sz(s[i])-1&&s[i][j]==s[i][j+1]){ cu++; continue; } else{ ans[s[i][j]-'a']=min(ans[s[i][j]-'a'],cu); } } } vector<char> d(0); rep(i,26){ if(ans[i]!=0){ while(ans[i]!=0){ ans[i]--; d.pb((char)('a'+i)); } } } COUT(d); }
a.cc: In function 'int main()': a.cc:16:21: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 16 | #define COUT(x) cout<<(x)<<endl | ~~~~^~~~~ | | | std::ostream {aka std::basic_ostream<char>} a.cc:65:3: note: in expansion of macro 'COUT' 65 | COUT(d); | ^~~~ 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'st
s895812969
p03763
C++
#include<bits/stdc++.h> #include <iostream> #include <string> 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 vvll = vector<vll>; using vstr = vector<string>; using pll = pair<ll, ll>; int main(){ ll n; cin>>n; vstr s(n); rep(i,n) cin>>s[i]; vll ans(26); rep(i,s[0].size()){ ans[s[0][i]-'a']++; } for(int i=1,i<n;i++){ sort(all(s[i])); ll cu=1; for(int j=0;j<s[i].size();j++){ if(ans[s[i][j]-'a']==0) continue; if(j<sz(s[i])-1&&s[i][j]==s[i][j+1]){ cu++; continue; } else{ ans[s[i][j]-'a']=min(ans[s[i][j]-'a'],cu); } } } vector<char> d(0); rep(i,26){ if(ans[i]!=0){ while(ans[i]!=0){ ans[i]--; d.pb((char)('a'+i)); } } } COUT(d); }
a.cc: In function 'int main()': a.cc:42:16: error: expected ';' before '<' token 42 | for(int i=1,i<n;i++){ | ^ | ; a.cc:42:16: error: expected primary-expression before '<' token a.cc:16:21: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 16 | #define COUT(x) cout<<(x)<<endl | ~~~~^~~~~ | | | std::ostream {aka std::basic_ostream<char>} a.cc:65:3: note: in expansion of macro 'COUT' 65 | COUT(d); | ^~~~ 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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 'std::vector<char>' 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_
s732150549
p03763
C++
#include <bits/stdc++.h> #define Maxn 100 #define rint register int using namespace std; int read() { rint s = 0, f = 1; register char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) { s = s * 10 + ch - '0'; ch = getchar(); } return s * f; } int n; char s[Maxn]; int cnt[Maxn][30], ans[Maxn << 3], tot = 0; void input() { n = read(); for (rint i = 1; i <= n; ++i) { gets(s + 1); int len = strlen(s + 1); for (rint j = 1; j <= len; ++j) ++cnt[i][s[j] - 'a']; } } namespace Solution { void solve() { for (rint i = 0; i < 26; ++i) { rint mn = 0x3f3f3f3f; for (rint j = 1; j <= n; ++j) mn = min(mn, cnt[j][i]); for (rint j = 1; j <= mn; ++j) ans[++tot] = i + 'a'; } for (rint i = 1; i <= tot; ++i) putchar(ans[i]); puts(""); } } signed main() { //freopen(".in", "r", stdin); freopen(".out", "w", stdout); input(); Solution :: solve(); return 0; }
a.cc: In function 'int read()': a.cc:7:8: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^ a.cc:7:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^ a.cc:7:36: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^~ a.cc: In function 'void input()': a.cc:19:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 19 | for (rint i = 1; i <= n; ++i) { | ^ a.cc:20:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 20 | gets(s + 1); | ^~~~ | getw a.cc:22:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 22 | for (rint j = 1; j <= len; ++j) ++cnt[i][s[j] - 'a']; | ^ a.cc: In function 'void Solution::solve()': a.cc:28:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 28 | for (rint i = 0; i < 26; ++i) { | ^ a.cc:29:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 29 | rint mn = 0x3f3f3f3f; | ^~ a.cc:30:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 30 | for (rint j = 1; j <= n; ++j) mn = min(mn, cnt[j][i]); | ^ a.cc:31:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 31 | for (rint j = 1; j <= mn; ++j) ans[++tot] = i + 'a'; | ^ a.cc:33:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 33 | for (rint i = 1; i <= tot; ++i) putchar(ans[i]); | ^
s416055952
p03763
C++
#include <bits/stdc++.h> #define Maxn 100 #define rint register int using namespace std; int read() { rint s = 0, f = 1; register char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) { s = s * 10 + ch - '0'; ch = getchar(); } return s * f; } int n; char s[Maxn]; int cnt[Maxn][30], ans[Maxn << 3], tot = 0; void input() { n = read(); for (rint i = 1; i <= n; ++i) { gets(s + 1); int len = strlen(s + 1); for (rint j = 1; j <= len; ++j) ++cnt[i][s[j] - 'a']; } } namespace Solution { void solve() { for (rint i = 0; i < 26; ++i) { rint mn = 0x3f3f3f3f; for (rint j = 1; j <= n; ++j) mn = min(mn, cnt[j][i]); for (rint j = 1; j <= mn; ++j) ans[++tot] = i + 'a'; } for (rint i = 1; i <= tot; ++i) putchar(ans[i]); puts(""); } } signed main() { //freopen(".in", "r", stdin); freopen(".out", "w", stdout); input(); Solution :: solve(); return 0; }
a.cc: In function 'int read()': a.cc:7:8: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^ a.cc:7:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^ a.cc:7:36: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | rint s = 0, f = 1; register char ch = getchar(); | ^~ a.cc: In function 'void input()': a.cc:19:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 19 | for (rint i = 1; i <= n; ++i) { | ^ a.cc:20:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 20 | gets(s + 1); | ^~~~ | getw a.cc:22:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 22 | for (rint j = 1; j <= len; ++j) ++cnt[i][s[j] - 'a']; | ^ a.cc: In function 'void Solution::solve()': a.cc:28:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 28 | for (rint i = 0; i < 26; ++i) { | ^ a.cc:29:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 29 | rint mn = 0x3f3f3f3f; | ^~ a.cc:30:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 30 | for (rint j = 1; j <= n; ++j) mn = min(mn, cnt[j][i]); | ^ a.cc:31:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 31 | for (rint j = 1; j <= mn; ++j) ans[++tot] = i + 'a'; | ^ a.cc:33:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 33 | for (rint i = 1; i <= tot; ++i) putchar(ans[i]); | ^
s415562996
p03763
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } signed main(){ int a,o=26,p=0; cin>>a; vector<string> b(a); fo(i,a) cin>>b.at(i); string e; vector<int> c(26,1000000000),d(26,0); for(int i=0;i<a;i++){ e=b.at(i); Sort(e); d(o,p); for(int j=0;j<e.size();j++){ fo(k,26){ if(e.at(j)-'a'==k){ d.at(k)++; break; } } } fo(j,26) c.at(j)=min(c.at(j),d.at(j)); } string s=""; for(char i='a';i<='z';i+=0x1){ fo(j,c.at(i-'a')) s+=i; } cout<<s<<endl; }
a.cc: In function 'int main()': a.cc:68:6: error: no match for call to '(std::vector<long long int>) (long long int&, long long int&)' 68 | d(o,p); | ~^~~~~
s648977804
p03763
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } signed main(){ int a,o=26,p=0; cin>>a; vector<string> b(a); fo(i,a) cin>>b.at(i); string e; vector<int> c(26,1000000000),d(26,0); for(int i=0;i<a;i++){ e=b.at(i); Sort(e); d(o,p); for(int j=0;j<e.size();j++){ fo(k,26){ if(e.at(j)-'a'==k){ d.at(k)++; break; } } } fo(j,26) c.at(j)=min(c.at(j),d.at(j)); } string s=""; for(char i='a';i<='z';i+=0x1){ fo(j,c.at(i-'a')) s+=i; } cout<<s<<endl;
a.cc: In function 'int main()': a.cc:68:6: error: no match for call to '(std::vector<long long int>) (long long int&, long long int&)' 68 | d(o,p); | ~^~~~~ a.cc:85:17: error: expected '}' at end of input 85 | cout<<s<<endl; | ^ a.cc:57:14: note: to match this '{' 57 | signed main(){ | ^
s095230983
p03763
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; } signed main(){ int a; cin>>a; vector<string> b(a); fo(i,a) cin>>b.at(i); string e; vector<int> c(26,1000000000),d(26,0); for(int i=0;i<a;i++){ e=b.at(i); Sort(e); d(26,0); for(int j=0;j<e.size();j++){ fo(k,26){ if(e.at(j)-'a'==k){ d.at(k)++; break; } } } fo(j,26) c.at(j)=min(c.at(j),d.at(j)); } string s=""; for(char i='a';i<='z';i+=0x1){ fo(j,c.at(i-'a')) s+=i; } cout<<s<<endl;
a.cc: In function 'int main()': a.cc:68:6: error: no match for call to '(std::vector<long long int>) (int, int)' 68 | d(26,0); | ~^~~~~~ a.cc:85:17: error: expected '}' at end of input 85 | cout<<s<<endl; | ^ a.cc:57:14: note: to match this '{' 57 | signed main(){ | ^
s605349507
p03763
C++
using namespace std; int main() { int n; cin>>n; string S[50]; for (int i(0);i<n;i++)cin>>S[i]; int ans[30]={0}; for (int i(0);i<30;i++)ans[i]=10000; for (int i(0);i<n;i++){ int list[30]={0}; for (int j(0);j<S[i].size();j++){ list[S[i][j]-'a']+=1; } for (int j(0);j<30;j++){ ans[j]=min(ans[j],list[j]); } } for (int i(0);i<30;i++){ for (int j(0);j<ans[i];j++){ cout << (char)('a'+i); } } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:6:3: error: 'string' was not declared in this scope 6 | string S[50]; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:7:30: error: 'S' was not declared in this scope 7 | for (int i(0);i<n;i++)cin>>S[i]; | ^ a.cc:12:21: error: 'S' was not declared in this scope 12 | for (int j(0);j<S[i].size();j++){ | ^ a.cc:16:14: error: 'min' was not declared in this scope; did you mean 'main'? 16 | ans[j]=min(ans[j],list[j]); | ^~~ | main a.cc:21:7: error: 'cout' was not declared in this scope 21 | cout << (char)('a'+i); | ^~~~ a.cc:21:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s717996132
p03763
C++
#include <iostream> #include <vector> #include <functional> #include <algorithm> #include <string> #include <map> #include <cmath> using namespace std; int main() { vector<int> mincnt(26, 100); int n; cin >> n; string s; for (int i = 0; i < n;i++) { cin >> s; vector<int> cnt(26, 0); for (int j = 0; j < s.length();j++) { cnt[s[j] - 'a']++; } for (int i = 0; i < 26;i++) { mincnt[i] = min(mincnt[i], cnt[i]); } } for (int i = 0; i < 26;i++) { for (int j = 0; j < mincnt[i];j++) { cout << char(ifstream + 'a'); } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:21: error: expected primary-expression before 'char' 37 | cout << char(ifstream + 'a'); | ^~~~
s011894685
p03763
C++
#include <vector> #include <string> #include <algorithm> using namespace std; int main(){ int n; cin >> n; vector<vector<char>> s; s = vector<vector<char>>(n); string temp; for(int i=0; i<n; ++i){ cin >> temp; for(int j=0; j<temp.size(); ++j){ s[i].push_back(temp[j]); } } for(int i=1; i<n; ++i){ for(int j=0; j<s[0].size(); ++j){ int moto = count(s[0].begin(), s[0].end(), s[0][j]); int saki = count(s[i].begin(), s[i].end(), s[0][j]); if(moto == saki){ }else if(saki < moto){ int era = moto - saki; char e = s[0][j]; for(int k=0; k<era; ++k){ vector<char>::iterator it = find(s[0].begin(), s[0].end(), e); s[0].erase(it); } } } } sort(s[0].begin(), s[0].end()); string out=""; for(int i=0;i<s[0].size();++i){ out += s[0][i]; } cout << out << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: 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:47:3: error: 'cout' was not declared in this scope 47 | cout << out << endl; | ^~~~ a.cc:47:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:47:18: error: 'endl' was not declared in this scope 47 | cout << out << 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 |
s200153171
p03763
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; cin >> n; vector<vector<char>> s; s = vector<vector<char>>(n); string temp; for(int i=0; i<n; ++i){ cin >> temp; for(int j=0; j<temp.size(); ++j){ s[i].push_back(temp[j]); } } for(int i=1; i<n; ++i){ for(int j=0; j<s[0].size(); ++j){ int moto = count(s[0].begin(), s[0].end(), s[0][j]); int saki = count(s[i].begin(), s[i].end(), s[0][j]); if(moto == saki){ }else if(saki < moto){ int era = moto - saki; for(int k=0; k<era; ++k){ vector<char>::iterator it = find(s[0].begin(), s[0].end(), s[0][j]); s[0].erase(it); } } } } sort(s[0].begin(), s[0].end()); string out=""; for(int i=0;i<s[0].size();++i){ out += s[0][i]; } cout << out << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:18: error: 'count' was not declared in this scope 24 | int moto = count(s[0].begin(), s[0].end(), s[0][j]); | ^~~~~ a.cc:32:43: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 32 | vector<char>::iterator it = find(s[0].begin(), s[0].end(), s[0][j]); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:32:43: note: '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' is not derived from 'std::istreambuf_iterator<_CharT>' 32 | vector<char>::iterator it = find(s[0].begin(), s[0].end(), s[0][j]); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:39:3: error: 'sort' was not declared in this scope; did you mean 'short'? 39 | sort(s[0].begin(), s[0].end()); | ^~~~ | short
s165693821
p03763
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<string> s(n); for(int i=0;i<n;i++){ cin >> s[i]; } string c; for(int i=0;i<s[0].size();i++){ c.push_back(s[0][i]); } for(int i=0;i<n;i++){ if(c.size()==0){ break; } string t=s[i] for(int j=0;j<c.size();j++){ bool judge=true; for(int k=0;k<t.size();k++){ if(c[j]==t[k]){ judge=false; t.erase(t.begin()+k); break; } } if(judge){ c.erase(c.begin()+j); } } } if(c.size()!=0){ sort(c.begin(),c.end()); for(int i=0;i<c.size();i++){ cout << c[i]; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: expected ',' or ';' before 'for' 22 | for(int j=0;j<c.size();j++){ | ^~~ a.cc:22:21: error: 'j' was not declared in this scope 22 | for(int j=0;j<c.size();j++){ | ^
s672664486
p03763
C++
#include <bits/stdc++.h> using namespace std; void hawawa() { int n; cin >> n; map<char, int> cnt; for (char c = 'a'; c <= 'z'; c++) { cnt[c] = numeric_limits<int>::max(); } while (n--) { string str; cin >> str; sort(begin(str), end(str)); for (char c = 'a'; c <= 'z'; c++) { cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c); } } for (char c = 'a'; c <= 'z'; c++) { cout << string(cnt[c], c); } cout << "\n"; } int main() { ios::sync_with_stdio(false); cin.tie(0); hawawa(); return 0; }
a.cc: In function 'void hawawa()': a.cc:18:121: error: expected ')' before ';' token 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c); | ~ ^ | )
s341378066
p03763
C++
#include <bits/stdc++.h> using namespace std; void hawawa() { int n; cin >> n; map<char, int> cnt; for (char c = 'a'; c <= 'z'; c++) { cnt[c] = numeric_limits<int>::max(); } while (n--) { string str; cin >> str; sort(begin(str), end(str)); for (char c = 'a'; c <= 'z'; c++) { cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c)); } } for (char c = 'a'; c <= 'z'; c++) { cout << string(cnt[c], c); } cout << "\n"; } int main() { ios::sync_with_stdio(false); cin.tie(0); hawawa(); return 0; }
a.cc: In function 'void hawawa()': a.cc:18:37: error: no matching function for call to 'min(std::map<char, int>::mapped_type&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)' 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), 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:18:37: 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'}) 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), 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:18:37: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s561127894
p03763
C++
#include <bits/stdc++.h> using namespace std; void hawawa() { int n; cin >> n; map<char, int> cnt; for (char c = 'a'; c <= 'z'; c++) { cnt[c] = numeric_limits<int>::max(); } while (n--) { string str; cin >> str; sort(begin(str), end(str)); for (char c = 'a'; c <= 'z'; c++) { cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c)); } } for (char c = 'a'; c <= 'z'; c++) { cout << string(cnt[c], c); } cout << "\n"; } int main() { ios::sync_with_stdio(false); cin.tie(0); hawawa(); return 0; }
a.cc: In function 'void hawawa()': a.cc:18:37: error: no matching function for call to 'min(std::map<char, int>::mapped_type&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)' 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), 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:18:37: 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'}) 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), 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:18:37: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | cnt[c] = min(cnt[c], upper_bound(begin(str), end(str), c) - lower_bound(begin(str), end(str), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s824715227
p03763
C++
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s[n]; for (int i = 0; i < n; i++) cin >> s[i]; string res = ""; for (int i = 0; i < n; i++) sort(s[i].begin(), s[i].end()); for (char c = 'a'; c <= 'z'; c++) { int m = 100; for (int i = 0; i < n; i++) { m = min(m, upper_bound(s[i].begin(), s[i].end(), c) - lower_bound(s[i].begin(), s[i].end(), c)); } for (int i = 0; i < m; i++) res += c; } cout << res << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:16:14: error: no matching function for call to 'min(int&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)' 16 | m = min(m, upper_bound(s[i].begin(), s[i].end(), c) - lower_bound(s[i].begin(), s[i].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:16:14: 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'}) 16 | m = min(m, upper_bound(s[i].begin(), s[i].end(), c) - lower_bound(s[i].begin(), s[i].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:16:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 16 | m = min(m, upper_bound(s[i].begin(), s[i].end(), c) - lower_bound(s[i].begin(), s[i].end(), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s942447433
p03763
C++
N = int(input()) S = [[] for i in range(N)] for i in range(N): S[i] += list(input()) res="" for i in range(97,97+26): c = chr(i) curr = N for j in range(N): curr = min(curr,S[j].count(c)) res += c*curr print(res)
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s077083421
p03763
C++
#include<vector> #include<iostream> #include<string> include<algorithm> using namespace std; int main() { int n; cin >> n; int count[n][26] = {{0}}; for(int i = 0; i < n; i++){ string s; cin >> s; for(int j = 0; j < s.length(); j++){ count[i][s[j]-(int)'a']++; } } for(int i = 1; i < n; ++i){ for(int j = 0; j < 26; ++j){ if(count[i][j] < count[0][j]){ count[0][j] = count[i][j]; } } } for(int i = 0; i < 26; i++){ for(int j = 0; j < count[0][i]; j++){ cout<<(char)((int)'a'+i); } } cout<<endl; return 0; }
a.cc:4:1: error: 'include' does not name a type 4 | include<algorithm> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> n; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:12:17: error: 'string' was not declared in this scope 12 | string s; | ^~~~~~ a.cc:12:17: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:13:24: error: 's' was not declared in this scope 13 | cin >> s; | ^ a.cc:27:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 27 | cout<<(char)((int)'a'+i); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:30:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 30 | 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:30:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 30 | cout<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s224987370
p03763
C++
#include<vector> #include<iostream> #include<string> include<algorithm> using namespace std; int main() { int n; cin >> n; int count[n][26] = {{0}}; for(int i = 0; i < n; i++){ string s; cin >> s; for(int j = 0; j < s.length(); j++){ count[i][s[j]-(int)'a']++; } } for(int i = 1; i < n; ++i){ for(int j = 0; j < 26; ++j){ if(count[i][j] < count[0][j]){ count[0][j] = count[i][j]; } } } for(int i = 0; i < 26; i++){ for(int j = 0; j < count[0][i]; j++){ cout<<(char)((int)'a'+i); } } cout<<endl; return 0; }
a.cc:4:1: error: 'include' does not name a type 4 | include<algorithm> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> n; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:12:17: error: 'string' was not declared in this scope 12 | string s; | ^~~~~~ a.cc:12:17: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:13:24: error: 's' was not declared in this scope 13 | cin >> s; | ^ a.cc:27:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 27 | cout<<(char)((int)'a'+i); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:30:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 30 | 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:30:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 30 | cout<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s117514856
p03763
C++
n = int(input()) Ss = [] for i in range(n): Ss.append(input()) minfreq = dict() for i in range(ord('a'), ord('z')+1): minfreq[chr(i)] = 500000 for S in Ss: freq = dict() for i in range(ord('a'), ord('z')+1): freq[chr(i)] = 0 for c in S: freq[c] += 1 for c in freq: minfreq[c] = min(minfreq[c], freq[c]) out = "" l = list(minfreq.items()) l.sort() for c,x in l: out += c*x print(out)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s320338044
p03763
C++
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); static class Str{ int[] chars = new int[26]; } public static void main(String[] args) { int n = sc.nextInt(); Str[] words = new Str[n]; for (int i = 0; i < n; i++) { String s = sc.next(); words[i] = new Str(); for (int j = 0; j < s.length(); j++) { char c = s.charAt(j); words[i].chars[c - 'a'] += 1; } } Str fin = new Str(); for (int i = 0; i < 26; i++) { int min_c = Integer.MAX_VALUE; for (int j = 0; j < n; j++) { min_c = Math.min(min_c, words[j].chars[i]); } fin.chars[i] = min_c; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < 26; i++) { for (int j = 0; j < fin.chars[i]; j++) { sb.append((char)(i + 'a')); } } System.out.println(sb.toString()); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main | ^~~~~~
s872252431
p03763
C++
#include<iostream> 2 #include<cstring> 3 #include <cmath> 4 #include <algorithm> 5 using namespace std; 6 ​ 7 int main(){ 8 int number = 0; 9 cin >> number; 10 char** input = new char*[number]; 11 ​ 12 for(int i = 0; i < number; i++){ 13 input[i] = new char[51]; 14 cin >> input[i]; 15 } 16 char same[51] = {0}; 17 int count = 0; 18 for(int i = 0; i < strlen(input[0]); i++){ 19 bool find = true; 20 for(int j = 1; j < number; j++){ 21 char* ptr = NULL; 22 ptr = strchr(input[j],input[0][i]); 23 if(ptr== NULL){ 24 find = false; 25 } 26 } 27 if(find){ 28 for(int j = 1; j < number; j++){ 29 char* ptr = NULL; 30 ptr = strchr(input[j],input[0][i]); 31 if(ptr != NULL){ 32 *ptr = '*'; 33 } 34 } 35 same[count] = input[0][i]; 36 count ++; 37 } 38 39 } 40 same[count] = '\0'; 41 sort(same,same+strlen(same)); 42 cout << same; 43 return 0; 44 }
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 2 | ^ In file included from a.cc:3: /usr/include/c++/14/cstring:78:11: error: 'memchr' has not been declared in '::' 78 | using ::memchr; | ^~~~~~ /usr/include/c++/14/cstring:79:11: error: 'memcmp' has not been declared in '::' 79 | using ::memcmp; | ^~~~~~ /usr/include/c++/14/cstring:80:11: error: 'memcpy' has not been declared in '::' 80 | using ::memcpy; | ^~~~~~ /usr/include/c++/14/cstring:81:11: error: 'memmove' has not been declared in '::' 81 | using ::memmove; | ^~~~~~~ /usr/include/c++/14/cstring:82:11: error: 'memset' has not been declared in '::' 82 | using ::memset; | ^~~~~~ /usr/include/c++/14/cstring:83:11: error: 'strcat' has not been declared in '::' 83 | using ::strcat; | ^~~~~~ /usr/include/c++/14/cstring:84:11: error: 'strcmp' has not been declared in '::' 84 | using ::strcmp; | ^~~~~~ /usr/include/c++/14/cstring:85:11: error: 'strcoll' has not been declared in '::' 85 | using ::strcoll; | ^~~~~~~ /usr/include/c++/14/cstring:86:11: error: 'strcpy' has not been declared in '::' 86 | using ::strcpy; | ^~~~~~ /usr/include/c++/14/cstring:87:11: error: 'strcspn' has not been declared in '::' 87 | using ::strcspn; | ^~~~~~~ /usr/include/c++/14/cstring:88:11: error: 'strerror' has not been declared in '::' 88 | using ::strerror; | ^~~~~~~~ /usr/include/c++/14/cstring:89:11: error: 'strlen' has not been declared in '::' 89 | using ::strlen; | ^~~~~~ /usr/include/c++/14/cstring:90:11: error: 'strncat' has not been declared in '::' 90 | using ::strncat; | ^~~~~~~ /usr/include/c++/14/cstring:91:11: error: 'strncmp' has not been declared in '::' 91 | using ::strncmp; | ^~~~~~~ /usr/include/c++/14/cstring:92:11: error: 'strncpy' has not been declared in '::' 92 | using ::strncpy; | ^~~~~~~ /usr/include/c++/14/cstring:93:11: error: 'strspn' has not been declared in '::' 93 | using ::strspn; | ^~~~~~ /usr/include/c++/14/cstring:95:11: error: 'strtok' has not been declared in '::' 95 | using ::strtok; | ^~~~~~ /usr/include/c++/14/cstring:97:11: error: 'strxfrm' has not been declared in '::' 97 | using ::strxfrm; | ^~~~~~~ /usr/include/c++/14/cstring:98:11: error: 'strchr' has not been declared in '::' 98 | using ::strchr; | ^~~~~~ /usr/include/c++/14/cstring:99:11: error: 'strpbrk' has not been declared in '::' 99 | using ::strpbrk; | ^~~~~~~ /usr/include/c++/14/cstring:100:11: error: 'strrchr' has not been declared in '::' 100 | using ::strrchr; | ^~~~~~~ /usr/include/c++/14/cstring:101:11: error: 'strstr' has not been declared in '::' 101 | using ::strstr; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before numeric constant 4 | 3 | ^ In file included from a.cc:5: /usr/include/c++/14/cmath:89:11: error: 'acos' has not been declared in '::' 89 | using ::acos; | ^~~~ /usr/include/c++/14/cmath:108:11: error: 'asin' has not been declared in '::' 108 | using ::asin; | ^~~~ /usr/include/c++/14/cmath:127:11: error: 'atan' has not been declared in '::' 127 | using ::atan; | ^~~~ /usr/include/c++/14/cmath:146:11: error: 'atan2' has not been declared in '::' 146 | using ::atan2; | ^~~~~ /usr/include/c++/14/cmath:158:11: error: 'ceil' has not been declared in '::' 158 | using ::ceil; | ^~~~ /usr/include/c++/14/cmath:177:11: error: 'cos' has not been declared in '::' 177 | using ::cos; | ^~~ /usr/include/c++/14/cmath:196:11: error: 'cosh' has not been declared in '::' 196 | using ::cosh; | ^~~~ /usr/include/c++/14/cmath:215:11: error: 'exp' has not been declared in '::' 215 | using ::exp; | ^~~ /usr/include/c++/14/cmath:234:11: error: 'fabs' has not been declared in '::' 234 | using ::fabs; | ^~~~ /usr/include/c++/14/cmath:253:11: error: 'floor' has not been declared in '::' 253 | using ::floor; | ^~~~~ /usr/include/c++/14/cmath:272:11: error: 'fmod' has not been declared in '::' 272 | using ::fmod; | ^~~~ /usr/include/c++/14/cmath:284:11: error: 'frexp' has not been declared in '::' 284 | using ::frexp; | ^~~~~ /usr/include/c++/14/cmath:303:11: error: 'ldexp' has not been declared in '::' 303 | using ::ldexp; | ^~~~~ /usr/include/c++/14/cmath:322:11: error: 'log' has not been declared in '::' 322 | using ::log; | ^~~ /usr/include/c++/14/cmath:341:11: error: 'log10' has not been declared in '::' 341 | using ::log10; | ^~~~~ /usr/include/c++/14/cmath:360:11: error: 'modf' has not been declared in '::' 360 | using ::modf; | ^~~~ /usr/include/c++/14/cmath:372:11: error: 'pow' has not been declared in '::' 372 | using ::pow; | ^~~ /usr/include/c++/14/cmath:400:11: error: 'sin' has not been declared in '::' 400 | using ::sin; | ^~~ /usr/include/c++/14/cmath:419:11: error: 'sinh' has not been declared in '::' 419 | using ::sinh; | ^~~~ /usr/include/c++/14/cmath:438:11: error: 'sqrt' has not been declared in '::' 438 | using ::sqrt; | ^~~~ /usr/include/c++/14/cmath:457:11: error: 'tan' has not been declared in '::' 457 | using ::tan; | ^~~ /usr/include/c++/14/cmath:476:11: error: 'tanh' has not been declared in '::' 476 | using ::tanh; | ^~~~ /usr/include/c++/14/cmath:1820:11: error: 'acosf' has not been declared in '::' 1820 | using ::acosf; | ^~~~~ /usr/include/c++/14/cmath:1823:11: error: 'acosl' has not been declared in '::' 1823 | using ::acosl; | ^~~~~ /usr/include/c++/14/cmath:1827:11: error: 'asinf' has not been declared in '::' 1827 | using ::asinf; | ^~~~~ /usr/include/c++/14/cmath:1830:11: error: 'asinl' has not been declared in '::' 1830 | using ::asinl; | ^~~~~ /usr/include/c++/14/cmath:1834:11: error: 'atanf' has not been declared in '::' 1834 | using ::atanf; | ^~~~~ /usr/include/c++/14/cmath:1837:11: error: 'atanl' has not been declared in '::' 1837 | using ::atanl; | ^~~~~ /usr/include/c++/14/cmath:1841:11: error: 'atan2f' has not been declared in '::' 1841 | using ::atan2f; | ^~~~~~ /usr/include/c++/14/cmath:1844:11: error: 'atan2l' has not been declared in '::' 1844 | using ::atan2l; | ^~~~~~ /usr/include/c++/14/cmath:1848:11: error: 'ceilf' has not been declared in '::' 1848 | using ::ceilf; | ^~~~~ /usr/include/c++/14/cmath:1851:11: error: 'ceill' has not been declared in '::' 1851 | using ::ceill; | ^~~~~ /usr/include/c++/14/cmath:1855:11: error: 'cosf' has not been declared in '::' 1855 | using ::cosf; | ^~~~ /usr/include/c++/14/cmath:1858:11: error: 'cosl' has not been declared in '::' 1858 | using ::cosl; | ^~~~ /usr/include/c++/14/cmath:1862:11: error: 'coshf' has not been declared in '::' 1862 | using ::coshf; | ^~~~~ /usr/include/c++/14/cmath:1865:11: error: 'coshl' has not been declared in '::' 1865 | using ::coshl; | ^~~~~ /usr/include/c++/14/cmath:1869:11: error: 'expf' has not been declared in '::' 1869 | using ::expf; | ^~~~ /usr/include/c++/14/cmath:1872:11: error: 'expl' has not been declared in '::' 1872 | using ::expl; | ^~~~ /usr/include/c++/14/cmath:1876:11: error: 'fabsf' has not been declared in '::' 1876 | using ::fabsf; | ^~~~~ /usr/include/c++/14/cmath:1879:11: error: 'fabsl' has not been declared in '::' 1879 | using ::fabsl; | ^~~~~ /usr/include/c++/14/cmath:1883:11: error: 'floorf' has not been declared in '::' 1883 | using ::floorf; | ^~~~~~ /usr/include/c++/14/cmath:1886:11: error: 'floorl' has not been declared in '::' 1886 | using ::floorl; | ^~~~~~ /usr/include/c++/14/cmath:1890:11: error: 'fmodf' has not been declared in '::' 1890 | using ::fmodf; | ^~~~~ /usr/include/c++/14/cmath:1893:11: error: 'fmodl' has not been declared in '::' 1893 | using ::fmodl; | ^~~~~ /usr/include/c++/14/cmath:1897:11: error: 'frexpf' has not been declared in '::' 1897 | using ::frexpf; | ^~~~~~ /usr/include/c++/14/cmath:1900:11: error: 'frexpl' has not been declared in '::' 1900 | using ::frexpl; | ^~~~~~ /usr/include/c++/14/cmath:1904:11: error: 'ldexpf' has not been declared in '::' 1904 | using ::ldexpf; | ^~~~~~ /usr/include/c++/14/cmath:1907:11: error: 'ldexpl' has not been declared in '::' 1907 | using ::ldexpl; | ^~~~~~ /usr/include/c++/14/cmath:1911:11: error: 'logf' has not been declared in '::' 1911 | using ::logf; | ^~~~ /usr/include/c++/14/cmath:1914:11: error: 'logl' has not been declared in '::' 1914 | using ::logl; | ^~~~ /usr/include/c++/14/cmath:1918:11: error: 'log10f' has not been declared in '::' 1918 | using ::log10f; | ^~~~~~ /usr/include/c++/14/cmath:1921:11: error: 'log10l' has not been declared in '::' 1921 | using ::log10l; | ^~~~~~ /usr/include/c++/14/cmath:1925:11: error: 'modff' has not been declared in '::' 1925 | using ::modff; | ^~~~~ /usr/include/c++/14/cmath:1928:11: error: 'modfl' has not been declared in '::' 1928 | using ::modfl; | ^~~~~ /usr/include/c++/14/cmath:1932:11: error: 'powf' has not been declared in '::' 1932 | using ::powf; | ^~~~ /usr/include/c++/14/cmath:1935:11: error: 'powl' has not bee
s404977217
p03763
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; string str; int ans[26]; int main() { memset(ans, 1, sizeof(ans)); int n; cin >> n; for (int i = 0; i < n; i++) { cin >> str; int cnt[26] = { 0, }; for (int j = 0; j < str.size(); j++) { cnt[str[j] - 'a']++; } for (int j = 0; j < 26; j++)ans[j] = min(ans[j], cnt[j]); } string t; for (int i = 0; i < 26; i++) { while (ans[i]) { --ans[i]; t = t + (char)('a' + i); } } cout << t; }
a.cc: In function 'int main()': a.cc:9:9: error: 'memset' was not declared in this scope 9 | memset(ans, 1, sizeof(ans)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 | using namespace std;
s668870846
p03763
C++
ji
a.cc:1:1: error: 'ji' does not name a type 1 | ji | ^~
s541012093
p03763
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #define MAXN 60 #define MAXS 3600 int n; char* strings[MAXN]; int min(const int a, const int b) { return a > b ? a : b; } void read_str(int idx) { char buf[MAXN]; fgets(buf, MAXN, stdin): int len = strlen(buf); if(buf[len - 1] == '\n') buf[--len] = '\0'; strings[idx] = strdup(buf); } int solve(char* res) { int t = 0; int cnt[26]; for(int i = 0; i < 26; i++) cnt[i] = 1e9; for(int i = 0; i < n; i++) { int currcnt[26] = {0}; int len = strlen(strings[i]); for(int j = 0; j < len; j++) currcnt[strings[i][j] - 'a']++; for(int j = 0; j < 26; j++) cnt[i] = min(cnt[i], currcnt[i]); } for(int i = 0; i < 26; i++) for(int j = 0; j < cnt[i]; j++) cnt[t++] = i + 'a'; cnt[t] = '\0'; return t; } int main(void) { scanf("%d\n", &n); char res[MAXS]; for(int i = 0; i < n; i++) read_str(i); solve(res); puts(res); return 0; }
main.c: In function 'read_str': main.c:14:28: error: expected ';' before ':' token 14 | fgets(buf, MAXN, stdin): | ^ | ; main.c:16:12: error: 'len' undeclared (first use in this function) 16 | if(buf[len - 1] == '\n') buf[--len] = '\0'; | ^~~ main.c:16:12: note: each undeclared identifier is reported only once for each function it appears in
s686737607
p03763
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int max_num; vector < vector < int > > arr (26); cin >> max_num; for(int j=0;j<max_num;j++){ string po; cin >> po; vector<int> l(0,26); for(int i=0;i<26;i++) arr[i].push_back(0);//要素を追加 for(int i=0;i<po.length();i++){ int cn = (int)po[i]-97; arr[cn][j]++; } } for(int i=0;i<26;i++){ int min = *min_element(arr[i].begin(), arr[i].end()); for(int j=0;j < min;j++){ cout << (char)(i+97); } } cout <<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:22:20: error: 'min_element' was not declared in this scope 22 | int min = *min_element(arr[i].begin(), arr[i].end()); | ^~~~~~~~~~~
s685428983
p03763
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int max_num; vector < vector < int > > arr (26); cin >> max_num; for(int j=0;j<max_num;j++){ string po; cin >> po; vector<int> l(0,26); for(int i=0;i<26;i++) arr[i].push_back(0);//要素を追加 for(int i=0;i<po.length();i++){ int cn = (int)po[i]-97; arr[cn][j]++; } } for(int i=0;i<26;i++){ int min = *std::min_element(arr[i].begin(), arr[i].end()); for(int j=0;j < min;j++){ cout << (char)(i+97); } } cout <<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:22:25: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 22 | int min = *std::min_element(arr[i].begin(), arr[i].end()); | ^~~~~~~~~~~ | tuple_element
s884636636
p03763
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int max_num; vector < vector < int > > arr (26); cin >> max_num; for(int j=0;j<max_num;j++){ string po; cin >> po; vector<int> l(0,26); for(int i=0;i<26;i++) arr[i].push_back(0);//要素を追加 for(int i=0;i<po.length();i++){ int cn = (int)po[i]-97; arr[cn][j]++; } } for(int i=0;i<26;i++){ for(int j=0;j<*min_element(arr[i].begin(), arr[i].end());j++){ cout << (char)(i+97); } } cout <<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:22:24: error: 'min_element' was not declared in this scope 22 | for(int j=0;j<*min_element(arr[i].begin(), arr[i].end());j++){ | ^~~~~~~~~~~
s307332670
p03763
C++
$n = <>; $first = 1; for (1..$n) { $_ = <>; my %hash; chomp; @a = split(''); for (@a) { $hash{$_}++; } if ($first) { %glbl = %hash; } else { for (keys %glbl) { if ($glbl{$_} > $hash{$_}) { $glbl{$_} = $hash{$_}; } } } $first = 0; } for (sort(keys %glbl)) { print $_ x $glbl{$_}; } print "\n";
a.cc:4:6: error: too many decimal points in number 4 | for (1..$n) { | ^~~~~ a.cc:8:5: error: stray '@' in program 8 | @a = split(''); | ^ a.cc:8:16: error: empty character constant 8 | @a = split(''); | ^~ a.cc:9:10: error: stray '@' in program 9 | for (@a) { | ^ a.cc:1:1: error: '$n' does not name a type 1 | $n = <>; | ^~ a.cc:2:1: error: '$first' does not name a type 2 | $first = 1; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for (1..$n) { | ^~~ a.cc:23:1: error: expected unqualified-id before 'for' 23 | for (sort(keys %glbl)) { | ^~~ a.cc:26:1: error: 'print' does not name a type; did you mean 'int'? 26 | print "\n"; | ^~~~~ | int
s734816120
p03763
C++
#include <iostream> #include <vector> #include <map> using namespace std; #define INF 1e7 int main(void){ int n; string s; cin >> n; string ret; map<char, int> buf; for(char c='a'; c<='z'; c++){ buf[c] = INF; } for(int i=0; i<n; i++){ cin >> s; for(char c='a'; c<='z'; c++){ buf[c] = min(buf[c], int(count(s.begin(), s.end(), c))); } } for(char c='a'; c<='z'; c++){ for(int i=0; i<buf[c]; i++){ ret += c; } } cout << ret << endl; }
a.cc: In function 'int main()': a.cc:18:38: error: 'count' was not declared in this scope 18 | buf[c] = min(buf[c], int(count(s.begin(), s.end(), c))); | ^~~~~
s412883792
p03763
Java
import java.util.ArrayList; 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(); int an[][]=new int[n][26]; int bn[][]=new int[n][26]; int min=50; int ans[] =new int[26]; int a ='a'; List<String> list = new ArrayList<String>(); for(int i=0;i<n;i++){ list.add(scan.next()); } for(int i=0;i<n;i++){ an=ch(list.get(i),i,n); for(int f=0;f<26;f++){ bn[i][f]=an[i][f]; } } for(int f=0;f<26;f++){ min=50; for(int i=0;i<n;i++){ if(min>bn[i][f]){ min=bn[i][f]; } } ans[f]=min; } for(int i=0;i<26;i++){ a='a'; a=a+i; for(int f=0;f<ans[i];f++){ System.out.print((char)a); } } } 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; } public static int[][] ch(String st,int b,int n){ int [][] c=new int[n][26]; for(int f=0;f<26;f++){ int count=0; int a='a'; a=a+f; for(int i=0;i<st.length();i++){ if((char)a==st.charAt(i)){ count++; } } c[b][f]=count; } return c; } }
Main.java:4: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s056724335
p03763
C++
#include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define F first #define S second #define fo(i, n) for(int i = 1; i <= n; ++i) #define rep(i, a, b) for(int (i) = (a); (i) < (b); ++(i)) typedef long long ll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; const int N = 200200; const int mod = 1e9 + 7; const ll INF = 1e18; int cnt[51][26]; string s; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; fo(i, n) { cin >> s; cnt[i][s - 'a']++; } string res; for(int i = 0; i < 26; ++i) { int mx = 51; fo(j, n) mx = min(mx, cnt[j][i]); fo(j, mx) res += char(i + 'a'); } cout << res; return 0; }
a.cc: In function 'int main()': a.cc:32:26: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 32 | cnt[i][s - 'a']++; | ~ ^ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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_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:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 32 | cnt[i][s - '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:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 32 | cnt[i][s - 'a']++; | ^~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)' 370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)' 379 | operator-(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: a.cc:32:28: note: mismatched types 'const std::complex<_Tp>' and 'char' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:32:28: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:32:28: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:32:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 32 | cnt[i][s - 'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:32:28: note: mismatched types 'const std::valarray<_Tp>' and 'char' 32 | cnt[i][s - 'a']++; | ^~~
s149805440
p03763
C++
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from random import * def readln(): _res = list(map(int,str(input()).split(' '))) return _res n = readln()[0] a = {} char = 'abcdefghijklmnopqrstuvwxyz' for i in char: a.update({i:1000000}) for i in range(0,n): s = input() b = {} for ch in char: b.update({ch:0}) for ch in s: b[ch] = b[ch] + 1 for ch in char: a[ch] = min(a[ch],b[ch]) ans = '' for ch in char: for i in range(0,a[ch]): ans = ans + ch print(ans)
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python3 | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding: utf-8 -*- | ^ a.cc:12:8: warning: multi-character literal with 26 characters exceeds 'int' size of 4 bytes 12 | char = 'abcdefghijklmnopqrstuvwxyz' | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:25:7: error: empty character constant 25 | ans = '' | ^~ a.cc:4:1: error: 'from' does not name a type 4 | from random import * | ^~~~ a.cc:12:6: error: expected unqualified-id before '=' token 12 | char = 'abcdefghijklmnopqrstuvwxyz' | ^ a.cc:14:25: error: expected unqualified-id before ')' token 14 | a.update({i:1000000}) | ^ a.cc:19:5: error: expected unqualified-id before 'for' 19 | for ch in char: | ^~~ a.cc:20:24: error: expected unqualified-id before ')' token 20 | b.update({ch:0}) | ^
s668775812
p03763
C++
easfaqw
a.cc:1:1: error: 'easfaqw' does not name a type 1 | easfaqw | ^~~~~~~
s684424626
p03763
C++
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long ll; typedef vector<int> vi; #define rep(i,j) for(int i=0;i<(j);i++) #define reps(i,j,k) for(int i=j;i<k;i++) #define in(i,j,k) ((i)>=(j)&&(i)<=(k)) #define INF (1<<28) #define pb push_back #define fs first #define sc second const char dx[]={0,1,0,-1},dy[]={1,0,-1,0}; template<class T> ostream &operator<<(ostream &out, const vector<T> &v){ out << "{"; rep(i,v.size()) out << v[i] << ", " ; return out << "}" << endl; } template<class S,class T> ostream &operator<<(ostream &out, const pair<S,T> p){ return out << "(" << p.fs << ", " << p.sc << ")"; } int main(){ int n; cin >> n; string s; vi v(26,50); rep(i,n){ cin >> s; vi vv(26); rep(j,s.length()){ vv[s-'a']++; } rep(j,26) v[i] = min(v[i],vv[i]); } rep(i,26){ char c = 'a' + i; rep(j,v[i]) cout << c; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:29: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 36 | vv[s-'a']++; | ~^~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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_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:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 36 | vv[s-'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:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 36 | vv[s-'a']++; | ^~~ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)' 370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)' 379 | operator-(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)' 388 | operator-(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed: a.cc:36:30: note: mismatched types 'const std::complex<_Tp>' and 'char' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)' 465 | operator-(const complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:36:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed: a.cc:36:30: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'char' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:36:30: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 36 | vv[s-'a']++; | ^~~ /usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1197 | _DEFINE_BINARY_OPERATOR(-, __minus) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed: a.cc:36:30: note: mismatched types 'const std::valarray<_Tp>' and 'char' 36 | vv[s-'a']++; | ^~~
s010052792
p03763
Java
3 a aa b
Main.java:1: error: class, interface, enum, or record expected 3 ^ 1 error
s323068856
p03763
C++
3 3 1 3 4 1 3 6
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 3 | ^
s613047168
p03763
C++
#include <iostream> #include <cstring> #include <set> using namespace std; int main() { int am[26], n; string s; memset(am, 63, sizeof am); cin >> n; while (n--) { cin >> s; for (int c = 0; c < 26; ++c) am[c] = min(am[c] + 0u, multiset<char>(s.begin(), s.end()).count(c + 'a')); } for (int c = 0; c < 26; ++c) cout << string(am[c], c + 'a'); return 0; }
a.cc: In function 'int main()': a.cc:17:24: error: no matching function for call to 'min(unsigned int, std::multiset<char>::size_type)' 17 | am[c] = min(am[c] + 0u, multiset<char>(s.begin(), s.end()).count(c + 'a')); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:24: note: deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::multiset<char>::size_type' {aka 'long unsigned int'}) 17 | am[c] = min(am[c] + 0u, multiset<char>(s.begin(), s.end()).count(c + '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
s953004729
p03763
Java
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); String[] S = new String[n]; char c; int[][] count = new int[n][26]; S[0]=scan.nextLine(); for(int i =0;i<n;i++){ S[i]=scan.nextLine(); } for(int i =0;i<n;i++){ for(int j =0;j<S[i].length();j++){ c = S[i].charAt(j); count[i][c-'a']++; } } int[] min = new int[26]; for(int i =0;i<26;i++){ min[i]=50; for(int j =0;j<n;j++){ if(count[j][i] < min[i]){ min[i]=count[j][i]; } } } c = 'a'; for(int i=0;i<26;i++){ for(int j=0;j<min[i];j++){ System.out.print(c); } c++; } System.out.println(""); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s756626005
p03763
C++
// A.cpp : Defines the entry point for the console application. // #include <iostream> #include <string> #include <stdlib.h> using namespace std; int main() { int n; cin >> n; char s[50][60]; int alpha[50][26]; for (int i = 0; i < 50; i++) { for (int j = 0; j < 60; j++) { s[i][j] = 0; } } for (int i = 0; i < 50; i++) { for (int j = 0; j < 26; j++) { alpha[i][j] = 0; } } for (int i = 0; i < n; i++) { cin >> s[i]; } for (int i = 0; i < n; i++) { for (int j = 0; j < strlen(s[i]); j++) { alpha[i][s[i][j] - 97] += 1; } } int smallest[26]; for (int i = 0; i < 26; i++) { smallest[i] = alpha[0][i]; } for (int i = 1; i < n; i++) { for (int j = 0; j < 26; j++) { if (smallest[j] > alpha[i][j]) smallest[j] = alpha[i][j]; } } char c; for (int i = 0; i < 26; i++) { for (int j = 0; j < smallest[i]; j++) { c = i + 97; cout << c; } } cout << endl; //cin >> n; return 0; }
a.cc: In function 'int main()': a.cc:29:37: error: 'strlen' was not declared in this scope 29 | for (int j = 0; j < strlen(s[i]); j++) { | ^~~~~~ a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <stdlib.h> +++ |+#include <cstring> 7 | using namespace std;
s682840279
p03763
C++
#include <iostream> #include <algorithm> using namespace std; const int N = 51; int n; string s[N]; bool next[N][26][26]; int Nx[26][26]; int f[N][N], trace[N][N]; int mx; int main() { ios_base :: sync_with_stdio(false); cin.tie(0); mx = 1; cin >> n; for (int i = 1; i <= n; i++) { cin >> s[i]; sort(s[i].begin(), s[i].end()); } for (int i = 1; i <= n; i++) { for (int j = 0; j < s[i].size(); j++) f[i][j] = 1; for (int ii = 0; ii < s[i].size(); ii++) for (int jj = ii + 1; jj < s[i].size(); jj++) next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true; for (int ii = 0; ii < 26; ii++) for (int jj = 0; jj < 26; jj++) Nx[ii][jj] += (int)next[i][ii][jj]; } for (int i = 0; i < N; i++) trace[1][i] = -1; for (int k = 1; k <= 1; k++) { for (int i = 0; i < s[k].size(); i++) for (int j = i + 1; j < s[k].size(); j++) { if (Nx[s[k][i] - 'a'][s[k][j] - 'a'] == n) { if (f[k][j] < f[k][i] + 1) { f[k][j] = f[k][i] + 1; trace[k][j] = i; mx = max(mx, f[k][j]); } } } } string res = ""; for (int i = 0; i < s[1].size(); i++) if (f[1][i] == mx) { for (int chot = i; chot != -1; chot = trace[1][chot]) { res = s[1][chot] + res; } break; } cout << mx << "\n"; cout << res; return 0; }
a.cc: In function 'int main()': a.cc:23:17: error: reference to 'next' is ambiguous 23 | next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true; | ^~~~ In file included from /usr/include/c++/14/string:47, 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_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:7:6: note: 'bool next [51][26][26]' 7 | bool next[N][26][26]; | ^~~~ a.cc:26:36: error: reference to 'next' is ambiguous 26 | Nx[ii][jj] += (int)next[i][ii][jj]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:7:6: note: 'bool next [51][26][26]' 7 | bool next[N][26][26]; | ^~~~
s547010840
p03763
C++
#include <iostream> #include <algorithm> using namespace std; const int N = 51; int n; string s[N]; bool next[N][26][26]; int Nx[26][26]; int f[N][N], trace[N][N]; int mx; int main() { ios_base :: sync_with_stdio(false); cin.tie(0); mx = 1; cin >> n; for (int i = 1; i <= n; i++) { cin >> s[i]; sort(s[i].begin(), s[i].end()); } for (int i = 1; i <= n; i++) { for (int j = 0; j < s[i].size(); j++) f[i][j] = 1; for (int ii = 0; ii < s[i].size(); ii++) for (int jj = ii + 1; jj < s[i].size(); jj++) next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true; for (int ii = 0; ii < 26; ii++) for (int jj = 0; jj < 26; jj++) Nx[ii][jj] += (int)next[i][ii][jj]; } for (int i = 0; i < N; i++) trace[1][i] = -1; for (int k = 1; k <= 1; k++) { for (int i = 0; i < s[k].size(); i++) for (int j = i + 1; j < s[k].size(); j++) { if (Nx[s[k][i] - 'a'][s[k][j] - 'a'] == n) { if (f[k][j] < f[k][i] + 1) { f[k][j] = f[k][i] + 1; trace[k][j] = i; mx = max(mx, f[k][j]); } } } } string res = ""; for (int i = 0; i < s[1].size(); i++) if (f[1][i] == mx) { for (int chot = i; chot != -1; chot = trace[1][chot]) { res = s[1][chot] + res; } break; } cout << mx << "\n"; cout << res; return 0; }
a.cc: In function 'int main()': a.cc:23:17: error: reference to 'next' is ambiguous 23 | next[i][s[i][ii] - 'a'][s[i][jj] - 'a'] = true; | ^~~~ In file included from /usr/include/c++/14/string:47, 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_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:7:6: note: 'bool next [51][26][26]' 7 | bool next[N][26][26]; | ^~~~ a.cc:26:36: error: reference to 'next' is ambiguous 26 | Nx[ii][jj] += (int)next[i][ii][jj]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:7:6: note: 'bool next [51][26][26]' 7 | bool next[N][26][26]; | ^~~~
s591602941
p03763
C++
#include <stdio.h> int main() { int a[50][50] = {}; int N = 0; char str[100]; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%s", str); for (int j = 0, jlim = strlen(str); j < jlim; j++) { a[i][str[j] - 'a']++; } } for (char c = 'a'; c <= 'z'; c++) { int max = 999; for (int i = 0; i < N; i++) { if (max > a[i][c - 'a']) max = a[i][c - 'a']; } for (int i = 0; i < max; i++) { printf("%c", c); } } printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:12:28: error: 'strlen' was not declared in this scope 12 | for (int j = 0, jlim = strlen(str); j < jlim; j++) { | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 |
s160576724
p03763
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <numeric> using namespace std; int main(void) { int paperNum; cin >> paperNum; int maxCharNum = 50; vector<int> minChars('z' - 'a', maxCharNum); for (int _numOfPaper = 0; _numOfPaper < paperNum; _numOfPaper++) { vector<int> chars('z' - 'a', 0); string paper; cin >> paper; for each (auto chr in paper) chars[chr - 'a']++; for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) minChars[numOfAlphabet] = min(chars[numOfAlphabet], minChars[numOfAlphabet]); } for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) { for (int count = 0; count < minChars[numOfAlphabet]; count++) cout << (char)(numOfAlphabet + 'a'); } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: expected '(' before 'each' 18 | for each (auto chr in paper) chars[chr - 'a']++; | ^~~~ | ( a.cc:18:27: error: expected primary-expression before 'auto' 18 | for each (auto chr in paper) chars[chr - 'a']++; | ^~~~ a.cc:18:21: error: 'each' was not declared in this scope 18 | for each (auto chr in paper) chars[chr - 'a']++; | ^~~~ a.cc:19:17: error: expected primary-expression before 'for' 19 | for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) | ^~~ a.cc:18:65: error: expected ';' before 'for' 18 | for each (auto chr in paper) chars[chr - 'a']++; | ^ | ; 19 | for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) | ~~~ a.cc:19:17: error: expected primary-expression before 'for' 19 | for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) | ^~~ a.cc:18:65: error: expected ')' before 'for' 18 | for each (auto chr in paper) chars[chr - 'a']++; | ~~~~ ^ | ) 19 | for (int numOfAlphabet = 0; numOfAlphabet < minChars.size(); numOfAlphabet++) | ~~~
s194019086
p03763
C++
#include <iostream> #include <string> #include <vector> #include <utility> #include <map> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<int> counts(26, -1); for (int i = 0; i < n; ++i) { string s; cin >> s; vector<int> cnt(26, 0); for (auto c: s) ++cnt[c - 'a']; for (int j = 0; j < counts.size(); ++j) { if (counts[j] < 0 or counts[j] > cnt[j]) counts[j] = cnt[j]; } } for (int i = 0; i < counts.size(); ++i) { for (int j = 0; j < counts[i]; ++j) cout << static_cast<char>('a' + i); } cout << endl; return 0; }
a.cc:2:81: warning: extra tokens at end of #include directive 2 | #include <string> #include <vector> | ^ a.cc: In function 'int main()': a.cc:13:3: error: 'vector' was not declared in this scope 13 | vector<int> counts(26, -1); | ^~~~~~ a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 5 | #include <algorithm> +++ |+#include <vector> 6 | a.cc:13:10: error: expected primary-expression before 'int' 13 | vector<int> counts(26, -1); | ^~~ a.cc:18:12: error: expected primary-expression before 'int' 18 | vector<int> cnt(26, 0); | ^~~ a.cc:19:23: error: 'cnt' was not declared in this scope; did you mean 'int'? 19 | for (auto c: s) ++cnt[c - 'a']; | ^~~ | int a.cc:20:25: error: 'counts' was not declared in this scope; did you mean 'const'? 20 | for (int j = 0; j < counts.size(); ++j) { | ^~~~~~ | const a.cc:21:40: error: 'cnt' was not declared in this scope; did you mean 'int'? 21 | if (counts[j] < 0 or counts[j] > cnt[j]) counts[j] = cnt[j]; | ^~~ | int a.cc:25:23: error: 'counts' was not declared in this scope; did you mean 'const'? 25 | for (int i = 0; i < counts.size(); ++i) { | ^~~~~~ | const
s494649366
p03763
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<string> S(n); for (auto &S_i : S) cin >> S_i; string ans = ""; for (char c = 'a'; c <= 'z'; ++c) { int num = 99999; for (const auto &s : S) { num = min(num, count(s.begin(), s.end(), c)); } ans.insert(ans.end(), num, c); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:19:34: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, void>::difference_type)' 19 | num = min(num, count(s.begin(), s.end(), 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: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:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'}) 19 | num = min(num, count(s.begin(), s.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, 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:19:34: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 19 | num = min(num, count(s.begin(), s.end(), c)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s186533736
p03763
C++
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<sstream> #include<cstdio> #include<cstdlib> #include<cstring> #include<climits> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<queue> #include<numeric> #include<functional> #include<algorithm> #include<bitset> #include<tuple> #include<unordered_set> #include<random> #include<array> #include<cassert> using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) int main() { ios::sync_with_stdio(0); cin.tie(0); int cnt[26]; rep(i, 26)cnt[i]=INF; int n; cin>>n; rep(i,n){ string s; cin>>s; rep(j, 26)cnt[j] = min(cnt[j], count(all(s),(char)('a'+j))); } rep(i, 26)cout << string(cnt[i],(char)('a'+i)); cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:43:39: 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)' 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | count(all(s),(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: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:43:39: 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'}) 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | count(all(s),(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:16: /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:43:39: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | count(all(s),(char)('a'+j))); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s793687957
p03763
C++
//Jai Shree Krishna #include <vector> #include <list> #include <map> #include <set> #include "queue" #include <deque> #include <stack> #include <numeric> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <complex> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <cstring> #include <climits> #include <cassert> #include <iostream> #include "fstream" using namespace std; #define PI acos(-1) #define MOD (ll)1000000007 #define pii pair<long long ,long long > #define ll long long int #define loop(i,n) for(ll i=0;i<n;i++) #define loop2(i,n) for(ll i = 1;i<=n;i+=1) #define pb push_back #define mp make_pair #define EPS 1e-8 void display(vector<int> v1){loop(i,v1.size()){cout<<v1[i]<<" ";}cout<<endl;} ll dx[8] = {0,1,0,-1,1,1,-1,-1}; ll dy[8] = {1,0,-1,0,1,-1,1,-1}; //Never giving in, fighting to the end int main() { ios_base::sync_with_stdio(false); cin.tie(0); //freopen("/Users/ashish/Desktop/B-large-practice.in.txt", "r", stdin); //freopen("/Users/ashish/Desktop/A-large-practice.out.txt", "w", stdout); ll n; vector<string>v1; cin>>n; loop(i,n) { string s1; cin>>s1; v1.push_back(s1); } loop(i,26) { ll mex = (ll)1e18; loop(j,v1.size()) { ll cnt = 0 ; loop(k,v1[j].size()) { if(v1[j][k]==(char)(i+'a')) { cnt+=1; } } mex = min(mex,cnt); } if(mex==(ll)1e18){ continue; } loop(j,mex) { cout<<(char)(i+'a')l; } } return 0; }
a.cc: In function 'int main()': a.cc:82:32: error: expected ';' before 'l' 82 | cout<<(char)(i+'a')l; | ^ | ;
s864212557
p03763
C++
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<sstream> #include<cstdio> #include<cstdlib> #include<cstring> #include<climits> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<queue> #include<numeric> #include<functional> #include<algorithm> #include<bitset> #include<tuple> #include<unordered_set> #include<random> #include<array> #include<cassert> using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) int main() { ios::sync_with_stdio(0); cin.tie(0); int cnt[26]; rep(i, 26)cnt[i]=INF; int n; cin>>n; rep(i,n){ string s; cin>>s; rep(j, 26)cnt[j] = min(cnt[j], count(all(s),'a'+j)); } rep(i, 26)cout << string(cnt[i],'a'+i); cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:43:39: 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)' 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | 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: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:43:39: 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'}) 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | 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:16: /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:43:39: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 43 | rep(j, 26)cnt[j] = min(cnt[j], | ~~~^~~~~~~~ 44 | count(all(s),'a'+j)); | ~~~~~~~~~~~~~~~~~~~~
s940747087
p03763
C++
#include <bits/stdc++.h> using namespace std; const int dx[]={1,0,-1,0,1,-1,-1,1}; const int dy[]={0,1,0,-1,1,1,-1,-1}; const int INF = 1e9; const long long LINF = 1e18; const double EPS = 1e-8; #define pb push_back #define mk make_pair #define fr first #define sc second #define ll long long #define reps(i,j,k) for(int i = (j); i < (k); ++i) #define rep(i,j) reps(i,0,j) #define all(a) (a).begin(),(a).end() #define MOD 1000000007 typedef pair<int,int> Pii; typedef pair<Pii,int> P; typedef vector<int> vi; int main(){ int N; cin >> N; string str; vector < string > vs; int memo[64][64]; rep(i,N){ cin >> str; vs.pb(str); rep(j,str.size()){ memo[i][str[j]-'a']++; } } string ans = ""; rep(i,'z'-'a' + 1){ int a = INF; rep(j,N){ a = min(a,memo[j][i]); } rep(j,a){ ans += i+'a'; } } cout << ans << endl;å return 0; }
a.cc: In function 'int main()': a.cc:43:29: error: '\U000000e5' was not declared in this scope 43 | cout << ans << endl;å | ^
s943891040
p03763
C++
n = input() counter = [108]* 26 alphabet = "abcdefghijklmnopqrstuvwxyz" for i in range(n): s = raw_input() for c in range(26): counter[c] = min(counter[c], s.count(alphabet[c])) res = "" for c in range(26): res += alphabet[c] * counter[c] print res
a.cc:1:1: error: 'n' does not name a type 1 | n = input() | ^
s316375349
p03763
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; char b[100],c[100],d[100]; int i,j,l,n; int main() { scanf("%d\n",&n); for (i=1;i<=26;i++) c[i]=100; for (i=1;i<=n;i++) { gets(b+1); l=strlen(b+1); memset(d,0,sizeof(d)); for (j=1;j<=l;j++) d[b[j]-96]++; for (j=1;j<=26;j++) c[j]=min(c[j],d[j]); } for (i=1;i<=26;i++) for (j=1;j<=c[i];j++) putchar(96+i); return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(b+1); | ^~~~ | getw
s659318565
p03763
C++
// package atcoder.arc.arc071; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); char[][] strs = new char[n][]; for (int i = 0; i < n ; i++) { strs[i] = in.nextToken().toCharArray(); } int[][] counts = new int[n][26]; for (int i = 0; i < n ; i++) { for (int j = 0; j < strs[i].length ; j++) { counts[i][strs[i][j]-'a']++; } } int[] min = new int[26]; Arrays.fill(min, Integer.MAX_VALUE); for (int i = 0; i < n ; i++) { for (int j = 0; j < 26; j++) { min[j] = Math.min(min[j], counts[i][j]); } } StringBuilder line = new StringBuilder(); for (int i = 0; i < 26 ; i++) { for (int j = 0; j < min[i] ; j++) { line.append((char)('a'+i)); } } out.println(line.toString()); out.flush(); } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } private int[] nextInts(int n) { int[] ret = new int[n]; for (int i = 0; i < n; i++) { ret[i] = nextInt(); } return ret; } private int[][] nextIntTable(int n, int m) { int[][] ret = new int[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { ret[i][j] = nextInt(); } } return ret; } private long[] nextLongs(int n) { long[] ret = new long[n]; for (int i = 0; i < n; i++) { ret[i] = nextLong(); } return ret; } private long[][] nextLongTable(int n, int m) { long[][] ret = new long[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { ret[i][j] = nextLong(); } } return ret; } private double[] nextDoubles(int n) { double[] ret = new double[n]; for (int i = 0; i < n; i++) { ret[i] = nextDouble(); } return ret; } private int next() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public char nextChar() { int c = next(); while (isSpaceChar(c)) c = next(); if ('a' <= c && c <= 'z') { return (char) c; } if ('A' <= c && c <= 'Z') { return (char) c; } throw new InputMismatchException(); } public String nextToken() { int c = next(); while (isSpaceChar(c)) c = next(); StringBuilder res = new StringBuilder(); do { res.append((char) c); c = next(); } while (!isSpaceChar(c)); return res.toString(); } public int nextInt() { int c = next(); while (isSpaceChar(c)) c = next(); int sgn = 1; if (c == '-') { sgn = -1; c = next(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = next(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = next(); while (isSpaceChar(c)) c = next(); long sgn = 1; if (c == '-') { sgn = -1; c = next(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = next(); } while (!isSpaceChar(c)); return res * sgn; } public double nextDouble() { return Double.valueOf(nextToken()); } public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } static void debug(Object... o) { System.err.println(Arrays.deepToString(o)); } }
a.cc:3:1: error: 'import' does not name a type 3 | import java.io.IOException; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.InputStream; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.io.PrintWriter; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.Arrays; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.util.InputMismatchException; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: expected unqualified-id before 'public' 9 | public class Main { | ^~~~~~
s319286498
p03763
C++
#include <cstdio> #include <cstring> #include <algorithm> static const int MAXN = 54; static const int ALPHABET = 26; int n; char s[MAXN]; int ct[ALPHABET], min[ALPHABET]; int main() { scanf("%d", &n); getchar(); for (int i = 0; i < ALPHABET; ++i) min[i] = MAXN; for (int i = 0; i < n; ++i) { gets(s); int len = strlen(s); for (int i = 0; i < ALPHABET; ++i) ct[i] = 0; for (int j = 0; j < len; ++j) ++ct[s[j] - 'a']; for (int j = 0; j < ALPHABET; ++j) min[j] = std::min(min[j], ct[j]); } for (int i = 0; i < ALPHABET; ++i) for (int j = 0; j < min[i]; ++j) putchar('a' + i); putchar('\n'); return 0; }
a.cc: In function 'int main()': a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(s); | ^~~~ | getw
s955535570
p03763
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() #define CHMIN(a,b) a=min((a),(b)) #define CHMAX(a,b) a=max((a),(b)) // mod const ll MOD = 1000000007ll; #define FIX(a) ((a)%MOD+MOD)%MOD // floating typedef double Real; const Real EPS = 1e-11; #define EQ0(x) (abs(x)<EPS) #define EQ(a,b) (abs(a-b)<EPS) typedef complex<Real> P; int n; char s[52][52]; int cnt[26]; int main(){ scanf("%d",&n); REP(i,n)scanf("%s",s[i]); { REP(j,26){ cnt[j] = count(s[0],s[0]+strlen(s[0]),'a'+j); } } FOR(i,1,n){ REP(j,26){ CHMIN(cnt[j],count(s[i],s[i]+strlen(s[i]),'a'+j)); } } REP(j,26){ REP(_,cnt[j])putchar('a'+j); } puts(""); return 0; }
a.cc: In function 'int main()': a.cc:20:25: error: no matching function for call to 'min(int&, std::iterator_traits<char*>::difference_type)' 20 | #define CHMIN(a,b) a=min((a),(b)) | ~~~^~~~~~~~~ a.cc:48:7: note: in expansion of macro 'CHMIN' 48 | CHMIN(cnt[j],count(s[i],s[i]+strlen(s[i]),'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:20:25: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::iterator_traits<char*>::difference_type' {aka 'long int'}) 20 | #define CHMIN(a,b) a=min((a),(b)) | ~~~^~~~~~~~~ a.cc:48:7: note: in expansion of macro 'CHMIN' 48 | CHMIN(cnt[j],count(s[i],s[i]+strlen(s[i]),'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:20:25: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | #define CHMIN(a,b) a=min((a),(b)) | ~~~^~~~~~~~~ a.cc:48:7: note: in expansion of macro 'CHMIN' 48 | CHMIN(cnt[j],count(s[i],s[i]+strlen(s[i]),'a'+j)); | ^~~~~
s865009474
p03764
C++
a.cc:1:1: error: '\U00003042' does not name a type 1 | あ | ^~
s050888891
p03764
C++
n,m=map(int,input().split()) aa=list(map(int,input().split())) bb=list(map(int,input().split())) mod=10**9+7 ss=0 for i in range(n-1): ss+=(aa[i+1]-aa[i])*(i+1)*(n-i-1) ss%=mod tt=0 for i in range(m-1): tt+=(bb[i+1]-bb[i])*(i+1)*(m-i-1) tt%=mod print((ss*tt)%mod)
a.cc:1:1: error: 'n' does not name a type 1 | n,m=map(int,input().split()) | ^
s035088620
p03764
C++
#include<bits/stdc++.h> //#pragma GCC optimize("O3") //#pragma GCC target ("sse4") using namespace std; #define PB push_back #define all(x) (x).begin(),(x).end() #define MEM(x,a) memset((x),a,sizeof((x))) #define F first #define S second #define imx INT_MAX #define inI(x) scanf("%d",&x) #define inI2(x,y) scanf("%d %d",&x,&y) #define inI3(x,y,z) scanf("%d %d %d",&x,&y,&z) const long long MOD = (long long)(1e9+7); const long long MMX = (long long)(1e18); typedef long long LL; int n,m; LL a=-MMX,b=MMX,c=-MMX,d=MMX,x; __int128 cc; int main() { scanf("%d %d",&n,&m); for(int i=1;i<=n;i++)scanf("%d",&x),a=max(x,a),b=min(x,b); for(int i=1;i<=m;i++)scanf("%d",&x),c=max(x,c),d=min(x,d); cc=(a-b)*(c-d); cc%=MOD; cc*=(n-1); cc%=MOD; cc*=(m-1); cc%=MOD; cout<<cc; }
a.cc: In function 'int main()': a.cc:31:9: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__int128') 31 | cout<<cc; | ~~~~^~~~ | | | | | __int128 | 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: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: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: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) | ^~~~~~~~ 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/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/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/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: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: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: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: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: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:573:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char) [with _CharT = char; _Traits = char_traits<char>]' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: candidate: 'std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char) [with _Traits = char_traits<char>]' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: candidate: 'std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char) [with _Traits = char_traits<char>]' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: candidate: 'std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char) [with _Traits = char_traits<char>]' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~
s412024931
p03764
C++
#pragma GCC optimize ("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; using Int = long long; typedef pair<int,int> P; typedef pair<Int,Int> Pl; static const int mod = 1e9+7; #define END {cout<<ans<<'\n'; return 0;} #define ALL(v) (v).begin(),(v).end() #define Pr(t) priority_queue<t> #define gPr(t) priority_queue<t,vector<t>,greater<t>> #define V(t) vector<t> #define rep(i,n) for(int i=0; i<n; i++) #define rer(i,l,r) for(int i=l; i<=r; i++) #define gnr(i,l,r) for(int i=r; i>=l; i--) #define eb emplace_back #define pri1(a) cout<<(a)<<'\n' #define pri2(a,n) rep(i,n-1)cout<<a[i]<<' '; cout<<a[n-1]<<'\n' #define prip(p) cout<<p.first<<' '<<p.second<<'\n' template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<int MOD> struct ModInt { static const int Mod = MOD; unsigned x; ModInt() : x(0) {} ModInt(signed sig) { int sigt = sig % MOD; if(sigt < 0) sigt += MOD; x = sigt; } ModInt(signed long long sig) { int sigt = sig % MOD; if(sigt < 0) sigt += MOD; x = sigt; } int get() const { return (int)x; } ModInt &operator+=(ModInt that) { if((x += that.x) >= MOD) x -= MOD; return *this; } ModInt &operator-=(ModInt that) { if((x += MOD - that.x) >= MOD) x -= MOD; return *this; } ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; } ModInt &operator/=(ModInt that) { return *this *= that.inverse(); } ModInt &operator%=(ModInt that) { x %= that.x; return *this; } ModInt operator+(ModInt that) const { return ModInt(*this) += that; } ModInt operator-(ModInt that) const { return ModInt(*this) -= that; } ModInt operator*(ModInt that) const { return ModInt(*this) *= that; } ModInt operator/(ModInt that) const { return ModInt(*this) /= that; } ModInt operator%(ModInt that) const { return ModInt(*this) %= that; } ModInt inverse() const { signed a = x, b = MOD, u = 1, v = 0; while(b) { signed t = a / b; a -= t * b; std::swap(a, b); u -= t * v; std::swap(u, v); } if(u < 0) u += Mod; ModInt res; res.x = (unsigned)u; return res; } bool operator==(ModInt that) const { return x == that.x; } bool operator!=(ModInt that) const { return x != that.x; } ModInt operator-() const { ModInt t; t.x = x == 0 ? 0 : Mod - x; return t; } friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; } friend istream &operator>>(istream &is, ModInt &a) { int64_t t; is >> t; a = ModInt< mod >(t); return (is); } }; template<int MOD> ModInt<MOD> operator^(ModInt<MOD> a, unsigned long long k) { ModInt<MOD> r = 1; while(k) { if(k & 1) r *= a; a *= a; k >>= 1; } return r; } typedef ModInt<mod> mint; int n,m,_,x,y,q; string s,sb; bool ok; char cf,cb; signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cin>>n>>m; mint a[n],b[m]; rep(i,n)cin>>a[i]; rep(i,m)cin>>b[i]; mint an=0,bn=0; rep(i,n)an+=a[i]*(2*i-n+1); rep(i,m)bn+=b[i]*(2*i-m+1); cout<<an*bn<<'\n'; }
a.cc: In instantiation of 'std::istream& operator>>(std::istream&, ModInt<1000000007>&)': a.cc:93:19: required from here 93 | rep(i,n)cin>>a[i]; rep(i,m)cin>>b[i]; | ^ a.cc:68:9: error: call of overloaded 'ModInt(int64_t&)' is ambiguous 68 | a = ModInt< mod >(t); | ^~~~~~~~~~~~~~~~ a.cc:30:9: note: candidate: 'ModInt<MOD>::ModInt(long long int) [with int MOD = 1000000007]' 30 | ModInt(signed long long sig) { int sigt = sig % MOD; if(sigt < 0) sigt += MOD; x = sigt; } | ^~~~~~ a.cc:29:9: note: candidate: 'ModInt<MOD>::ModInt(int) [with int MOD = 1000000007]' 29 | ModInt(signed sig) { int sigt = sig % MOD; if(sigt < 0) sigt += MOD; x = sigt; } | ^~~~~~ a.cc:25:8: note: candidate: 'constexpr ModInt<1000000007>::ModInt(const ModInt<1000000007>&)' 25 | struct ModInt { | ^~~~~~ a.cc:25:8: note: candidate: 'constexpr ModInt<1000000007>::ModInt(ModInt<1000000007>&&)'
s957665221
p03764
C++
#include <bits/stdc++.h> using namespace std; #define long long ll; const int MAX=1e5+100; const int INF=99999999; const int MOD=1e9+7; ll x[MAX],y[MAX]; int main() { ll n,m; cin>>n>>m; for(int i=1; i<=n; i++) cin>>x[i]; for(int i=1; i<=m; i++) cin>>y[i]; ll ax=0,ay=0; for(int i=1; i<=n; i++) ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD; for(int i=1; i<=m; i++) ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD; cout<<ax%MOD*ay%MOD<<endl; return 0; }
a.cc:7:1: error: 'll' does not name a type 7 | ll x[MAX],y[MAX]; | ^~ a.cc: In function 'int main()': a.cc:10:5: error: 'll' was not declared in this scope 10 | { ll n,m; | ^~ a.cc:11:10: error: 'n' was not declared in this scope; did you mean 'yn'? 11 | cin>>n>>m; | ^ | yn a.cc:11:13: error: 'm' was not declared in this scope; did you mean 'tm'? 11 | cin>>n>>m; | ^ | tm a.cc:13:14: error: 'x' was not declared in this scope 13 | cin>>x[i]; | ^ a.cc:15:14: error: 'y' was not declared in this scope 15 | cin>>y[i]; | ^ a.cc:16:7: error: expected ';' before 'ax' 16 | ll ax=0,ay=0; | ^~~ | ; a.cc:18:9: error: 'ax' was not declared in this scope 18 | ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD; | ^~ a.cc:18:23: error: 'x' was not declared in this scope 18 | ax=(ax+((i-1)*x[i]- (n-i)*x[i]))%MOD; | ^ a.cc:20:9: error: 'ay' was not declared in this scope 20 | ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD; | ^~ a.cc:20:23: error: 'y' was not declared in this scope 20 | ay=(ay+((i-1)*y[i]-(m-i)*y[i]))%MOD; | ^ a.cc:21:11: error: 'ax' was not declared in this scope 21 | cout<<ax%MOD*ay%MOD<<endl; | ^~ a.cc:21:18: error: 'ay' was not declared in this scope 21 | cout<<ax%MOD*ay%MOD<<endl; | ^~
s846104533
p03764
C++
#include <iostream> #include <vector> #include<list> #include <algorithm> #include <string> #include <math.h> #include<map> #include <utility> #include<queue> using namespace std; #define REP(i,k,n) for(int i=k;i<n;i++) #define INF 1844674407370955161 typedef long long unsigned int ll; #define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0])) #define MOD 1000000007 template<typename T> int vector_finder(std::vector<T> vec, T number) { auto itr = std::find(vec.begin(), vec.end(), number); size_t index = std::distance( vec.begin(), itr ); if (index != vec.size()) { // 発見できたとき return 1; } else { // 発見できなかったとき return 0; } } template<typename T> T gcd(T a,T b){ if(b>0){ return gcd(b, a % b); }else{ return a; } } template<typename T> T lcm(T a,T b){ T g = gcd(a, b); return a * b / g; } void clear( std::queue<pair<int,int> > &q ) { std::queue<pair<int,int> > empty; std::swap( q, empty ); } bool IsPrime(int num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } template<typename T> std::vector<T> enum_div(T n)//nの約数を列挙 { std::vector<T> ret; for(T i=1 ; i*i<=n ; ++i) { if(n%i == 0) { ret.push_back(i); if(i!=1 && i*i!=n) { ret.push_back(n/i); } } } return ret; } int main() { int n, m; long long xans=0; long long yans = 0; cin >> n >> m; REP(i,1,n+1){ long long x; cin >> x; xans += (2 * i - n - 1) * x%MOD; } REP(i,1,m+1){ long long y; cin >> y; yans += (2 * i - m - 1) * y%MOD; } ll ans=xans*yans%MOD cout << ans<< endl; return 0; }
a.cc: In function 'int main()': a.cc:108:3: error: expected ',' or ';' before 'cout' 108 | cout << ans<< endl; | ^~~~
s586484583
p03764
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=100005; const int MOD=1e9+7; ll x[N],y[N]; int n,m; int main() { int n; scanf("%d%d",&n,&m); int maxX=-(1e9+7),minX=1e9+7; int maxY=-(1e9+7),minY=1e9+7; for(int i=1;i<=n;i++) { scanf("%lld",&x[i]); } for(int i=1;i<=m;i++) { scanf("%lld",&y[i]); } sort(x+1,x+n+1); sort(y+1,y+m+1); ll ans1=0,ans2=0;; for(int i=1;i<n;i++) { ans1=(ans1%MOD+((x[i+1]-x[i])%MOD*i%MOD*(n-i)%MOD)%MOD)%MOD)%MOD; } for(int i=1;i<m;i++) { ans2=(ans2%MOD+((y[i+1]-y[i])%MOD*i%MOD*(m-i)%MOD)%MOD)%MOD; } cout<<(ans1%MOD*ans2%MOD)%MOD<<endl; return 0; }
a.cc: In function 'int main()': a.cc:28:73: error: expected ';' before ')' token 28 | ans1=(ans1%MOD+((x[i+1]-x[i])%MOD*i%MOD*(n-i)%MOD)%MOD)%MOD)%MOD; | ^ | ;
s517396805
p03764
C++
#include<iostream> using namespace std; int main(){ long n,m,sum1=0,sum2=0,,b4a,a,ans,mod=1000000007,i; cin>>n>>m; cin>>b4a; for(i=1;i<n;i++){ cin>>a; sum1=(sum1+(a-b4a)*i%mod*(n-i)%mod)%mod; } cin>>b4a; for(i=1;i<m;i++){ cin>>a; sum2=(sum2+(a-b4a)*i%mod*(n-i)%mod)%mod; } ans=sum1*sum2%mod; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:4:26: error: expected unqualified-id before ',' token 4 | long n,m,sum1=0,sum2=0,,b4a,a,ans,mod=1000000007,i; | ^
s400391506
p03764
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; signed main(){ int n,m;cin>>n>>m; vector<int> x(n),y(m); for(auto&& w:x)cin>>w; for(auto&& w:y)cin>>w; sort(begin(x),end(x)); sort(begin(y),end(y)); int x0=x[0],y0=y[0]; for(auto&& w:x)w-=x0; for(auto&& w:y)w-=y0; vector<vector<int>> s(n,vector<int>(m,0)); for(int i=1;i<n;i++){ for(int j=0;j<m;j++){ s[i][j]=(x[i]%mod)*(y[j]%mod)%mod; }} for(int i=1;i<n;i++){ for(int j=0;j<m;j++){ s[ }} }
a.cc: In function 'int main()': a.cc:26:1: error: expected primary-expression before '}' token 26 | }} | ^ a.cc:25:27: error: expected ']' before '}' token 25 | s[ | ^ | ] 26 | }} | ~
s967462500
p03764
C++
#include <iostream> #include <iomanip> #include <algorithm> #include <vector> #include <string> #include <sstream> #include <set> #include <map> #include <iostream> #include <utility> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> #include <unordered_set> #include <unordered_map> #include <limits.h> #include <cstring> #include <tuple> #include <cassert> #include <numeric> using namespace std; // type alias typedef long long LL; typedef vector < int > VI; typedef unordered_map < int, int > MAPII; typedef unordered_set < int > SETI; typedef pair< int , int > II; typedef tuple< int, int, int > III; // repetition #define FORE(i,a,b) for(int i=(a);i<=(b);++i) #define REPE(i,n) for(int i=0;i<=(n);++i) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define FORR(x,arr) for(auto& x:arr) #define SZ(a) int((a).size()) // DP #define MINUS(dp) memset(dp, -1, sizeof(dp)) #define ZERO(dp) memset(dp, 0, sizeof(dp)) // minmax #define SMAX(a,b) a = max(a,b) #define SMIN(a,b) a = min(a,b) // debug cerr #define TRACE true #define dump(x) if(TRACE) { cerr << #x << " = " << (x) << endl; } #define dump2(x,y) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << endl; } #define dump3(x,y,z) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << endl; } #define dump4(x,y,z,a) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << ", " << #a << " = " << (a) << endl; } #define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cerr << x << ','; } cerr << endl; } /* 8/4/2018 13:30-14:30 give up 14:30-16:30 read editorials I tried to count rectangles though, I couldn't move forward AT ALL. Editorials: - https://atcoder.jp/img/arc071/editorial.pdf - https://youtu.be/HAxMNuhoQ3E?t=1813 2D -> 1D (independence). Fxck. N<=1e5, M<=1e5. That means we MUST solve something for `x` and `y` separtely. Fxck. Key: - N and M are large. Solve them independently in O(N) - Combine result of X and result of Y - ∑ {a*b : a∈A, b∈B } = ∑{a∈A}*∑{b∈B} - ∑ {x[j]-x[i] : i<j } = ∑ { (2*i-N+1)*x[i] : i=0..N-1 } = ∑ { (i+1)*(N-i-1)*L[i] : i=0..N-2 } Summary: - Narrow down analysis based on constraint - Independence of X and Y in Cartesian coordinate system is SOOOOOOOOOOOOOO typical - */ // $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG x.cpp && ./a.out const int MAX_N=1e5+1; int N,M; LL X[MAX_N],Y[MAX_N]; const LL MOD=1e9+7; LL f(vector<LL> ns) { LL res=0; int L=SZ(ns); REP(i,L) res+=((1LL*(i+1)*(L-i)%MOD)*ns[i])%MOD,res%=MOD; return res; } void solve_length() { vector<LL> A(N-1),B(M-1); REP(i,N-1) A[i]=X[i+1]-X[i]; REP(i,M-1) B[i]=Y[i+1]-Y[i]; LL res=f(A); res*=f(B),res%=MOD; cout<<res<<endl; } LL g(LL Z[MAX_N], int L) { LL res=0; REP(i,N) res+=(1LL*(2LL*i-L+1)*Z[i]%MOD,res%=MOD; return res; } void solve() { LL res=g(X,N); res*=g(Y,M),res%=MOD; cout<<res<<endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin>>N>>M; REP(i,N) cin>>X[i]; REP(i,M) cin>>Y[i]; solve(); return 0; }
a.cc: In function 'LL g(LL*, int)': a.cc:104:51: error: expected ')' before ';' token 104 | REP(i,N) res+=(1LL*(2LL*i-L+1)*Z[i]%MOD,res%=MOD; | ~ ^ | )
s344115816
p03764
C++
#include<iostream> #include<stdint> using namespace std; const int MOD = 1000000007; // 今回使う余り int main() { int n, m, x, y; cin >> n >> m; int64_t xsum = 0, ysum = 0; for (int i = 0;i < n;i ++) { cin >> x; xsum = (xsum + (int64_t)(2 * i + 1 - n) * x) % MOD; } for (int i = 0;i < m;i ++) { cin >> y; ysum = (ysum + (int64_t)(2 * i + 1 - m) * y) % MOD; } cout << xsum * ysum % MOD; return 0; } /* 31536000のコメント解説欄 ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー 単に式変形すると解ける xy独立なのでまずはxについて説明するよ まず、x方向ではΣ[i=1, n] Σ[j=i + 1, n] (xj - xi)が答え これだと2重ループだけど、あるkを用いてΣ[k = 1, n] ((k - 1)x_k - (n - k)x_k) = Σ[k = 1, n] ((2k - n - 1)x_k)に等しいと分かるとO(n) y方向も同様にやって終わり */
a.cc:2:9: fatal error: stdint: No such file or directory 2 | #include<stdint> | ^~~~~~~~ compilation terminated.
s548011874
p03764
C
#include<cstdio> #include<algorithm> #define MN 200001 using namespace std; const int MOD=1e9+7; int n,m,a[MN],b[MN],A=0,B=0; int main(){ scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) scanf("%d",&a[i]);sort(a+1,a+1+n); for (int i=1;i<=m;i++) scanf("%d",&b[i]);sort(b+1,b+1+m); for (int i=1;i<n;i++) A=(1LL*(a[i+1]-a[i])*i%MOD*(n-i)+A)%MOD; for (int i=1;i<m;i++) B=(1LL*(b[i+1]-b[i])*i%MOD*(m-i)+B)%MOD; printf("%lld\n",1ll*A*B%MOD); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s475944616
p03764
C++
#include <iostream> #include <vector> int main() { const long long mod = 1000000007; long long n, m; std::cin >> n >> m; std::vector<long long> x(n); std::vector<long long> y(m); for (int i = 0; i < n; ++i) { std::cin >> x[i]; } for (int i = 0; i < m; ++i) { std::cin >> y[i]; } std::sort(x.begin(), x.end()); std::sort(y.begin(), y.end()); long long x_sum = 0ull; long long y_sum = 0ull; for (int i = 0; i < n; ++i) { x_sum += (2 * i - n + 1) * x[i]; x_sum %= mod; } for (int i = 0; i < m; ++i) { y_sum += (2 * i - m + 1) * y[i]; y_sum %= mod; } std::cout << (x_sum * y_sum) % mod << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:16:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 16 | std::sort(x.begin(), x.end()); | ^~~~ | qsort a.cc:17:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 17 | std::sort(y.begin(), y.end()); | ^~~~ | qsort