submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s389719985
p00338
C
#include<iostream> #include<string> using namespace std; int main(void); int n,c; cin>>n>>c; int p[n],q[n]; for(int i=0,i<n,i++){ p=0; } for(i=0;i<c;i++){ int a,b,d; cin>>a; if(a=0){ cin>>b>>d; n[b]+=d; } else{ cin>>b; strcpy(q,p); for(int j=0;j<n-1;j++){ for(int k=j+1;k<n;k++){ if(q[j]<q[k]){ int l=q[j]; q[j]=q[k]; q[k]=l; } } } printf("%d %d",b,q[b-1]); } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s587809104
p00338
C
#include<bits/stdc++.h> using namespace std; int main(void); int n,c; cin>>n>>c; int p[n],q[n]; for(int i=0,i<n,i++){ p=0; } for(i=0;i<c;i++){ int a,b,d; cin>>a; if(a=0){ cin>>b>>d; n[b]+=d; } else{ cin>>b; strcpy(q,p); for(int j=0;j<n-1;j++){ for(int k=j+1;k<n;k++){ if(q[j]<q[k]){ int l=q[j]; q[j]=q[k]; q[k]=l; } } } printf("%d %d",b,q[b-1]); } } return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s803226339
p00338
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef pair<ll,ll>P; int a[100000],b[100000],c[100000],n,m; ll s[100000]; int bit[200000]; void add(int k,int x){ while(k<=n){ bit[k]+=x; k+=k&-k; } } int sum(int k){ int res=0; while(k){ res+=bit[k]; k-=k&-k; } return res; } int main() { scanf("%d%d",&n,&m); vector<P>v; rep(i,n)v.push_back(P(0,i)),add(i+1,1); rep(i,m){ scanf("%d%d",&a[i],&b[i]);b[i]--; if(a[i]==0){ scanf("%d",&c[i]); s[b[i]]+=c[i]; v.push_back(P(s[b[i]],b[i])); } } sort(v.begin(),v.end()); memset(s,0,sizeof(s)); rep(i,m){ if(a[i]==0){ s[b[i]]+=c[i]; add(lower_bound(v.begin(),v.end(),s[b[i]])-v.begin()+1,1); } else{ } } }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = __gnu_cxx::__normal_iterator<std::pair<long long int, long long int>*, std::vector<std::pair<long long int, long long int> > >; _Value = const long long int]': /usr/include/c++/14/bits/stl_algobase.h:1504:14: required from '_ForwardIterator std::__lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<long long int, long long int>*, vector<pair<long long int, long long int> > >; _Tp = long long int; _Compare = __gnu_cxx::__ops::_Iter_less_val]' 1504 | if (__comp(__middle, __val)) | ~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1539:32: required from '_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<long long int, long long int>*, vector<pair<long long int, long long int> > >; _Tp = long long int]' 1539 | return std::__lower_bound(__first, __last, __val, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ 1540 | __gnu_cxx::__ops::__iter_less_val()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:41:19: required from here 41 | add(lower_bound(v.begin(),v.end(),s[b[i]])-v.begin()+1,1); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:69:22: error: no match for 'operator<' (operand types are 'std::pair<long long int, long long int>' and 'const long long int') 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)' 1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)' 1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const long long int' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const long long int' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: mismatched types 'const std::pair<_T1, _T2>' and 'const long long int' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::reverse_iterator<_Iterator>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::reverse_iterator<_Iterator>' 69 | { return *__it < __val; } | ~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~
s432638188
p00339
C++
#include<bits/stdc++.h> #define int long long #define fi first #define se second #define PB push_back using namespace std; typedef pair<int, int> P1; typedef pair<int, pair<int, int> > P2; static const int INF = 1ll<<60; static const int dx[] = { 1, -1, 0, 0, }; static const int dy[] = { 0, 0, 1, -1 }; static const int mod = 1000000007; int N,M; int v[3005],h[3005]; int t[3005],s[3005]; //?????¨ //?????? int imos1[3005],imos2[3005]; int bonus[3005]; P1 dp[1005][3005]; P1 min_pair(P1 a,P1 b){ if(a.first<b.first)return a; else if(a.first>b.first)return b; else { if(a.second<b.second)return a; else if(a.second>b.second)return b; else return a; } } void solve(){ for(int i=0;i<1005;++i)for(int j=0;j<3005;++j)dp[i][j]=P1(INF,0); for(int i=0;i<N;++i){ int V = imos1[i]; int H = imos2[i] + bonus[i]; if(t[0]-V<0)continue; if(s[0]>H)continue; //cout<<V<<" "<<H<<endl; //cout<<i<<endl; dp[0][i] = min(P1(V,-H),dp[0][i]); } for(int i=0;i<M-1;++i){ for(int j=0;j<N;++j){ int cost = dp[i][j].first; int strength = -dp[i][j].second; if(cost>t[i]||strength<s[i])continue; //cout<<i<<" "<<j<<endl; for(int k=0;k<min(100,N-j);++k){ int cur_v = imos1[j+k]-imos1[j]; int cur_h = imos2[j+k]-imos2[j]; int cur_b = bonus[j+k]-bonus[j+1]; if(k<=1)cur_b=0; if(t[i+1]-(cost+cur_v)<0)continue; if(s[i+1]>strength+cur_h+cur_b)continue; dp[i+1][j+k]=min_pair(P1(cost+cur_v,-(strength+cur_h+cur_b)),dp[i+1][j+k]); //cout<<dp[i+1][j+k].first<<endl; } } } int ans=INF; for(int i=0;i<3005;++i)ans=min(dp[M-1][i].first,ans); if(ans>=INF)cout<<"-1"<<endl; else cout<<t[M-1]-ans<<endl; } signed main(){ cin>>N>>M; //if(N==3000&&M==1000)cout<<1/0<<endl; for(int i=0;i<N;++i)cin>>v[i]>>h[i]; for(int i=0;i<M;++i)cin>>t[i]>>s[i]; for(int i=0;i<N;++i){ if(!i){ imos1[i]=v[i]; imos2[i]=h[i]; } else { imos1[i]=imos1[i-1]+v[i]; imos2[i]=imos2[i-1]+h[i]; } } for(int i=1;i<N;++i){ bonus[i]=bonus[i-1]+abs(h[i]-h[i-1]); } solve(); return 0; }
a.cc: In function 'void solve()': a.cc:53:30: error: no matching function for call to 'min(int, long long int)' 53 | for(int k=0;k<min(100,N-j);++k){ | ~~~^~~~~~~~~ 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:53:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 53 | for(int k=0;k<min(100,N-j);++k){ | ~~~^~~~~~~~~ /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:53:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 53 | for(int k=0;k<min(100,N-j);++k){ | ~~~^~~~~~~~~
s141913200
p00339
C++
#include <bits/stdc++.h> using namespace std; #define INF 0x7fffffffffff typedef long long int LLI; int N; int M; LLI ts[1145]; LLI ss[1145]; LLI vs[3145]; LLI hs[3145]; LLI ds[1145]; LLI himos[3145]; LLI dimos[1145]; LLI vimos[1145]; LLI dp[1145][3145]; // [l, r) LLI CalcD(int l, int r) { LLI ret = 0; r -= 2; l--; if (r >= 0) ret += dimos[r]; if (l >= 0) ret -= dimos[l]; return ret; } LLI CalcH(int l, int r) { LLI ret = 0; --r; --l; if (r >= 0) ret += himos[r]; if (l >= 0) ret -= himos[l]; return ret; } LLI CalcV(int l, int r) { LLI ret = 0; --r; --l; if (r >= 0) ret += vimos[r]; if (l >= 0) ret -= vimos[l]; return ret; } int main() { scanf("%d%d", &N, &M); for (int i=0; i<N; i++) { scanf("%lld%lld", &vs[i], &hs[i]); } for (int i=0; i<N-1; i++) { ds[i] = llabs(hs[i] - hs[i+1]); } himos[0] = hs[0]; dimos[0] = ds[0]; vimos[0] = vs[0]; for (int i=1; i<N; i++) { himos[i] = himos[i-1] + hs[i]; dimos[i] = dimos[i-1] + ds[i]; vimos[i] = vimos[i-1] + vs[i]; } for (int i=0; i<M; i++) { scanf("%lld%lld", &ts[i], &ss[i]); } for (int i=0; i<=M; i++) { for (int j=0; j<=N; j++) { dp[i][j] = -INF; argmax[i][j] = (i == 1) ? 0 : -1; } } dp[0][0] = 0; for (int i=1; i<=M; i++) { for (int k=0; k<=N; k++) { if (CalcV(0, k) > ts[i-1]) break; if (k > 0) dp[i][k] = max(dp[i][k], dp[i-1][k-1]); if (k > 1) dp[i][k] = max(dp[i][k], dp[i][k-1] + CalcD(k-2, k)); } for (int k=0; k<=N; k++) { dp[i][k] = max(dp[i][k], dp[i-1][k]); } /*for (int j=0; j<=N; j++) { if (dp[i][j] < 0) printf("INF "); else printf("%03lld ", dp[i][j]); } puts("");*/ for (int k=0; k<=N; k++) { if (CalcH(0, k)+dp[i][k] < ss[i-1]) { dp[i][k] = -INF; } } } /*for (int i=0; i<=M; i++) { for (int j=0; j<=N; j++) { if (argmax[i][j] < 0) printf("-1 "); else printf("%02lld ", argmax[i][j]); } puts(""); } for (int i=0; i<=M; i++) { for (int j=0; j<=N; j++) { if (dp[i][j] < 0) printf("INF "); else printf("%03lld ", dp[i][j]); } puts(""); }*/ for (int i=0; i<=N; i++) { if (dp[M][i] >= 0) { LLI ans = ts[M-1] - CalcV(0, i); assert (ans >= 0); printf("%lld\n", ans); return 0; } } puts("-1"); }
a.cc: In function 'int main()': a.cc:74:7: error: 'argmax' was not declared in this scope 74 | argmax[i][j] = (i == 1) ? 0 : -1; | ^~~~~~
s744035359
p00340
Java
import java.util.Scanner; public class Main1 { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int[] a = new int[4]; for(int i = 0; i < 4; i++) { a[i] = stdin.nextInt(); } if(a[0] == a[1] && a[2] == a[3]) { System.out.println("yes"); } else if(a[0] == a[2] && a[1] == a[3]) { System.out.println("yes"); } else if(a[0] == a[3] && a[1] == a[2]) { System.out.println("yes"); } else { System.out.println("no"); } } }
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s675524896
p00340
Java
package PCK_Final_16; import java.util.Scanner; public class Q1 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int i, j, c = 0; int[] array = new int[4]; for(i = 0;i < 4;++i){ array[i] = sc.nextInt(); for(j = 0;j < i;++j){ if(array[j] == array[i]){ c++; array[j] = -1; array[i] = -1; } } } System.out.println(c >= 2 ? "yes" : "no"); } }
Main.java:5: error: class Q1 is public, should be declared in a file named Q1.java public class Q1 { ^ 1 error
s483345418
p00340
C
#include<stdio.h> int main(){ int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(a==b&&!a==d){ if(b==c){ printf("yes"); } } if(a==c&&a!=d){ if(b==d){ printf("yes"); } } if(a==d&&a!=c){ if(b==c){ printf("yes"); } } if(a==b&&b==c&&c==d){ printf("yes"); } else{ printf("no"); }
main.c: In function 'main': main.c:29:3: error: expected declaration or statement at end of input 29 | } | ^
s499815960
p00340
C++
using System; public class Test { public static void Main() { int a[] = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(a); if(a[0] == a[1] && a[2] == a[3]) Console.WriteLine("yes"); else Console.WriteLine("no"); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Test | ^~~~~~
s681995071
p00340
C++
using System; using System.Linq; public class Test { public static void Main() { int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(a); if(a[0] == a[1] && a[2] == a[3]) Console.WriteLine("yes"); else Console.WriteLine("no"); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Test | ^~~~~~
s161901678
p00340
C++
???#include<bits/stdc++.h> using namespace std; #define int long long typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define all(v) (v).begin(),(v).end() #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) #define pb push_back #define fi first #define se second template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;} template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;} signed main(){ int e[4];rep(i,4)cin>>e[i]; sort(e,e+4); if(e[0]==e[1]&&e[2]==e[3])cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; }
a.cc:1:4: error: stray '#' in program 1 | ???#include<bits/stdc++.h> | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ???#include<bits/stdc++.h> | ^ a.cc:5:9: error: 'vector' does not name a type 5 | typedef vector<int>vint; | ^~~~~~ a.cc:6:9: error: 'pair' does not name a type 6 | typedef pair<int,int>pint; | ^~~~ a.cc:7:9: error: 'vector' does not name a type 7 | typedef vector<pint>vpint; | ^~~~~~ a.cc: In function 'int main()': a.cc:19:22: error: 'cin' was not declared in this scope 19 | int e[4];rep(i,4)cin>>e[i]; | ^~~ a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'? 20 | sort(e,e+4); | ^~~~ | short a.cc:21:31: error: 'cout' was not declared in this scope 21 | if(e[0]==e[1]&&e[2]==e[3])cout<<"yes"<<endl; | ^~~~ a.cc:21:44: error: 'endl' was not declared in this scope 21 | if(e[0]==e[1]&&e[2]==e[3])cout<<"yes"<<endl; | ^~~~ a.cc:22:10: error: 'cout' was not declared in this scope 22 | else cout<<"no"<<endl; | ^~~~ a.cc:22:22: error: 'endl' was not declared in this scope 22 | else cout<<"no"<<endl; | ^~~~
s449368296
p00340
C++
?????? ????????¢ #include< iostream > using namespace std ; main(){ int a, b, c, d; cin >> a >> b >> c >> d; if ( a == b && c == d || a == c && b == d || a == d && b == c ) cout << "yes" << endl ; else cout << "no" << endl ; return 0; }
a.cc:2:9: error: extended character ¢ is not valid in an identifier 2 | ????????¢ | ^ a.cc:3:10: error: missing terminating > character 3 | #include< | ^ a.cc:3:9: error: empty filename in #include 3 | #include< | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ?????? | ^ a.cc:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:1: error: 'cin' was not declared in this scope 12 | cin | ^~~ a.cc:17:1: error: 'cout' was not declared in this scope 17 | cout | ^~~~ a.cc:19:1: error: 'endl' was not declared in this scope 19 | endl | ^~~~ a.cc:22:1: error: 'cout' was not declared in this scope 22 | cout | ^~~~ a.cc:24:1: error: 'endl' was not declared in this scope 24 | endl | ^~~~
s133750012
p00340
C++
#include<iostream> using namespace std; int main() { int e1,e2,e3,e4; cin >> e1 >> e2 >> e3 >> e4; int a=e1+e2; int b=e1+e3; int c=e1+e4; int d=e2= if(e1+e2==e3+e4) cout << "yes\n"; else if(e1+e3==e2+e4) cout << "yes\n"; else if(e1+e4==e2+e3) cout << "yes\n"; else cout << "no\n"; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: expected primary-expression before 'if' 11 | if(e1+e2==e3+e4) cout << "yes\n"; | ^~ a.cc:12:3: error: 'else' without a previous 'if' 12 | else if(e1+e3==e2+e4) cout << "yes\n"; | ^~~~
s741662615
p00340
C++
#include <stdio.h> int main(){ int e1,e2,e3,e4; scanf("%d%d%d%d",&e1,&e2,&e3,&e4) if(e1==e2&&e2==e3) printf("Yes\n"); if(e1==e3&&e2==e4) printf("Yes\n"); if(e1==e4&&e2==e3) printf("Yes\n"); else printf("No\n"); returan 0; }
a.cc: In function 'int main()': a.cc:4:38: error: expected ';' before 'if' 4 | scanf("%d%d%d%d",&e1,&e2,&e3,&e4) | ^ | ; 5 | if(e1==e2&&e2==e3) printf("Yes\n"); | ~~ a.cc:11:3: error: 'returan' was not declared in this scope 11 | returan 0; | ^~~~~~~
s623330904
p00340
C++
#include <stdio.h> int main(){ int e1,e2,e3,e4; scanf("%d%d%d%d",&e1,&e2,&e3,&e4); if(e1==e2&&e2==e3) printf("Yes\n"); if(e1==e3&&e2==e4) printf("Yes\n"); if(e1==e4&&e2==e3) printf("Yes\n"); else printf("No\n"); returan 0; }
a.cc: In function 'int main()': a.cc:11:3: error: 'returan' was not declared in this scope 11 | returan 0; | ^~~~~~~
s409589007
p00340
C++
6 7 8 9 10 11 12 13 14 15 16 #include <iostream> #include <bits/stdc++.h> using namespace std; テつ?つ?つ?つ?nt main(void){ テつ?つ?つ?つ?つ?つ?つ?つ?nt number[4]; テつ?つ?つ?つ?つ?つ?つ?つ?or(int i = 0; i < 4; i++){ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?in >> number[i]; テつ?つ?つ?つ?つ?つ?つ?つ? テつ?つ?つ?つ?つ?つ?つ?つ?ort(number, number + 4); テつ?つ?つ?つ?つ?つ?つ?つ?f((number[0] == number[1]) && (number[2] == number[3])){ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?out << "yes" << endl; テつ?つ?つ?つ?つ?つ?つ?つ?else{ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?out << "no" << endl; テつ?つ?つ?つ?つ?つ?つ?つ? テつ?つ?つ?つ?つ?つ?つ?つ?eturn 0;テつ?つ? テつ?つ?つ?つ?
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:12: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX_NODI
s340122737
p00340
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; テつ?つ?つ?つ?nt main(void){ テつ?つ?つ?つ?つ?つ?つ?つ?nt number[4]; テつ?つ?つ?つ?つ?つ?つ?つ?or(int i = 0; i < 4; i++){ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?in >> number[i]; テつ?つ?つ?つ?つ?つ?つ?つ? テつ?つ?つ?つ?つ?つ?つ?つ?ort(number, number + 4); テつ?つ?つ?つ?つ?つ?つ?つ?f((number[0] == number[1]) && (number[2] == number[3])){ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?out << "yes" << endl; テつ?つ?つ?つ?つ?つ?つ?つ?else{ テつ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?つ?out << "no" << endl; テつ?つ?つ?つ?つ?つ?つ?つ? テつ?つ?つ?つ?つ?つ?つ?つ?eturn 0;テつ?つ? テつ?つ?つ?つ?
a.cc:4:1: error: '\U000030c6\U00003064' does not name a type 4 | テつ?つ?つ?つ?nt main(void){ | ^~~~
s629852761
p00340
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int a[4]; scanf("%d,%d,%d,%d",&a[0],&a[1],&a[2],&a[3]); sort(a,a+4); if(a[0] == a[1] && a[2] == a[3]) cout << "yes" <<endl; else cout << "no" << endl; fflush(stdin); getchar(); return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'? 8 | sort(a,a+4); | ^~~~ | short
s716887211
p00340
C++
#include <bits/stdc++.h> using namespace std; int e[4]; int main() { cin >> e[0] >> e[1] >> e[2] >> e[3]; sort(e,e+4) if(e[0] == e[1] && e[2] == e[3]) { cout << "yes" << endl; }else { cout << "no" << endl; } }
a.cc: In function 'int main()': a.cc:8:14: error: expected ';' before 'if' 8 | sort(e,e+4) | ^ | ; 9 | if(e[0] == e[1] && e[2] == e[3]) { | ~~ a.cc:11:4: error: 'else' without a previous 'if' 11 | }else { | ^~~~
s219498018
p00340
C++
#include<sdio.h> #include<iostream> using namespace std; int main(){ int m,n,i,j,t,y; int e[5]; for(i=0;i<4;i++){ scanf("%d",&e[i]); } sort(e,e+4); if(e[0]==e[1] && e[2]==e[3]){ printf("yes\n"); } else{ printf("no\n"); } }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s117533931
p00340
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int e[4]; for(int i=0; i<4; i++) cin >> e[0]; sort(&e[0], &e[0]+4); if(e[0]==e[1] && e[2]==e[3]) cout << "yes??? << endl; else cout << "no" << endl; return 0; }
a.cc:10:42: warning: missing terminating " character 10 | if(e[0]==e[1] && e[2]==e[3]) cout << "yes??? << endl; | ^ a.cc:10:42: error: missing terminating " character 10 | if(e[0]==e[1] && e[2]==e[3]) cout << "yes??? << endl; | ^~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:11:5: error: expected primary-expression before 'else' 11 | else cout << "no" << endl; | ^~~~
s765586088
p00340
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ vector<int> e[4]; for(int i=0; i<4; i++) cin >> e[0]; sort(e, e+4); for(int i=0; i<4; i++) cout << e[i] << endl; if(e[0]==e[1] && e[2]==e[3]) cout << "yes" << endl; else cout << "no" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:32: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0; i<4; i++) cin >> e[0]; | ~~~ ^~ ~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c+
s752884697
p00340
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ vector<int> e[4]; for(int i=0; i<4; i++) cin >> e[0]; sort(e.begin(), e.end()); for(int i=0; i<4; i++) cout << e[i] << endl; if(e[0]==e[1] && e[2]==e[3]) cout << "yes" << endl; else cout << "no" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:32: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0; i<4; i++) cin >> e[0]; | ~~~ ^~ ~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c+
s509545831
p00340
C++
#include <stdio.h> #include <algorithm> using namespace std; int main(void) { int a[4], i; for(i = 0; i < n; ++i)scanf("%d", &a[i]); sort(a, a + 4); if(a[0] == a[1] && a[2] == a[3]) printf("yes\n"); else printf("no\n"); return 0; }
a.cc: In function 'int main()': a.cc:7:18: error: 'n' was not declared in this scope 7 | for(i = 0; i < n; ++i)scanf("%d", &a[i]); | ^
s961223679
p00340
C++
#include <iostream> #include <math.h> using namespace std; int main () { int a[4]; for (int i = 0; i < 4; i++) { cin >> a[i]; } sort (a,a + 4); if (a[0] == a[1] && a[2] == a[3]) { cout << "yes" << endl; } else { cout << "no" << endl; } }
a.cc: In function 'int main()': a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 14 | sort (a,a + 4); | ^~~~ | sqrt
s463007997
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if((a==b && c==d) || (a==c &&b==d) || (a==d &&c==b) || (a==b==c==d) ) cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; } ~
a.cc:15:2: error: expected class-name at end of input 15 | ~ | ^
s381259873
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if((a==b && c==d) || (a==c &&b==d) || (a==d &&c==b) || (a==b==c==d) ) cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; } ~
a.cc:15:2: error: expected class-name at end of input 15 | ~ | ^
s023677021
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int e1,e2,e3,e4; cin>>e1>>e2>>e3>>e4; if(e1==e2||e1==e3||e1==e4){ cout<<yes<<endl; } else { cout<<no<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'yes' was not declared in this scope 9 | cout<<yes<<endl; | ^~~ a.cc:11:14: error: 'no' was not declared in this scope 11 | cout<<no<<endl; | ^~ a.cc:13:2: error: expected '}' at end of input 13 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s011776994
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int e1,e2,e3,e4; cin>>e1>>e2>>e3>>e4; if(e1==e2||e1==e3||e1==e4){ cout<<yes<<endl; } else if (e2==e3||e2==e4){ cout<<yes<<endl; } else if (e3==e4){ cout<<yes<<endl; } else { cout<<no<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'yes' was not declared in this scope 9 | cout<<yes<<endl; | ^~~ a.cc:11:14: error: 'yes' was not declared in this scope 11 | cout<<yes<<endl; | ^~~ a.cc:13:14: error: 'yes' was not declared in this scope 13 | cout<<yes<<endl; | ^~~ a.cc:15:14: error: 'no' was not declared in this scope 15 | cout<<no<<endl; | ^~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s962014220
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int e1,e2,e3,e4; cin>>e1>>e2>>e3>>e4; if(e1==e2||e1==e3||e1==e4){ cout<<yes<<endl; } else if (e2==e3||e2==e4){ cout<<yes<<endl; } else if (e3==e4){ cout<<yes<<endl; } else { cout<<no<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'yes' was not declared in this scope 9 | cout<<yes<<endl; | ^~~ a.cc:11:14: error: 'yes' was not declared in this scope 11 | cout<<yes<<endl; | ^~~ a.cc:13:14: error: 'yes' was not declared in this scope 13 | cout<<yes<<endl; | ^~~ a.cc:15:14: error: 'no' was not declared in this scope 15 | cout<<no<<endl; | ^~
s794194622
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int e1,e2,e3,e4; cin>>e1>>e2>>e3>>e4; if(e1==e2&&e3==e4){ cout<<yes<<endl; } else if (e2==e3&&e1==e4){ cout<<yes<<endl; } else if (e1==e3&&e2==e4){ cout<<yes<<endl; } else { cout<<no<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'yes' was not declared in this scope 9 | cout<<yes<<endl; | ^~~ a.cc:11:14: error: 'yes' was not declared in this scope 11 | cout<<yes<<endl; | ^~~ a.cc:13:14: error: 'yes' was not declared in this scope 13 | cout<<yes<<endl; | ^~~ a.cc:15:14: error: 'no' was not declared in this scope 15 | cout<<no<<endl; | ^~
s283394606
p00340
C++
#include<bits/stdc++.h> using namespace std; int main(){ int e1,e2,e3,e4; cin>>e1>>e2>>e3>>e4; if(e1==e2&&e3==e4){ cout<<"yes"<<endl; } else if (e2==e3&&e1==e4){ cout<<"yes"<<endl; } else if (e1==e3&&e2==e4){ cout<<"yes"<<endl; } else { cout<<"no<"<endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:19: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 15 | cout<<"no<"<endl; | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:15:20: note: couldn't deduce template parameter '_Bi_iter' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:15:20: note: couldn't deduce template parameter '_Bi_iter' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | cout<<"no<"<endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 15 | cout<<"no<"<endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 15 | cout<<"no<"<endl; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:15:20: note: couldn't deduce template parameter '_CharT' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:15:20: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | cout<<"no<"<endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/
s095512095
p00341
C++
using System; using System.Linq; public class Test { public static void Main() { int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(a); if(a[0] == a[1] && a[1] == a[2] && a[2] == a[3] && a[4] == a[5] && a[5] == a[6] && a[6] == a[7] && a[8] == a[9] && a[9] == a[10] && a[10] == a[11]) Console.WriteLine("yes"); else Console.WriteLine("no"); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Test | ^~~~~~
s162261038
p00341
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int a[12]; for(int i=0;i<12;i++){ cin>>a[i]; } sort(a,a+12); if(a[0]==a[3]&&a[4]==a[7]&&a[8]==a[11])cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 22 | sort(a,a+12); | ^~~~ | sqrt
s643968421
p00341
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int a[12]; for(int i=0;i<12;i++){ cin>>a[i]; } sort(a,a+12); if(a[0]==a[3]&&a[4]==a[7]&&a[8]==a[11])cout<<"yes"<<endl; else cout<<"no"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 22 | sort(a,a+12); | ^~~~ | sqrt
s057133245
p00341
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int a[12]; for(int i=0;i<12;i++){ cin>>a[i]; } sort(a,a+12); if(a[0]==a[3]&&a[4]==a[7]&&a[8]==a[11]){ cout<<"yes"<<endl; } else cout<<"no"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 21 | sort(a,a+12); | ^~~~ | sqrt
s641214804
p00341
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int a[12]; for(int i=0;i<12;i++){ cin>>a[i]; } sort(a,a+12,greater<int>()); if(a[0]==a[3]&&a[4]==a[7]&&a[8]==a[11]){ cout<<"yes"<<endl; } else cout<<"no"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 21 | sort(a,a+12,greater<int>()); | ^~~~ | sqrt
s929633097
p00341
C++
#include <bits/stdc++.h> using namespace std; int e[12]; int main() { cin >> e[0] >> e[1] >> e[2] >> e[3] >> e[4] >> e[5] >> e[6 >> e[7] >> e[8] >> e[9] >> e[10] >> e[11] >> e[12]; sort(e,e+12); if(e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; } else { cout << "no" <<endl; } }
a.cc: In function 'int main()': a.cc:9:20: error: expected ']' before ';' token 9 | >> e[11] >> e[12]; | ^ | ]
s518801196
p00341
C++
#include <bits/stdc++.h> using namespace std; int e[12]; int main() { cin >> e[0] >> e[1] >> e[2] >> e[3] >> e[4] >> e[5] >> e[6 >> e[7] >> e[8] >> e[9] >> e[10] >> e[11]; sort(e,e+12); if(e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; } else { cout << "no" <<endl; } }
a.cc: In function 'int main()': a.cc:8:59: error: expected ']' before ';' token 8 | >> e[5] >> e[6 >> e[7] >> e[8] >> e[9] >> e[10] >> e[11]; | ^ | ]
s657097935
p00341
C++
#include <bits/stdc++.h> using namespace std; int e[12]; int main() { cin >> e[0] >> e[1] >> e[2] >> e[3] >> e[4] >> e[5] >> e[6 >> e[7] >> e[8] >> e[9] >> e[10] >> e[11]; sort(e,e+12); if(e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; } else { cout << "no" <<endl; } }
a.cc: In function 'int main()': a.cc:7:103: error: expected ']' before ';' token 7 | cin >> e[0] >> e[1] >> e[2] >> e[3] >> e[4] >> e[5] >> e[6 >> e[7] >> e[8] >> e[9] >> e[10] >> e[11]; | ^ | ]
s011175314
p00341
C++
#include <bits/stdc++.h> using namespace std; int a = 12; int e[12]; int main() { for(int b = 0; b < a; ++ b) { cin >> e[b]; } sort(a,a+12); if (e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11] == e[12]) { cout << "yes" << endl; } else { cout << "no" << endl; } }
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:61, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int') 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int') 1782 | *__first = _GLIBCXX_MOVE(__val); | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:71: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algo.h:61: /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 344 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 346 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1596 | std::__pop_heap(__first, __middle, __i, __comp); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 258 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 260 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int') 262 | _ValueType __value = _GLIBCXX_MOVE(*__result); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int') 263 | *__result = _GLIBCXX_MOVE(*__first); | ^~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:19: error: invalid type argument of unary '*' (have 'int')
s048938731
p00341
C++
#include <bits/stdc++.h> using namespace std; int a = 12; int b = 0; int e[12]; int main() { for(; b < a; ++ b) { cin >> e[b]; } sort(a,a+12); if (e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11] == e[12]) { cout << "yes" << endl; } else { cout << "no" << endl; } }
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:12:7: required from here 12 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:61, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int') 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int') 1782 | *__first = _GLIBCXX_MOVE(__val); | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:71: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:12:7: required from here 12 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algo.h:61: /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:12:7: required from here 12 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 344 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 346 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1596 | std::__pop_heap(__first, __middle, __i, __comp); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:12:7: required from here 12 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 258 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 260 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int') 262 | _ValueType __value = _GLIBCXX_MOVE(*__result); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int') 263 | *__result = _GLIBCXX_MOVE(*__first); | ^~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:19: error: invalid type argument of unary '*' (have 'int')
s774000079
p00341
C++
#include <bits/stdc++.h> using namespace std; int a = 0; int e[12]; int main() { for(; a < 12; ++ a) { cin >> e[b]; } sort(a,a+12); if (e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; } else { cout << "no" << endl; } }
a.cc: In function 'int main()': a.cc:9:14: error: 'b' was not declared in this scope 9 | cin >> e[b]; | ^ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:61, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int') 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int') 1782 | *__first = _GLIBCXX_MOVE(__val); | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:71: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algo.h:61: /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 344 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 346 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1596 | std::__pop_heap(__first, __middle, __i, __comp); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 258 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 260 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int') 262 | _ValueType __value = _GLIBCXX_MOVE(*__result); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int') 263 | *__result = _GLIBCXX_MOVE(*__
s358941081
p00341
C++
#include <bits/stdc++.h> using namespace std; int a = 0; int e[12]; int main() { for(; a < 12; ++ a) { cin >> e[a]; } sort(a,a+12); if (e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; } else { cout << "no" << endl; } }
In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:61, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int') 1780 | __val = _GLIBCXX_MOVE(*__i); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int') 1782 | *__first = _GLIBCXX_MOVE(__val); | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:71: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]': /usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1777 | if (__comp(__i, __first)) | ~~~~~~^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1908 | std::__final_insertion_sort(__first, __last, __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ /usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int') 45 | { return *__it1 < *__it2; } | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algo.h:61: /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1593 | std::__make_heap(__first, __middle, __comp); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 344 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 346 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1596 | std::__pop_heap(__first, __middle, __i, __comp); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1868 | std::__heap_select(__first, __middle, __last, __comp); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1884 | std::__partial_sort(__first, __last, __last, __comp); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' 1905 | std::__introsort_loop(__first, __last, | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 1906 | std::__lg(__last - __first) * 2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1907 | __comp); | ~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]' 4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter()); | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:11:7: required from here 11 | sort(a,a+12); | ~~~~^~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>' 258 | _ValueType; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>' 260 | _DistanceType; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int') 262 | _ValueType __value = _GLIBCXX_MOVE(*__result); | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int') 263 | *__result = _GLIBCXX_MOVE(*__first); | ^~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:263:19: error: invalid type argument of unary '*' (have 'int')
s661321001
p00341
C++
#include<sdio.h> #include<iostream> using namespace std; int main(){ int m,n,i,j,t,y; int e[15]; for(i=0;i<4;i++){ scanf("%d",&e[i]); } sort(e,e+12); if(e[0]==e[1] && e[2]==e[3] && e[5]==e[6] && e[7]==e[8] && e[9]==e[10] && e[11] && e[12]){ printf("yes\n"); } else{ printf("no\n"); } }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s106931593
p00341
C++
#include<sdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n,i,j,t,y; int e[15]; for(i=0;i<4;i++){ scanf("%d",&e[i]); } sort(e,e+12); if(e[0]==e[1] && e[2]==e[3] && e[5]==e[6] && e[7]==e[8] && e[9]==e[10] && e[11] && e[12]){ printf("yes\n"); } else{ printf("no\n"); } }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s401122186
p00341
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a[12]; int i,j; int cut=0; int b[3]={1,5,9}; for(i=0;i<12;i++){ cin>>a[i]; } for(i=0;i<12;i++){ for(j=11;j>i;j--){ if(a[i]>a[j]){ swap(a[i],a[j]); } } } for(i=0;i=3;i++){ for(j=b[i];j<b[i]+2){ if(b[i]==a[j]){ cut++; } } } if(cut==12){ cout<<"yes"<<endl; } else{ cout<<"no"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:36: error: expected ';' before ')' token 20 | for(j=b[i];j<b[i]+2){ | ^ | ;
s765910877
p00341
C++
#include <bits/stdc++.h> using namespace std; int main() { int e[12]; for(int a = 0; a < 12; +;a) { cin >> e[a]; } sort(e,e+12); if(e[0] == e[1] == e[2] == e[3] && e[4] == e[5] == e[6] == e[7] && e[8] == e[9] == e[10] == e[11]) { cout << "yes" << endl; }else { cout << "no" << endl; } }
a.cc: In function 'int main()': a.cc:6:29: error: expected primary-expression before ';' token 6 | for(int a = 0; a < 12; +;a) { | ^ a.cc:6:29: error: expected ')' before ';' token 6 | for(int a = 0; a < 12; +;a) { | ~ ^ | ) a.cc:6:30: error: 'a' was not declared in this scope 6 | for(int a = 0; a < 12; +;a) { | ^
s976935044
p00341
C++
#include <iostream> #include <math.h> #include <cmath> #include <stdio.h> #include <string> #include <string.h> using namespace std; int main (void) { int a[12]; for (int i = 0; i < 12; i++) { cin >> a[i]; } sort (a,a + 12); int ng = 0,p = 0; for (int j = 0; j < 3; j++) { for (int i = j + (3 * j); i < j + (3 * j) + 3; i++) { if (a[i] != a[i + 1]) { ng += 1; p += 1; break; } } if (p == 1) { break; } } if (ng != 0) { cout << "no" << endl; } else { cout << "yes" << endl; } }
a.cc: In function 'int main()': a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 18 | sort (a,a + 12); | ^~~~ | sqrt
s056850220
p00342
C
/* AOJ #0347 title: @kankichi573 */ #include <stdio.h> #include <stdlib.h> #include <float.h> double max(double x,double y) { if(x>y) return(x); else return(y); } int n,ar[1000]; int comp( const void * a , const void * b ) { if( *( int * )a < *( int * )b ) { return -1; } else if( *( int * )a == *( int * )b ) { return 0; } return 1; } int main() { int i,m2; double ret; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&ar[i]); qsort(ar,n,sizeof(int),comp); ret=0.0; m2=ar[n-2]+ar[n-1]; #ifdef DEBUG for(i=0;i<n;i++) printf("%d ",ar[i]); printf("\n"); printf("m2=%d \n",m2); #endifh for(i=0;i<n-2;i++) ret=max(ret,(double)m2/(ar[i+1]-ar[i])); ret=max(ret,(ar[n-1]+ar[n-4])/(ar[n-2]-ar[n-3])); ret=max(ret,(ar[n-3]+ar[n-4])/(ar[n-2]-ar[n-1])); printf("%.5lf\n",ret); return(0); }
main.c: In function 'main': main.c:42: error: unterminated #ifdef 42 | #ifdef DEBUG main.c:41:3: error: expected declaration or statement at end of input 41 | m2=ar[n-2]+ar[n-1]; | ^~
s801147252
p00342
C++
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var arr=input.trim().split("\n"); arr.shift(); var a = arr.shift().split(" ").map(Number); a.sort(function(a,b){ return b-a; }); var s = []; a.reduce(function(a,b){ s.push([a-b,a,b]); return b; }); var max = 0; a.reduce(function(a,b){ s.forEach(function(v){ if(v[1] != a && v[2] != b && v[1] != b && v[2] != a){ max = Math.max(max, (a+b)/v[0]).toFixed(6); } }); return b; }); console.log(max);
a.cc:1:21: warning: multi-character character constant [-Wmultichar] 1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8'); | ^~~~ a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8'); | ^~~~~~~~~~~~ a.cc:1:54: warning: multi-character character constant [-Wmultichar] 1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8'); | ^~~~~~ a.cc:1:1: error: 'var' does not name a type 1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8'); | ^~~ a.cc:2:1: error: 'var' does not name a type 2 | var arr=input.trim().split("\n"); | ^~~ a.cc:3:1: error: 'arr' does not name a type 3 | arr.shift(); | ^~~ a.cc:4:1: error: 'var' does not name a type 4 | var a = arr.shift().split(" ").map(Number); | ^~~ a.cc:5:1: error: 'a' does not name a type 5 | a.sort(function(a,b){ | ^ a.cc:7:2: error: expected unqualified-id before ')' token 7 | }); | ^ a.cc:8:1: error: 'var' does not name a type 8 | var s = []; | ^~~ a.cc:9:1: error: 'a' does not name a type 9 | a.reduce(function(a,b){ | ^ a.cc:12:2: error: expected unqualified-id before ')' token 12 | }); | ^ a.cc:13:1: error: 'var' does not name a type 13 | var max = 0; | ^~~ a.cc:14:1: error: 'a' does not name a type 14 | a.reduce(function(a,b){ | ^ a.cc:21:2: error: expected unqualified-id before ')' token 21 | }); | ^ a.cc:22:1: error: 'console' does not name a type; did you mean 'const'? 22 | console.log(max); | ^~~~~~~ | const
s899079415
p00342
C++
using System; using System.Linq; public class Test { public static void Main() { int n = int.Parse(Console.ReadLine()); int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(a); double ret = 0.0; for(int i = 0; i < n - 1; i++) { for(int j = i + 2; j < n - 1; j++) { double c1 = 1.0 * (a[j + 1] + a[j]) / (a[i + 1] - a[i]); double c2 = 1.0 * (a[i + 1] + a[i]) / (a[j + 1] - a[j]); ret = Math.Max(ret, c1); ret = Math.Max(ret, c2); } } Console.WriteLine(ret); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Test | ^~~~~~
s533272839
p00342
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int n; cin >> n; long long a[1000]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); long long b = 1000000000; for (int i = 1; i < n-2; i++) { if (a[i] - a[i - 1] < b) b = a[i] - a[i - 1]; } long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); cout << d << endl; }
a.cc: In function 'int main()': a.cc:14:9: error: 'long' specified with 'float' 14 | long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); | ^~~~
s843162294
p00342
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int n; cin >> n; long long a[1000]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); long long b = 1000000000; for (int i = 1; i < n-2; i++) { if (a[i] - a[i - 1] < b) b = a[i] - a[i - 1]; } long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); cout << d << endl; }
a.cc: In function 'int main()': a.cc:14:9: error: 'long' specified with 'float' 14 | long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); | ^~~~
s616363908
p00342
C++
#include<iostream> #include<algorithm> #include<cstdio> #include <iomanip> using namespace std; int main() { while (true) { int n; cin >> n; long float a[1000]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); long long b = 1000000000; for (int i = 1; i < n - 2; i++) { if (a[i] - a[i - 1] < b) b = a[i] - a[i - 1]; } long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); printf("%Lf\n", d); } }
a.cc: In function 'int main()': a.cc:10:17: error: 'long' specified with 'float' 10 | long float a[1000]; | ^~~~ a.cc:17:17: error: 'long' specified with 'float' 17 | long float d = max(max((a[n - 1] + a[n - 2]) / (b), ((a[n - 1] + a[n - 4]) / (a[n - 2] - a[n - 3]))), (a[n - 3] + a[n - 4]) / (a[n - 1] - a[n - 2])); | ^~~~
s565851460
p00342
C++
#include<bits/ stdc ++.h> using namespace std ; int main(){ int n,i,j,k ; cin >>n; double a[n ], ans =0,x,y; for( i =0;i< n;i ++) cin >>a[ i ]; sort( a,a+n ); for( i =0;i< n;i ++){ for(j=i+1;j< n;j ++){ k=n - 1; while(k== i ||k==j) k -- ; x=a[k];k -- ; while(k== i ||k==j) k -- ; y=a[k]; ans =max( ans ,( x+y )/(a[j] - a[ i ])); } } printf ("%6lf \ n", ans ); return 0; }
a.cc:1:15: error: missing terminating > character 1 | #include<bits/ | ^ a.cc:1:9: fatal error: bits/: No such file or directory 1 | #include<bits/ | ^ compilation terminated.
s676069709
p00342
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(),(a).end() #define PII pair<int,int> #define VS vector<string> #define VI vector<int> #define ll long long #define ull unsigned long long #define FST first #define SEC second int main(){ int n; cin>>n; VI V(n); REP(i,n)cin>>V[i]; sort(ALL(V)); int mi=1e9; REP(i,n-3){ mi=min(mi,V[i+1]-V[i]); } double ans=(double)(V[n-1]+V[n-2])/(double)mi; double d=(double)(V[n-3]+V[n-4])/(double)(V[n-1]-V[n-2]); ans=max(ans,d); double d=(double)(V[n-1]+V[n-4])/(double)(V[n-2]-V[n-3]); ans=max(ans,d); cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:31:10: error: redeclaration of 'double d' 31 | double d=(double)(V[n-1]+V[n-4])/(double)(V[n-2]-V[n-3]); | ^ a.cc:29:10: note: 'double d' previously declared here 29 | double d=(double)(V[n-3]+V[n-4])/(double)(V[n-1]-V[n-2]); | ^
s460315426
p00342
C++
#include<sdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n,a[1000],i,j; float ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n); ans=(a[n]+a[n-1])/(a[1]-a[0]); printf("%1.6f",ans); }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s740702255
p00342
C++
#include<sdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n,a[1000],i,j; float ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n); ans=(a[n]+a[n-1])/(a[1]-a[0]); printf("%1.6f",ans); }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s321392516
p00342
C++
#include<sdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int m,n,a[1000],i,j; float ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n); ans=(float)(a[n]+a[n-1])/(a[1]-a[0]); printf("%.6f",ans); }
a.cc:1:9: fatal error: sdio.h: No such file or directory 1 | #include<sdio.h> | ^~~~~~~~ compilation terminated.
s689474844
p00342
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int n; vector<int> a; multiset<int> s; double ans, ans2; int main(){ cin >> n; a.resize(n); sort(a.begin(), a.end()); for(int i=0; i<n-1; i++) s.insert(a[i+1]-a[i]); int flag; int b; for(int i=0; i<100 && b.size(); i++){ b= *(s.begin()); for(int j=0; j<n; j++){ flag =0; if(j+2<n-1 && a[j+2]-a[j+1]==b) flag+=1; if(j+1<n-1 && a[j+1]-a[j]==b) flag+=1; if(j-1 >=0 && a[j]-a[j-1]==b) flag+=1; if(flag < s.count(b)){ ans2 = a[j]+a[j+1]; ans2 /= b[i]; ans = max(ans, ans2); } } s.erase(b); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:29: error: request for member 'size' in 'b', which is of non-class type 'int' 20 | for(int i=0; i<100 && b.size(); i++){ | ^~~~ a.cc:30:26: error: invalid types 'int[int]' for array subscript 30 | ans2 /= b[i]; | ^
s896370173
p00342
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int n; vector<int> a; multiset<int> s; double ans, ans2; int main(){ cin >> n; a.resize(n); sort(a.begin(), a.end()); for(int i=0; i<n-1; i++) s.insert(a[i+1]-a[i]); int flag; int b; for(int i=0; i<100 && s.size(); i++){ b= *(s.begin()); for(int j=0; j<n; j++){ flag =0; if(j+2<n-1 && a[j+2]-a[j+1]==b) flag+=1; if(j+1<n-1 && a[j+1]-a[j]==b) flag+=1; if(j-1 >=0 && a[j]-a[j-1]==b) flag+=1; if(flag < s.count(b)){ ans2 = a[j]+a[j+1]; ans2 /= b[i]; ans = max(ans, ans2); } } s.erase(b); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:30:26: error: invalid types 'int[int]' for array subscript 30 | ans2 /= b[i]; | ^
s168573296
p00342
C++
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; int n; vector<int> a; multiset<int> s; double ans, ans2; int main(){ cin >> n; a.resize(n); sort(a.begin(), a.end()); for(int i=0; i<n-1; i++) s.insert(a[i+1]-a[i]); int flag; double b; ans=0; ans2=0; multiset<int>::iterator itr; for(int i=0; s.size(); i++){ itr = s.begin(); b = (*itr) for(int j=0; j<n; j++){ flag =0; if(j+2<n-1 && a[j+2]-a[j+1]==b) flag+=1; if(j+1<n-1 && a[j+1]-a[j]==b) flag+=1; if(j-1 >=0 && a[j]-a[j-1]==b) flag+=1; if(flag < s.count(b)){ ans2 = a[j]+a[j+1]; ans2 /= b; ans = max(ans, ans2); } } s.erase(b); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:19: error: expected ';' before 'for' 24 | b = (*itr) | ^ | ; 25 | for(int j=0; j<n; j++){ | ~~~ a.cc:25:22: error: 'j' was not declared in this scope 25 | for(int j=0; j<n; j++){ | ^
s303338419
p00343
Java
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { boolean[] used = new boolean[14]; boolean ans = false; for (int i = 0; i < 6; i++) { used[sc.nextInt()] = true; } if (used[1] == used[13]) ans=!used[1]; else { int l = 6, r = 8; boolean t=false; for (;;) { if (t && used[1]) { if (used[r]^t) r++; else if (used[l]^t) l--; } else { if (used[l]^t) l--; else if (used[r]^t) r++; } if (r == 13) { ans= !used[1]; break; } if (l == 1) { ans= used[1]; break; } t = !t; } } System.out.println(ans ? "yes" : "no"); } } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s019060611
p00343
Java
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { boolean[] used = new boolean[14]; boolean ans = false; for (int i = 0; i < 6; i++) { used[sc.nextInt()] = true; } if (used[1] == used[13]) ans=!used[1]; else { int l = 6, r = 8; boolean t=false; for (;;) { if (t == used[1]) { if (used[r]^t) r++; else if (used[l]^t) l--; } else { if (used[l]^t) l--; else if (used[r]^t) r++; } if (r == 13 || l==1) { // ans= !used[1]; ans=used[1]^r==13; break; } // if (l == 1) { // ans= used[1]; // break; // } t = !t; } } System.out.println(ans ? "yes" : "no"); } } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s084390629
p00343
C++
#include<iostream> #include <algorithm> using namespace std; int main(){ int Tc; cin>>Tc; while(Tc--){ set<int> a,b; for(int i=0;i<6;i++){ int x; cin>>x; a.insert(x); } for(int i=1;i<=13;i++) if(a.count(i)==0&&i!=7)b.insert(i); int l=6,r=8,ans; for(ans=1;;ans++){ if(a.count(l)&&a.count(r)){ if(a.count(1))a.erase(l),l--; else a.erase(r),r++; }else if(a.count(l)==1){ a.erase(l),l--; }else if(a.count(r)==1){ a.erase(r),r++; } if(a.empty())break; swap(a,b); } cout<< (ans&1?"yes":"no") <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'set' was not declared in this scope 9 | set<int> a,b; | ^~~ a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 2 | #include <algorithm> +++ |+#include <set> 3 | using namespace std; a.cc:9:13: error: expected primary-expression before 'int' 9 | set<int> a,b; | ^~~ a.cc:13:13: error: 'a' was not declared in this scope 13 | a.insert(x); | ^ a.cc:16:16: error: 'a' was not declared in this scope 16 | if(a.count(i)==0&&i!=7)b.insert(i); | ^ a.cc:16:36: error: 'b' was not declared in this scope 16 | if(a.count(i)==0&&i!=7)b.insert(i); | ^ a.cc:20:16: error: 'a' was not declared in this scope 20 | if(a.count(l)&&a.count(r)){ | ^ a.cc:29:16: error: 'a' was not declared in this scope 29 | if(a.empty())break; | ^ a.cc:30:18: error: 'a' was not declared in this scope 30 | swap(a,b); | ^ a.cc:30:20: error: 'b' was not declared in this scope 30 | swap(a,b); | ^
s182310187
p00344
C
#include<stdio.h> using namespace std; int n,i,p,c,ans=0; int a[100000]; int x[100000]; int y[100000]; int main(){ scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); x[i]=-1; y[i]=-1; } for(i=0;i<n;i++){ p=i; c=0; while(x[p]==-1){ x[p]=c++; y[p]=i; p=(p+a[p])%n; } if(y[p]==i)ans+=(c-x[p]); } printf("%d\n",ans); return 0; }
main.c:2:1: error: unknown type name 'using' 2 | using namespace std; | ^~~~~ main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 2 | using namespace std; | ^~~
s983202917
p00344
C++
#include <iostream> #include <vector> using namespace std; constexpr int MAX = 100000; int res; int num[MAX], visited[MAX]; void dfs(int v, int c, const vector<int>& a) { visited[v] = 0; num[v] = c; int to = (v + a[v]) % a.size(); if (visited[to] == -1) { dfs(to, c + 1, a); } else if(visited[to] == 0) { res += num[v] - num[to] + 1; return; } visited[v] = 1; } int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a[i]; } memset(num, -1, sizeof(num)); memset(visited, -1, sizeof(visited)); res = 0; for (int i = 0; i < N; i++) { if (visited[i] == -1) { dfs(i, 1, a); } } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:5: error: 'memset' was not declared in this scope 33 | memset(num, -1, sizeof(num)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <vector> +++ |+#include <cstring> 3 |
s554359744
p00344
C++
#include <vector> #include <iostream> using namespace std; int n, a[100009]; bool cycle[100009], vis1[100009], vis2[100009]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { vector<int> w; int p = i; while (!vis1[p]) { p = (p + a[p]) % n; if (vis2[p]) { int pos = find(w.begin(), w.end(), p) - w.begin(); for (int j = pos; j < w.size(); j++) cycle[j] = true; break; } w.push_back(p); vis2[p] = true; } for (int j : w) vis1[j] = true, vis2[j] = false; } int cnt = 0; for (int i = 0; i < n; i++) { if (cycle[i]) cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:47: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 14 | int pos = find(w.begin(), w.end(), p) - w.begin(); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~ 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:2: /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, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_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:14:47: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >' 14 | int pos = find(w.begin(), w.end(), p) - w.begin(); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~
s807968211
p00344
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> using namespace std; bool a[10000],s[10000]; int b[10000], c[10000]; signed main() { int d, sum = 0; cin >> d; for (int e = 0; e < d; e++) { scanf("%d", &b[e]); } for (int i = 0; i < d; i++) { if (!a[i]) { memset(c, 0, sizeof(c)); int now = i; while (1) { a[now] = true; if (c[now] == 2)break; else if (c[now] == 1)s[now] = true; c[now]++; now += b[now]; now %= d; } } } for (bool u : s)sum += u; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:25:25: error: 'memset' was not declared in this scope 25 | memset(c, 0, sizeof(c)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cstring> 12 | #include<unordered_map>
s276417740
p00344
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<vector> #include<queue> #include<set> #include<stack> #include<functional> #include<list> #include<map> #include<unordered_map> using namespace std; bool a[100000],s[100000]; int b[100000], c[100000]; signed main() { int d, sum = 0; cin >> d; for (int e = 0; e < d; e++) { scanf("%d", &b[e]); } for (int i = 0; i < d; i++) { if (!a[i]) { memset(c, 0, sizeof(c)); int now = i; while (1) { a[now] = true; if (c[now] == 2)break; else if (c[now] == 1)s[now] = true; c[now]++; now += b[now]; now %= d; } } } for (bool u : s)sum += u; cout << sum << endl; }
a.cc: In function 'int main()': a.cc:25:25: error: 'memset' was not declared in this scope 25 | memset(c, 0, sizeof(c)); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<map> +++ |+#include <cstring> 12 | #include<unordered_map>
s937607961
p00344
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set> #include <complex> #include <iterator> #include <array> #include <memory> #include <stack> #define vi vector<int> #define vvi vector<vector<int> > #define ll long long int #define vl vector<ll> #define vvl vector<vector<ll>> #define vb vector<bool> #define vc vector<char> #define vs vector<string> #define ld long double #define INF 1e9 #define EPS 0.0000000001 #define rep(i,n) for(int i=0;i<n;i++) #define loop(i,s,n) for(int i=s;i<n;i++) #define all(in) in.begin(), in.end() template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; } template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; } #define MAX 1e5 + 100 using namespace std; typedef pair<int, int> pii; typedef pair<double,double>pdd; typedef pair<ll,ll>pll; #define int ll vl used(MAX,0); vi v(MAX,0); class unionfind { vector<int> par, rank, size_;//テゥツ?淌・ツコツヲテ」ツ?ァテ」ツ?ッテ」ツ?ェテ」ツ?湘」ツδ。テ」ツδ「テ」ツδェテ・ツ環ケテァツ篠?」ツつ津ィツ?ε」ツ?暗」ツつ凝」ツ?ェテ」ツつ詠ankテ」ツ?ョテ」ツ?凝」ツつ湘」ツつ甘」ツ?ォsizeテ」ツつ津、ツスツソテ」ツ?? public: unionfind(int n) :par(n), rank(n), size_(n, 1) { iota(all(par), 0); } int find(int x) { if (par[x] == x)return x; return par[x] = find(par[x]); } void unite(int x, int y) { x = find(x), y = find(y); if (x == y)return; if (rank[x] < rank[y])swap(x, y); par[y] = x; size_[x] += size_[y]; if (rank[x] == rank[y])rank[x]++; } bool same(int x, int y) { return find(x) == find(y); } int size(int x) { return size_[find(x)]; } }; signed main(){ int n;cin>>n; unionfind uni(MAX); for(int i=0; i<n;i++){ cin>>v[i]; v[i]=(v[i]+i)%n; uni.unite(v[i],i); } int ans=0; vb var(MAX,true); rep(i,n){ if(var[uni.find(i)]){ var[uni.find(i)]=false; used[i]=1; while(true){ int now=v[i]; if(used[now]==0)used[now]=used[i]+1; else{ ans+=used[i]-used[now]+1; break; } i=now; } } } //rep(i,n)cout<<i<<" "<<uni.find(i)<<" "<<used[i]<<endl; cout<<ans<<endl; }
a.cc:26:21: error: template argument 1 is invalid 26 | #define vl vector<ll> | ^ a.cc:46:1: note: in expansion of macro 'vl' 46 | vl used(MAX,0); | ^~ a.cc:26:21: error: template argument 2 is invalid 26 | #define vl vector<ll> | ^ a.cc:46:1: note: in expansion of macro 'vl' 46 | vl used(MAX,0); | ^~ a.cc:46:14: error: expression list treated as compound expression in initializer [-fpermissive] 46 | vl used(MAX,0); | ^ a.cc: In function 'int main()': a.cc:87:17: error: invalid types 'int[long long int]' for array subscript 87 | used[i]=1; | ^ a.cc:91:24: error: invalid types 'int[long long int]' for array subscript 91 | if(used[now]==0)used[now]=used[i]+1; | ^ a.cc:91:37: error: invalid types 'int[long long int]' for array subscript 91 | if(used[now]==0)used[now]=used[i]+1; | ^ a.cc:91:47: error: invalid types 'int[long long int]' for array subscript 91 | if(used[now]==0)used[now]=used[i]+1; | ^ a.cc:93:30: error: invalid types 'int[long long int]' for array subscript 93 | ans+=used[i]-used[now]+1; | ^ a.cc:93:38: error: invalid types 'int[long long int]' for array subscript 93 | ans+=used[i]-used[now]+1; | ^
s928984426
p00344
C++
#include <iostream> #include <queue> using namespace std; int n, a[100000], v[100000]; int main() { cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) { if (v[i] == 0) { int t = i; queue<int> q; while (1) { if (v[t] == 1) { //????????? while (!q.empty()) { if (q.front() != t) v[q.front()] = 2; else break; q.pop(); } break; } v[t] = 1; q.push(t); (t += a[t]) %= n; } } } cout << count(v, v + n, 1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:13: error: 'count' was not declared in this scope 37 | cout << count(v, v + n, 1) << endl; | ^~~~~
s300247839
p00344
C++
#include <iostream> #include <queue> using namespace std; int n, a[100000], v[100000]; int main() { cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) { if (v[i] == 0) { int t = i; queue<int> q; while (1) { if (v[t] == 1) { //????????? while (!q.empty()) { if (q.front() != t) v[q.front()] = 2; else break; q.pop(); } break; } v[t] = 1; q.push(t); (t += a[t]) %= n; } } } cout << count(v, v + n, 1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:13: error: 'count' was not declared in this scope 37 | cout << count(v, v + n, 1) << endl; | ^~~~~
s904732772
p00344
C++
#include<iostream> using namespace std; int n; #define MAX 100005 int a[MAX], x[MAX], y[MAX]; int main() { cin >> n; for (int i = 0; i < n; i++)cin >> a[i]; memset(x, -1, sizeof(x)); memset(y, -1, sizeof(y)); int ans = 0; for (int i = 0; i < n; i++) { int p = i, c = 0; while (x[p] == -1) { x[p] = c++; y[p] = i; p = (p + a[p]) % n; } if (y[p] == i)ans += (c - x[p]); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'memset' was not declared in this scope 10 | memset(x, -1, sizeof(x)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std;
s170519371
p00344
C++
#include<iostream> using namespace std; int n; #define MAX 100005 int a[MAX], x[MAX], y[MAX]; int main() { cin >> n; for (int i = 0; i < n; i++)cin >> a[i]; memset(x, -1, sizeof(x)); memset(y, -1, sizeof(y)); int ans = 0; for (int i = 0; i < n; i++) { int p = i, c = 0; while (x[p] == -1) { x[p] = c++; y[p] = i; p = (p + a[p]) % n; } if (y[p] == i)ans += (c - x[p]); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'memset' was not declared in this scope 10 | memset(x, -1, sizeof(x)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | using namespace std;
s918061394
p00344
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m[] = new int[n],l[]=new int[n], c = 0; boolean[] t=new boolean[n]; for (int i = 0; i < n; i++) { m[i] = sc.nextInt(); } for(int i=0;i<n;i++) l[(i+m[i])%n]++; for(int i=0;i<n;i++) { int j=i; while(!t[j]&&l[j]==0) { t[j]=true; j=(j+m[j])%n; l[j]--; } } for(int i:m) c+=i>0?1:0; System.out.println(c); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ 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 { | ^~~~~~
s692992570
p00345
C++
#include <string> #include <iostream> using namespace std; int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } string s; int main() { cin >> s; string t1 = s.substr(0, s.find('.')), t2 = s.substr(s.find('.') + 1); int d1 = stoi(t1), d2 = 1; if (s.find('(') == string::npos) { d2 = t2.size(); d1 *= d2; d2 += stoi(t2); } else { string t3 = t2.substr(0, t2.find('(')), t4 = t2.substr(t2.find('(') + 1); t4.pop_back(); if (t3.size()) { d2 = t3.size(); d1 *= d2; d2 += stoi(t3); } int e1 = stoi(t4), e2 = (int)pow(10, t4.size()) - 1; d1 = d1 * e2 + d2 * e1; d2 *= e2; } int g = gcd(d1, d2); d1 /= g, d2 /= g; cout << d1 << '/' << d2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:46: error: 'pow' was not declared in this scope 23 | int e1 = stoi(t4), e2 = (int)pow(10, t4.size()) - 1; | ^~~
s548843922
p00345
C++
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> using namespace std; template <class T1> class Operators { public: template <class T2> const T1 operator+(const T2& right) const{ T1 ans = static_cast<const T1&>( *this ); ans += right; return ans; } template <class T2> const T1 operator-(const T2& right) const{ T1 ans = static_cast<const T1&>( *this ); ans -= right; return ans; } template <class T2> const T1 operator*(const T2& right) const{ T1 ans = static_cast<const T1&>( *this ); ans *= right; return ans; } template <class T2> const T1 operator/(const T2& right) const{ T1 ans = static_cast<const T1&>( *this ); ans /= right; return ans; } bool operator!=(const T1& right) const{ const T1& left = static_cast<const T1&>( *this ); return !(left == right); } }; class Fraction { private: long long n; // ?????????numerator??? long long d; // ?????????denominator??? // ?´???? void reduce(){ if(d < 0){ n *= -1; d *= -1; } long long a = abs(n); long long b = d; while(b != 0){ long long tmp = a % b; a = b; b = tmp; } n /= a; d /= a; } public: Fraction(){ n = 0; d = 1; } Fraction(long long n0){ n = n0; d = 1; } Fraction(long long n0, long long d0){ n = n0; d = d0; reduce(); } pair<long long, long long> getValue() const{ return make_pair(n, d); } Fraction& operator+=(const Fraction& f){ n = n * f.d + d * f.n; d *= f.d; reduce(); return *this; } Fraction& operator-=(const Fraction& f){ n = n * f.d - d * f.n; d *= f.d; reduce(); return *this; } Fraction& operator*=(const Fraction& f){ n *= f.n; d *= f.d; reduce(); return *this; } Fraction& operator/=(const Fraction& f){ n *= f.d; d *= f.n; reduce(); return *this; } bool operator==(const Fraction& f) const{ return n == f.n && d == f.d; } }; int main() { string s; cin >> s; int n = s.size(); int i = s.find('.'); int j = s.find('('); if(j == string::npos) j = n; string s1 = s.substr(0, i); Fraction ans(stoll(s1)); string s2 = s.substr(i+1, j-i-1); long long base = stoll('1' + string(s2.size(), '0')); if(!s2.empty()) ans += Fraction(stoll(s2), base); if(j < n){ string s3 = s.substr(j+1, n-j-2); base *= stoll(string(s3.size(), '9')); ans += Fraction(stoll(s3), base); } auto& p = ans.getValue(); cout << p.first << '/' << p.second << endl; return 0; }
a.cc: In function 'int main()': a.cc:152:27: error: cannot bind non-const lvalue reference of type 'std::pair<long long int, long long int>&' to an rvalue of type 'std::pair<long long int, long long int>' 152 | auto& p = ans.getValue(); | ~~~~~~~~~~~~^~
s886769293
p00345
C++
#include<iostream> #include<string> using namespace std; string s; int a,b,c,d,e; int main(){ cin>>s; for(int i=0;i<s.size();i++){ if(isdigit(s[i]))a=a*10+(s[i]-'0'),d*=10; else if(s[i]=='.')d++; else while(isdigit(s[++i]))b=b*10+(s[i]-'0'),c=c*10+9; } if(c)a=b+a*c,d=d*c; cout<<a/__gcd(a,d)<<'/'<<d/__gcd(a,d)<<endl; }
a.cc: In function 'int main()': a.cc:14:11: error: '__gcd' was not declared in this scope 14 | cout<<a/__gcd(a,d)<<'/'<<d/__gcd(a,d)<<endl; | ^~~~~
s866978436
p00346
C++
#include<bits/stdc++.h> using namespace std; int dist[2000];set<int>p[2000]; vector<pair<int,int>> vec[2000]; int n,m; bool used2[2000]; set<int>R[2000][2000]; int dst[2000][2000]; vector<int>shor[2000]; void dijkstra(int s){ for(int i=0;i<2000;i++){dist[i]=999999999;p[i].clear();} priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>Q; Q.push(make_pair(0,s));dist[s]=0; while(!Q.empty()){ int a1=Q.top().first,a2=Q.top().second;Q.pop(); for(int i=0;i<(int)vec[a2].size();i++){ int to=vec[a2][i].first,cost=vec[a2][i].second; if(dist[to]>a1+cost){ p[to].clear();p[to].insert(a2); dist[to]=a1+cost; Q.push(make_pair(dist[to],to)); } if(dist[to]==a1+cost && p[to].count(a2)==0){ p[to].insert(a2); } } } for(int i=0;i<2000;i++){ dst[s][i]=dist[i]; R[s][i]=p[i]; } } void solve(int s){ queue<int>Q; bool used[2000];for(int i=0;i<2000;i++)used[i]=false; for(int i=0;i<(int)shor[s].size();i++){Q.push(shor[s][i]);used[shor[s][i]]=true;} while(!Q.empty()){ int a1=Q.front();Q.pop(); for(auto a2 : R[a1]){ if(used[a2]==false){used[a2]=true;Q.push(a2);} } } for(int i=1;i<=n;i++){if(used[i]==true)used2[i]=true;} } int main(){ cin>>n>>m; for(int i=0;i<m;i++){ int a,b,c;cin>>a>>b>>c; vec[a].push_back(make_pair(b,c)); vec[b].push_back(make_pair(a,c)); } for(int i=1;i<=n;i++)dijkstra(i); int maxn=0; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ maxn=max(maxn,dst[i][j]); } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(dst[i][j]==maxn)shor[i].push_back(j); } } for(int i=1;i<=n;i++)solve(i); int num=0; for(int i=1;i<=n;i++){if(used2[i]==false)num++;} cout<<num<<endl; for(int i=1;i<=n;i++){if(used2[i]==false)cout<<i<<endl;} return 0; }
a.cc: In function 'void solve(int)': a.cc:41:32: error: no match for 'operator[]' (operand types are 'bool [2000]' and 'std::set<int>') 41 | if(used[a2]==false){used[a2]=true;Q.push(a2);} | ^ a.cc:41:49: error: no match for 'operator[]' (operand types are 'bool [2000]' and 'std::set<int>') 41 | if(used[a2]==false){used[a2]=true;Q.push(a2);} | ^ a.cc:41:65: error: no matching function for call to 'std::queue<int>::push(std::set<int>&)' 41 | if(used[a2]==false){used[a2]=true;Q.push(a2);} | ~~~~~~^~~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:1: /usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]' 283 | push(const value_type& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:283:30: note: no known conversion for argument 1 from 'std::set<int>' to 'const std::queue<int>::value_type&' {aka 'const int&'} 283 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]' 288 | push(value_type&& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:288:25: note: no known conversion for argument 1 from 'std::set<int>' to 'std::queue<int>::value_type&&' {aka 'int&&'} 288 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~
s397844702
p00346
C++
#include <bits/stdc++.h> using namespace std; #define all(v) (v).begin(), (v).end() #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++) typedef pair<int, int> P; const int inf = 1LL << 55; struct edge { int to, cost; edge(){} edge(int to, int cost):to(to), cost(cost){} }; vector< vector<edge> > graph; vector< vector<int> > mincost; void dijkstra(int s) { priority_queue<P, vector<P>, greater<P> > que; que.push(P(0, s)); mincost[s][s] = 0; while(!que.empty()) { int cost, now; tie(cost, now) = que.top(); que.pop(); if(mincost[s][now] < cost) continue; for(edge& e : graph[now]) { if(e.cost + cost < mincost[s][e.to]) { mincost[s][e.to] = e.cost + cost; que.push(P(mincost[s][e.to], e.to)); } } } //return *max_element(all(mincost[s])); } signed main() { cin.tie(0); ios_base::sync_with_stdio(0); cout << fixed << setprecision(12); int N, R; cin >> N >> R; graph.resize(N); rep(i, R) { int s, t, d; cin >> s >> t >> d; s--, t--; graph[s].emplace_back(t, d); graph[t].emplace_back(s, d); } mincost.resize(N, vector<int>(N, inf)); int maxdist = 0; rep(i, N) dijkstra(i); //maxdist = max(maxdist, dijkstra(i)); rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]); vector<P> ep; rep(i, N) reps(j, i+1, N) { if(mincost[i][j] == maxdist) ep.emplace_back(i, j); } vector<int> ans; rep(i, N) { bool flag = true; for(auto& p : ep) { int s, t; tie(s, t) = p; if(mincost[s][i] + mincost[i][t] == maxdist) flag = false; } if(flag) ans.push_back(i+1); } cout << ans.size() << endl; rep(i, ans.size()) cout << ans[i] << endl; return 0; }
a.cc:61:26: error: macro "rep" passed 3 arguments, but takes just 2 61 | rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]); | ^ a.cc:6:9: note: macro "rep" defined here 6 | #define rep(i, n) for(int i = 0; i < (int)(n); i++) | ^~~ a.cc:11:21: warning: overflow in conversion from 'long long int' to 'int' changes value from '36028797018963968' to '0' [-Woverflow] 11 | const int inf = 1LL << 55; | ~~~~^~~~~ a.cc: In function 'int main()': a.cc:61:13: error: 'rep' was not declared in this scope 61 | rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]); | ^~~
s254585810
p00346
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define mod 1e9+7 __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } struct edge {int to, cost;}; int n, r; vector<edge> g[1501]; int d[1501][1501]; map<int, int> mp; void dijkstra(int s) { priority_queue<P, vector<P>, greater<P> > que; fill(d[s], d[s] + n, 1145141919); d[s][s] = 0; que.push(P(0, s)); while(!que.empty()) { P p = que.top(); que.pop(); int v = p.second; if(d[s][v] < p.first) continue; rep(i, 0, g[v].size()) { edge e = g[v][i]; if(d[s][e.to] > d[s][v] + e.cost) { d[s][e.to] = d[s][v] + e.cost; que.push(P(d[s][e.to], e.to)); } } } } int solve(int i, int j) { while(1) { mp[j] = 1; if(j == i) break; rep(k, 0, g[j].size()) { edge e = g[j][k]; if(d[i][j] == d[i][e.to] + e.cost) { j = e.to; break; } } } } int main() { cin >> n >> r; rep(i, 0, r) { int a, b, c; cin >> a >> b >> c; edge e; e.to = b, e.cost = c; g[a].pb(e); e.to = a; g[b].pb(e); } rep(i, 1, n + 1) { dijkstra(i); } int mas = 0; rep(i, 1, n + 1) { rep(j, 1, n + 1) { mas = max(mas, d[i][j]); } } int done[1501][1501] = 0; rep(i, 1, n + 1) { rep(j, 1, n + 1) { if(!done[i][j] && mas == d[i][j]) { solve(i, j); done[j][i] = 1; } } } int count = 0; rep(i, 1, n + 1 ) { if(!mp[i]) count++; } cout << count << endl; rep(i, 1, n + 1) { if(!mp[i]) cout << i << endl; } }
a.cc: In function 'int solve(int, int)': a.cc:57:1: warning: no return statement in function returning non-void [-Wreturn-type] 57 | } | ^ a.cc: In function 'int main()': a.cc:79:26: error: array must be initialized with a brace-enclosed initializer 79 | int done[1501][1501] = 0; | ^
s768403796
p00346
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define mod 1e9+7 __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } struct edge {int to, cost;}; int n, r; vector<edge> g[1501]; int d[1501][1501]; map<int, int> mp; void dijkstra(int s) { priority_queue<P, vector<P>, greater<P> > que; fill(d[i], d[i] + n + 1, 1145141919); d[s][s] = 0; que.push(P(0, s)); while(!que.empty()) { P p = que.top(); que.pop(); int v = p.second; if(d[s][v] < p.first) continue; rep(i, 0, g[v].size()) { edge e = g[v][i]; if(d[s][e.to] > d[s][v] + e.cost) { d[s][e.to] = d[s][v] + e.cost; que.push(P(d[s][e.to], e.to)); } } } } int solve(int i, int j) { while(1) { mp[j] = 1; if(j == i) break; rep(k, 0, g[j].size()) { edge e = g[j][k]; if(d[i][j] == d[i][e.to] + e.cost) { j = e.to; break; } } } } int main() { cin >> n >> r; rep(i, 0, r) { int a, b, c; cin >> a >> b >> c; edge e; e.to = b, e.cost = c; g[a].pb(e); e.to = a; g[b].pb(e); } rep(i, 1, n + 1) { dijkstra(i); } int mas = 0; rep(i, 1, n + 1) { rep(j, 1, n + 1) { mas = max(mas, d[i][j]); } } rep(i, 1, n + 1) { rep(j, i + 1, n + 1) { if(mas == d[i][j]) solve(i, j); } } int count = 0; rep(i, 1, n + 1) { if(!mp[i]) count++; } cout << count << endl; rep(i, 1, n + 1) { if(!mp[i]) cout << i << endl; } }
a.cc: In function 'void dijkstra(int)': a.cc:27:10: error: 'i' was not declared in this scope 27 | fill(d[i], d[i] + n + 1, 1145141919); | ^ a.cc: In function 'int solve(int, int)': a.cc:57:1: warning: no return statement in function returning non-void [-Wreturn-type] 57 | } | ^
s627943075
p00346
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define rep(i, a, n) for(int i = (a); i < (n); i++) #define dep(i, a, n) for(int i = (a); i >= (n); i--) #define mod 1e9+7 __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } struct edge {int to, cost;}; int n, r; vector<edge> g[1501]; int d[1501][1501]; int mp[1501]; inline void dijkstra(int s) { priority_queue<P, vector<P>, greater<P> > que; fill(d[s], d[s] + n + 1, 1145141919); d[s][s] = 0; que.push(P(0, s)); while(!que.empty()) { P p = que.top(); que.pop(); int v = p.second; if(d[s][v] < p.first) continue; rep(i, 0, g[v].size()) { if(d[s][e.to] > d[s][v] + g[v][i].cost) { d[s][e.to] = d[s][v] + g[v][i].cost; que.push(P(d[s][e.to], g[v][i].to)); } } } } inline void solve(int i, int j) { stack<int> st; st.push(j); while(!st.empty()) { int tp = st.top(); st.pop(); mp[tp] = 1; rep(k, 0, g[tp].size()) { if(d[i][tp] == d[i][g[tp][k].to] + g[tp][k].cost && g[tp][k].to != i) { st.push(g[tp][k].to); } } } } int main() { cin >> n >> r; rep(i, 0, r) { int a, b, c; cin >> a >> b >> c; edge e; e.to = b, e.cost = c; g[a].pb(e); e.to = a; g[b].pb(e); } rep(i, 1, n + 1) { dijkstra(i); } int mas = 0; rep(i, 1, n + 1) { rep(j, 1, n + 1) { mas = max(mas, d[i][j]); } } rep(i, 1, n + 1) { rep(j, i + 1, n + 1) { if(mas == d[i][j]) { mp[i] = 1; solve(i, j); } } } int count = 0; rep(i, 1, n + 1) { if(!mp[i]) count++; } cout << count << endl; rep(i, 1, n + 1) { if(!mp[i]) cout << i << endl; } }
a.cc: In function 'void dijkstra(int)': a.cc:36:15: error: 'e' was not declared in this scope 36 | if(d[s][e.to] > d[s][v] + g[v][i].cost) { | ^
s500495110
p00346
C++
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i <= (int) b; ++i) #define ii pair <int, int> using namespace std; const int N = 1503; int n, m; vector <ii> adj[N]; void init() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("main.inp","r",stdin); freopen("main.out","w",stdout); } priority_queue <ii, vector <ii>, greater <ii> > Q; int d[N][N], Max; void dijk(int st) { d[st][st] = 0; Q.push({ 0, st }); while (Q.size()) { int u = Q.top().second, du = Q.top().first; Q.pop(); if (du != d[st][u]) continue; Max = max(Max, du); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][v] > du + w) d[st][v] = du + w, Q.push({ d[st][v], v }); } } } queue <int> dm; int vis[N]; void trace(int st) { FOR(i, 1, n) if (d[st][i] == Max) dm.push(i), vis[i] = st; while (dm.size()) { int u = dm.front(); dm.pop(); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][u] == d[st][v] + w && vis[v] < st) vis[v] = st, dm.push(v); } } } void solve() { cin >> n >> m; FOR(i, 1, m) { int u, v, w; cin >> u >> v >> w; adj[u].push_back({ w, v }), adj[v].push_back({ w, u }); } memset(d, 0x3f, sizeof d); FOR(i, 1, n) dijk(i); FOR(i, 1, n) trace(i); int dem = 0; FOR(i, 1, n) if (vis[i] == 0) ++dem; cout << dem << '\n'; FOR(i, 1, n) if (vis[i] == 0) cout << i << '\n'; } main() { init(); solve(); }
a.cc:1:26: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i <= (int) b; ++i) #define ii pair <int, int> using namespace std; const int N = 1503; int n, m; vector <ii> adj[N]; void init() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("main.inp","r",stdin); freopen("main.out","w",stdout); } priority_queue <ii, vector <ii>, greater <ii> > Q; int d[N][N], Max; void dijk(int st) { d[st][st] = 0; Q.push({ 0, st }); while (Q.size()) { int u = Q.top().second, du = Q.top().first; Q.pop(); if (du != d[st][u]) continue; Max = max(Max, du); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][v] > du + w) d[st][v] = du + w, Q.push({ d[st][v], v }); } } } queue <int> dm; int vis[N]; void trace(int st) { FOR(i, 1, n) if (d[st][i] == Max) dm.push(i), vis[i] = st; while (dm.size()) { int u = dm.front(); dm.pop(); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][u] == d[st][v] + w && vis[v] < st) vis[v] = st, dm.push(v); } } } void solve() { cin >> n >> m; FOR(i, 1, m) { int u, v, w; cin >> u >> v >> w; adj[u].push_back({ w, v }), adj[v].push_back({ w, u }); } memset(d, 0x3f, sizeof d); FOR(i, 1, n) dijk(i); FOR(i, 1, n) trace(i); int dem = 0; FOR(i, 1, n) if (vis[i] == 0) ++dem; cout << dem << '\n'; FOR(i, 1, n) if (vis[i] == 0) cout << i << '\n'; } main() { init(); solve(); } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s117126486
p00347
C++
#include <iostream> #include <stdio.h> #include <math.h>   using namespace std; const int Maxh=1000+100;   int h,w; int a[Maxh][Maxh]; int l[Maxh][Maxh],r[Maxh][Maxh]; int fl[Maxh][Maxh],fr[Maxh][Maxh],sl[Maxh][Maxh],sr[Maxh][Maxh]; int Res;   void BuildLR() {     for (int i=1; i<=h; i++)     {         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j];         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j];     } }   void BuildFSLR() {     for (int i=h; i>=1; i--)     {         for (int j=w+1; j>=0; j--)         {             fl[i][j]=sl[i+1][j]+l[i][j];             sl[i][j]=max(fl[i][j],sl[i][j+1]);             fr[i][j]=sr[i+1][j]+r[i][j];             sr[i][j]=max(fr[i][j],sr[i][j+1]);         }     } }   void Solve() {     Res=0;     int i=1, j=0;     while (true)     {         if (fr[i][j+1]==sr[i][j+1]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;         if (fl[i][j]==sl[i][j]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;     }       int S=0;     for (int i=1; i<=h; i++) S+=r[i][1];     S-=Res; Res=abs(Res-S); }   int main() {     scanf("%d%d",&w,&h);     for (int i=1; i<=h; i++)     for (int j=1; j<=w; j++) scanf("%d",&a[i][j]);       BuildLR();     BuildFSLR();     Solve();       printf("%d",Res);     return 0; }
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:7:1: error: extended character   is not valid in an identifier 7 |   | ^ a.cc:13:1: error: extended character   is not valid in an identifier 13 |   | ^ a.cc:16:1: error: extended character   is not valid in an identifier 16 |     for (int i=1; i<=h; i++) | ^ a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier 17 |     { | ^ a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier 18 |         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j]; | ^ a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier 19 |         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j]; | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:20:1: error: extended character   is not valid in an identifier 20 |     } | ^ a.cc:20:1: error: extended character   is not valid in an identifier a.cc:20:1: error: extended character   is not valid in an identifier a.cc:20:1: error: extended character   is not valid in an identifier a.cc:22:1: error: extended character   is not valid in an identifier 22 |   | ^ a.cc:25:1: error: extended character   is not valid in an identifier 25 |     for (int i=h; i>=1; i--) | ^ a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier 26 |     { | ^ a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier 27 |         for (int j=w+1; j>=0; j--) | ^ a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier 28 |         { | ^ a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier 29 |             fl[i][j]=sl[i+1][j]+l[i][j]; | ^ a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier 30 |             sl[i][j]=max(fl[i][j],sl[i][j+1]); | ^ a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier 31 |             fr[i][j]=sr[i+1][j]+r[i][j]; | ^ a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier 32 |             sr[i][j]=max(fr[i][j],sr[i][j+1]); | ^ a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier 33 |         } | ^ a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:34:1: error: extended character   is not valid in an identifier 34 |     } | ^ a.cc:34:1: error: extended character   is not valid in an identifier a.cc:34:1: error: extended character   is not valid in an identifier a.cc:34:1: error: extended character   is not valid in an identifier a.cc:36:1: error: extended character   is not valid in an identifier 36 |   | ^ a.cc:39:1: error: extended character   is not valid in an identifier 39 |     Res=0; | ^ a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier 40 |     int i=1, j=0; | ^ a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:41:1: error: extended character   is not valid in an identifier 41 |     while (true) | ^ a.cc:41:1: error: extended character   is not valid in an identifier a.cc:41:1: error: extended character   is not valid in an identifier a.cc:41:1: error: extended character   is not valid in an identifier a.cc:42:1: error: extended character   is not valid in an identifier 42 |     { | ^ a.cc:42:1: error: extended character   is not valid in an identifier a.cc:42:1: er
s864774372
p00347
C++
#include <iostream> #include <stdio.h>   using namespace std; const int Maxh=1000+100;   int h,w; int a[Maxh][Maxh]; int l[Maxh][Maxh],r[Maxh][Maxh]; int fl[Maxh][Maxh],fr[Maxh][Maxh],sl[Maxh][Maxh],sr[Maxh][Maxh]; int Res;   void BuildLR() {     for (int i=1; i<=h; i++)     {         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j];         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j];     } }   void BuildFSLR() {     for (int i=h; i>=1; i--)     {         for (int j=w+1; j>=0; j--)         {             fl[i][j]=sl[i+1][j]+l[i][j];             sl[i][j]=max(fl[i][j],sl[i][j+1]);             fr[i][j]=sr[i+1][j]+r[i][j];             sr[i][j]=max(fr[i][j],sr[i][j+1]);         }     } }   void Solve() {     Res=0;     int i=1, j=0;     while (true)     {         if (fr[i][j+1]==sr[i][j+1]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;         if (fl[i][j]==sl[i][j]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;     }       int S=0;     for (int i=1; i<=h; i++) S+=r[i][1];     S-=Res; Res=abs(Res-S); }   int main() {     scanf("%d%d",&w,&h);     for (int i=1; i<=h; i++)     for (int j=1; j<=w; j++) scanf("%d",&a[i][j]);       BuildLR();     BuildFSLR();     Solve();       printf("%d",Res);     return 0; }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:6:1: error: extended character   is not valid in an identifier 6 |   | ^ a.cc:12:1: error: extended character   is not valid in an identifier 12 |   | ^ a.cc:15:1: error: extended character   is not valid in an identifier 15 |     for (int i=1; i<=h; i++) | ^ a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier 16 |     { | ^ a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier 17 |         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j]; | ^ a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier 18 |         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j]; | ^ a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier 19 |     } | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:21:1: error: extended character   is not valid in an identifier 21 |   | ^ a.cc:24:1: error: extended character   is not valid in an identifier 24 |     for (int i=h; i>=1; i--) | ^ a.cc:24:1: error: extended character   is not valid in an identifier a.cc:24:1: error: extended character   is not valid in an identifier a.cc:24:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier 25 |     { | ^ a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier 26 |         for (int j=w+1; j>=0; j--) | ^ a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier 27 |         { | ^ a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier 28 |             fl[i][j]=sl[i+1][j]+l[i][j]; | ^ a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier 29 |             sl[i][j]=max(fl[i][j],sl[i][j+1]); | ^ a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier 30 |             fr[i][j]=sr[i+1][j]+r[i][j]; | ^ a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier 31 |             sr[i][j]=max(fr[i][j],sr[i][j+1]); | ^ a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier 32 |         } | ^ a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier 33 |     } | ^ a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:35:1: error: extended character   is not valid in an identifier 35 |   | ^ a.cc:38:1: error: extended character   is not valid in an identifier 38 |     Res=0; | ^ a.cc:38:1: error: extended character   is not valid in an identifier a.cc:38:1: error: extended character   is not valid in an identifier a.cc:38:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier 39 |     int i=1, j=0; | ^ a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier 40 |     while (true) | ^ a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:41:1: error: extended character   is not valid in an identifier 41 |     { | ^ a.cc:41:1: error: extended character   is not valid in an identifier a.cc:41:1: er
s151892643
p00347
C++
#include <iostream> #include <stdio.h>   using namespace std; const int Maxh=1000+100;   int h,w; int a[Maxh][Maxh]; int l[Maxh][Maxh],r[Maxh][Maxh]; int fl[Maxh][Maxh],fr[Maxh][Maxh],sl[Maxh][Maxh],sr[Maxh][Maxh]; int Res;   void BuildLR() {     for (int i=1; i<=h; i++)     {         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j];         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j];     } }   void BuildFSLR() {     for (int i=h; i>=1; i--)     {         for (int j=w+1; j>=0; j--)         {             fl[i][j]=sl[i+1][j]+l[i][j];             sl[i][j]=max(fl[i][j],sl[i][j+1]);             fr[i][j]=sr[i+1][j]+r[i][j];             sr[i][j]=max(fr[i][j],sr[i][j+1]);         }     } }   void Solve() {     Res=0;     int i=1, j=0;     while (true)     {         if (fr[i][j+1]==sr[i][j+1]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;         if (fl[i][j]==sl[i][j]) Res+=r[i][j+1],i++; else j++;         if ((i>h) || (j>=w)) break;     }       int S=0;     for (int i=1; i<=h; i++) S+=r[i][1];     S-=Res; Res=abs(Res-S); }   int main() {     scanf("%d%d",&w,&h);     for (int i=1; i<=h; i++)     for (int j=1; j<=w; j++) scanf("%d",&a[i][j]);       BuildLR();     BuildFSLR();     Solve();       printf("%d",Res);     return 0; }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:6:1: error: extended character   is not valid in an identifier 6 |   | ^ a.cc:12:1: error: extended character   is not valid in an identifier 12 |   | ^ a.cc:15:1: error: extended character   is not valid in an identifier 15 |     for (int i=1; i<=h; i++) | ^ a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier 16 |     { | ^ a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier 17 |         for (int j=w; j>=1; j--) r[i][j]=r[i][j+1]+a[i][j]; | ^ a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier 18 |         for (int j=1; j<=w; j++) l[i][j]=l[i][j-1]+a[i][j]; | ^ a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier 19 |     } | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:21:1: error: extended character   is not valid in an identifier 21 |   | ^ a.cc:24:1: error: extended character   is not valid in an identifier 24 |     for (int i=h; i>=1; i--) | ^ a.cc:24:1: error: extended character   is not valid in an identifier a.cc:24:1: error: extended character   is not valid in an identifier a.cc:24:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier 25 |     { | ^ a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:25:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier 26 |         for (int j=w+1; j>=0; j--) | ^ a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:26:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier 27 |         { | ^ a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:27:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier 28 |             fl[i][j]=sl[i+1][j]+l[i][j]; | ^ a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:28:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier 29 |             sl[i][j]=max(fl[i][j],sl[i][j+1]); | ^ a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:29:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier 30 |             fr[i][j]=sr[i+1][j]+r[i][j]; | ^ a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier 31 |             sr[i][j]=max(fr[i][j],sr[i][j+1]); | ^ a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier 32 |         } | ^ a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:32:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier 33 |     } | ^ a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:33:1: error: extended character   is not valid in an identifier a.cc:35:1: error: extended character   is not valid in an identifier 35 |   | ^ a.cc:38:1: error: extended character   is not valid in an identifier 38 |     Res=0; | ^ a.cc:38:1: error: extended character   is not valid in an identifier a.cc:38:1: error: extended character   is not valid in an identifier a.cc:38:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier 39 |     int i=1, j=0; | ^ a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:39:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier 40 |     while (true) | ^ a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:40:1: error: extended character   is not valid in an identifier a.cc:41:1: error: extended character   is not valid in an identifier 41 |     { | ^ a.cc:41:1: error: extended character   is not valid in an identifier a.cc:41:1: er
s567901859
p00348
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Sort { public static void main(String[] args) throws NumberFormatException, IOException { @SuppressWarnings("resource") Scanner sc = new Scanner(System.in); int num = sc.nextInt(); List<Integer> list = new LinkedList<Integer>(); InputStreamReader is = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(is); String str; if((str=br.readLine())!=null){ String[] sp = str.split(" "); for(int i = 0; i < num; i++){ list.add(Integer.parseInt(sp[i])); } } int cnt = 0; for(int i = 1; i < num; i++){ int temp = list.get(i - 1); if(temp > list.get(i)){ list.remove(i - 1); list.add(temp); cnt++; i = 0; } } System.out.println(cnt); } }
Main.java:8: error: class Sort is public, should be declared in a file named Sort.java public class Sort { ^ 1 error
s780438683
p00348
Java
import java.io.*; import java.util.ArrayList; import java.util.List; class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// ??\???????????????????????? String line; // ??\???????????????????????\??? int cnt = 0; int check = 0; List<Integer> numList = new ArrayList<Integer>(); int row = 0; while ((line = br.readLine()) != null) { if(cnt == 0){ cnt++; row = Integer.parseInt(line); }else{ for(int n = 0; n < row; n++){ int a = Integer.parseInt(list[n]); numList.add(a); } int count = 0; for(int j = 0; j < row; j++){ if(j + 1 >= row){ break; } int num = numList.get(j); int secondNum = numList.get(j+1); if(num > secondNum){ numList.remove(j); numList.add(num); j = -1; count++; } } System.out.println(count); cnt = 0; numList.clear(); } } } catch (Exception e) { e.printStackTrace(); } } }
Main.java:20: error: cannot find symbol int a = Integer.parseInt(list[n]); ^ symbol: variable list location: class Main 1 error
s965865209
p00348
Java
class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// ??\???????????????????????? String line; // ??\???????????????????????\??? int cnt = 0; List<Integer> numList = new ArrayList<Integer>(); int row = 0; while ((line = br.readLine()) != null) { if(cnt == 0){ cnt++; row = Integer.parseInt(line); }else{ String[] list = line.split(" ", 0); for(int n = 0; n < row; n++){ int a = Integer.parseInt(list[n]); numList.add(a); } int count = 0; for(int j = 0; j < row; j++){ if(j + 1 >= row){ break; } int num = numList.get(j); int secondNum = numList.get(j+1); if(num > secondNum){ numList.remove(j); numList.add(num); j = -1; count++; } } System.out.println(count); cnt = 0; numList.clear(); } } } catch (Exception e) { e.printStackTrace(); } }
Main.java:41: error: reached end of file while parsing } ^ 1 error
s431957804
p00348
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define MAX 3000000 int n,size; vector<int> A; unordered_map<int,int> mp; vector<ll> bit; vector<P> tree; void update(int a,int b,P x,int k=0,int l=0,int r=size){ if(b<=l || r<=a)return; if(a<=l && r<=b){ tree[k]=max(tree[k],x); }else{ int m=(l+r)/2; update(a,b,x,k*2+1,l,m); update(a,b,x,k*2+2,m,r); } } void Upd(int a,int b,P x){ if(a<b){ update(a,b+1,x); }else{ update(a,size,x); update(0,b+1,x); } } ll Get(int i){ i+=size-1; P res=tree[i]; while(i){ i=(i-1)/2; res=max(res,tree[i]); } return res.second; } void Add(int i,ll x){ i+=2; while( i<(int)bit.size() ){ bit[i]+=x; i+=(i&-i); } } ll Sum(int i){ i+=2; ll res=0; while(i>0){ res+=bit[i]; i-=(i&-i); } return res; } ll Sum(int a,int b){ if(a<b){ return Sum(b)-Sum(a-1); }else{ return Sum(n)-Sum(a-1)+Sum(b); } } ll solve(){ size=1; while( size < n+5 ) size*=2; bit.clear(); bit.resize(size); tree.clear(); tree.resize(size*2); mp.clear(); for(int i=0;i<(int)A.size();i++){ update(i,i+1,P(0,i)); Add(i,1); mp[ A[i] ]=i; } int p=-1; ll res=0; for(int i=1;i+1<=n;i++){ int num=mp[i]; int target=Get(num); Add(num,-1); res+=Sum(p,target); /* for(int j=0;j<n;j++){ if(A[j]<i)cout<<'-'; else cout<<A[j]; cout<<' '; } cout<<endl; for(int j=0;j<n;j++)cout<<Get(j)<<' ';cout<<endl; cout<<i<<" p="<<p<<" target="<<target<<" res="<<res<<endl; cout<<endl; */ Upd(p,target,P(i,target)); p=target; } return res; } int main(){ while(cin>>n&&n){ A.clear(); A.resize(n); for(int i=0;i<n;i++)cin>>A[i]; cout<<solve()<<endl; } return 0; }
a.cc:12:51: error: reference to 'size' is ambiguous 12 | void update(int a,int b,P x,int k=0,int l=0,int r=size){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'void Upd(int, int, P)': a.cc:26:14: error: reference to 'size' is ambiguous 26 | update(a,size,x); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll Get(int)': a.cc:32:6: error: reference to 'size' is ambiguous 32 | i+=size-1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll solve()': a.cc:68:3: error: reference to 'size' is ambiguous 68 | size=1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:69:10: error: reference to 'size' is ambiguous 69 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:69:23: error: reference to 'size' is ambiguous 69 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:71:14: error: reference to 'size' is ambiguous 71 | bit.resize(size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:73:15: error: reference to 'size' is ambiguous 73 | tree.resize(size*2); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~
s669027779
p00348
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define MAX 3000000 int n,size; vector<int> A; unordered_map<int,int> mp; vector<ll> bit; vector<P> tree; void update(int a,int b,P x,int k,int l,int r){ if(b<=l || r<=a)return; if(a<=l && r<=b){ tree[k]=max(tree[k],x); }else{ int m=(l+r)/2; update(a,b,x,k*2+1,l,m); update(a,b,x,k*2+2,m,r); } } void Upd(int a,int b,P x){ a+=2; b+=2; if(a<b){ update(a,b+1,x,0,0,size); }else{ update(a,size,x,0,0,size); update(0,b+1,x,0,0,size); } } ll Get(int i){ i+=2; i+=size-1; P res=tree[i]; while(i){ i=(i-1)/2; res=max(res,tree[i]); } return res.second; } void Add(int i,ll x){ i+=2; while( i<(int)bit.size() ){ bit[i]+=x; i+=(i&-i); } } ll Sum(int i){ i+=2; ll res=0; while(i>0){ res+=bit[i]; i-=(i&-i); } return res; } ll Sum(int a,int b){ if(a<b){ return Sum(b)-Sum(a-1); }else{ return Sum(n)-Sum(a-1)+Sum(b); } } ll solve(){ size=1; while( size < n+5 ) size*=2; bit.clear(); bit.resize(size); tree.clear(); tree.resize(size*2); mp.clear(); for(int i=0;i<(int)A.size();i++){ Upd(i,i+1,P(0,i)); Add(i,1); mp[ A[i] ]=i; } int p=-1; ll res=0; for(int i=1;i+1<=n;i++){ int num=mp[i]; int target=Get(num); Add(num,-1); res+=Sum(p,target); /* for(int j=0;j<n;j++){ if(A[j]<i)cout<<'-'; else cout<<A[j]; cout<<' '; } cout<<endl; for(int j=0;j<n;j++)cout<<Get(j)<<' ';cout<<endl; cout<<i<<" p="<<p<<" target="<<target<<" res="<<res<<endl; cout<<endl; */ Upd(p,target,P(i,target)); p=target; } return res; } int main(){ while(cin>>n&&n){ A.clear(); A.resize(n); for(int i=0;i<n;i++)cin>>A[i]; cout<<solve()<<endl; } return 0; }
a.cc: In function 'void Upd(int, int, P)': a.cc:27:24: error: reference to 'size' is ambiguous 27 | update(a,b+1,x,0,0,size); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:14: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:25: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:30:24: error: reference to 'size' is ambiguous 30 | update(0,b+1,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll Get(int)': a.cc:36:6: error: reference to 'size' is ambiguous 36 | i+=size-1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll solve()': a.cc:72:3: error: reference to 'size' is ambiguous 72 | size=1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:73:10: error: reference to 'size' is ambiguous 73 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:73:23: error: reference to 'size' is ambiguous 73 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:75:14: error: reference to 'size' is ambiguous 75 | bit.resize(size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:77:15: error: reference to 'size' is ambiguous 77 | tree.resize(size*2); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~
s265086443
p00348
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define MAX 3000000 int n,size; vector<int> A; unordered_map<int,int> mp; vector<ll> bit; vector<P> tree; void update(int a,int b,P x,int k,int l,int r){ if(b<=l || r<=a)return; if(a<=l && r<=b){ tree[k]=max(tree[k],x); }else{ int m=(l+r)/2; update(a,b,x,k*2+1,l,m); update(a,b,x,k*2+2,m,r); } } void Upd(int a,int b,P x){ a+=2; b+=2; if(a<b){ update(a,b+1,x,0,0,size); }else{ update(a,size,x,0,0,size); update(0,b+1,x,0,0,size); } } ll Get(int i){ i+=2; i+=size-1; P res=tree[i]; while(i){ i=(i-1)/2; res=max(res,tree[i]); } return res.second; } void Add(int i,ll x){ i+=2; while( i<(int)bit.size() ){ bit[i]+=x; i+=(i&-i); } } ll Sum(int i){ i+=2; ll res=0; while(i>0){ res+=bit[i]; i-=(i&-i); } return res; } ll Sum(int a,int b){ if(a<b){ return Sum(b)-Sum(a-1); }else{ return Sum(n)-Sum(a-1)+Sum(b); } } ll solve(){ vector<int> X; for(int i=0;i<(int)A.size();i++) X.push_back(A[i]); sort(X.begin(),X.end()); size=1; while( size < n+5 ) size*=2; bit.clear(); bit.resize(size); tree.clear(); tree.resize(size*2); mp.clear(); for(int i=0;i<(int)A.size();i++){ A[i]= lower_bound( X.begin(), X.end(), A[i]) -X.begin() + 1; Upd(i,i+1,P(0,i)); Add(i,1); mp[ A[i] ]=i; } int p=-1; ll res=0; for(int i=1;i+1<=n;i++){ int num=mp[i]; int target=Get(num); Add(num,-1); res+=Sum(p,target); /* for(int j=0;j<n;j++){ if(A[j]<i)cout<<'-'; else cout<<A[j]; cout<<' '; } cout<<endl; for(int j=0;j<n;j++)cout<<Get(j)<<' ';cout<<endl; cout<<i<<" p="<<p<<" target="<<target<<" res="<<res<<endl; cout<<endl; */ Upd(p,target,P(i,target)); p=target; } return res; } int main(){ while(cin>>n&&n){ A.clear(); A.resize(n); for(int i=0;i<n;i++)cin>>A[i]; cout<<solve()<<endl; } return 0; }
a.cc: In function 'void Upd(int, int, P)': a.cc:27:24: error: reference to 'size' is ambiguous 27 | update(a,b+1,x,0,0,size); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:14: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:25: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:30:24: error: reference to 'size' is ambiguous 30 | update(0,b+1,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll Get(int)': a.cc:36:6: error: reference to 'size' is ambiguous 36 | i+=size-1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll solve()': a.cc:79:3: error: reference to 'size' is ambiguous 79 | size=1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:80:10: error: reference to 'size' is ambiguous 80 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:80:23: error: reference to 'size' is ambiguous 80 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:82:14: error: reference to 'size' is ambiguous 82 | bit.resize(size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:84:15: error: reference to 'size' is ambiguous 84 | tree.resize(size*2); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~
s788909080
p00348
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define MAX 300000 int n,size; vector<int> A; int mp[MAX]; vector<ll> bit; vector<P> tree; void update(int a,int b,P x,int k,int l,int r){ if(b<=l || r<=a)return; if(a<=l && r<=b){ tree[k]=max(tree[k],x); }else{ int m=(l+r)/2; update(a,b,x,k*2+1,l,m); update(a,b,x,k*2+2,m,r); } } void Upd(int a,int b,P x){ a+=2; b+=2; if(a<b){ update(a,b+1,x,0,0,size); }else{ update(a,size,x,0,0,size); update(0,b+1,x,0,0,size); } } ll Get(int i){ i+=2; i+=size-1; P res=tree[i]; while(i){ i=(i-1)/2; res=max(res,tree[i]); } return res.second; } void Add(int i,ll x){ i+=2; while( i<(int)bit.size() ){ bit[i]+=x; i+=(i&-i); } } ll Sum(int i){ i+=2; ll res=0; while(i>0){ res+=bit[i]; i-=(i&-i); } return res; } ll Sum(int a,int b){ if(a<b){ return Sum(b)-Sum(a-1); }else{ return Sum(n)-Sum(a-1)+Sum(b); } } ll solve(){ vector<int> X; for(int i=0;i<(int)A.size();i++) X.push_back(A[i]); sort(X.begin(),X.end()); size=1; while( size < n+5 ) size*=2; bit.clear(); bit.resize(size); tree.clear(); tree.resize(size*2); mp.clear(); for(int i=0;i<(int)A.size();i++){ A[i]= lower_bound( X.begin(), X.end(), A[i]) -X.begin() + 1; Upd(i,i+1,P(0,i)); Add(i,1); mp[ A[i] ]=i; } int p=-1; ll res=0; for(int i=1;i+1<=n;i++){ int num=mp[i]; int target=Get(num); Add(num,-1); res+=Sum(p,target); Upd(p,target,P(i,target)); p=target; } return res; } int main(){ scanf("%d",&n); A.clear(); A.resize(n); for(int i=0;i<n;i++)scanf("%d",&A[i]); printf("%lld\n",solve()); return 0; }
a.cc: In function 'void Upd(int, int, P)': a.cc:27:24: error: reference to 'size' is ambiguous 27 | update(a,b+1,x,0,0,size); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:14: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:29:25: error: reference to 'size' is ambiguous 29 | update(a,size,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:30:24: error: reference to 'size' is ambiguous 30 | update(0,b+1,x,0,0,size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll Get(int)': a.cc:36:6: error: reference to 'size' is ambiguous 36 | i+=size-1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc: In function 'll solve()': a.cc:79:3: error: reference to 'size' is ambiguous 79 | size=1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:80:10: error: reference to 'size' is ambiguous 80 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:80:23: error: reference to 'size' is ambiguous 80 | while( size < n+5 ) size*=2; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:82:14: error: reference to 'size' is ambiguous 82 | bit.resize(size); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:84:15: error: reference to 'size' is ambiguous 84 | tree.resize(size*2); | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:7: note: 'int size' 6 | int n,size; | ^~~~ a.cc:85:6: error: request for member 'clear' in 'mp', which is of non-class type 'int [300000]' 85 | mp.clear(); | ^~~~~
s417408149
p00350
C++
#include <bits/stdc++.h> using namespace std; const unsigned mod = 1e9 + 7; unsigned power[234567], lad[26][234567]; struct SegmentTree { vector< unsigned > hashed; vector< int > lazy; int sz; SegmentTree(int n) { sz = 1; while(sz < n) sz <<= 1; hashed.assign(2 * sz - 1, 0); lazy.assign(2 * sz - 1, -1); } void push(int k, int l, int r) { if(~lazy[k]) { hashed[k] = lad[lazy[k]][r - l]; if(k < sz - 1) { lazy[2 * k + 1] = lazy[k]; lazy[2 * k + 2] = lazy[k]; } lazy[k] = -1; } } void add(int a, int b, int x, int k, int l, int r) { push(k, l, r); if(a >= r || b <= l) return; if(a <= l && r <= b) { lazy[k] = x; push(k, l, r); } else { add(a, b, x, 2 * k + 1, l, (l + r) >> 1); add(a, b, x, 2 * k + 2, (l + r) >> 1, r); hashed[k] = hashed[2 * k + 1] * power[(r - l) >> 1] + hashed[2 * k + 2]; } } void add(int a, int b, int x) { add(a, b, x, 0, 0, sz); } pair< unsigned, int > get(int a, int b, int k, int l, int r) { push(k, l, r); if(a >= r || b <= l) return {0, 0}; if(a <= l & r <= b) return {hashed[k], r - l}; auto ll = get(a, b, 2 * k + 1, l, (l + r) >> 1); auto rr = get(a, b, 2 * k + 2, (l + r) >> 1, r); return {ll.first * power[rr.second] + rr.first, ll.second + rr.second}; } unsigned get(int a, int b) { return (get(a, b, 0, 0, sz).first); }; void set(int k, int x) { hashed[k + sz - 1] = x; } void build(int k, int l, int r) { if(l + 1 == r) return; build(2 * k + 1, l, (l + r) >> 1); build(2 * k + 2, (l + r) >> 1, r); hashed[k] = hashed[2 * k + 1] * power[(r - l) >> 1] + hashed[2 * k + 2]; } void build() { build(0, 0, sz); } }; int main() { power[0] = 1; for(int i = 0; i < 234566; i++) power[i + 1] = power[i] * mod; for(int i = 0; i < 26; i++) { const char cc = 'a' + i; for(int j = 0; j < 234566; j++) lad[i][j + 1] = lad[i][j] * mod + cc; } int N, Q; char U[234567]; scanf("%d", &N); getchar(); scanf("%s", U); SegmentTree tree(N); for(int i = 0; i < N; i++) tree.set(i, U[i] - 'a'); tree.build(); scanf("%d", &Q); while(Q--) { getchar(); scanf("%s", U); if(*U == 's') { int x, y; char z; scanf("%d %d %c", &x, &y, &z); tree.add(--x, y, z - 'a'); } else { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); --a, --c; int ok = 0, ng = min(d - c, b - a) + 1; while(ng - ok > 1) { int mid = (ok + ng) >> 1; if(tree.get(a, a + mid) == tree.get(c, c + mid)) ok = mid; else ng = mid; } if(ok == d - c && ok == b - a) { puts("e"); } else if(b - a == ok || (d - c != ok && tree.get(a + ok, a + ok + 1) < tree.idx(c + ok, c + ok + 1))) { puts("s"); } else { puts("t"); } } } }
a.cc: In function 'int main()': a.cc:130:84: error: 'struct SegmentTree' has no member named 'idx' 130 | } else if(b - a == ok || (d - c != ok && tree.get(a + ok, a + ok + 1) < tree.idx(c + ok, c + ok + 1))) { | ^~~
s392267102
p00350
C++
using namespace std; using ULL = unsigned long long; const ULL B = 100'000'007; class SegmentTree { public: SegmentTree(int n) : size_(1), pow_(1, 1) { while(size_ < n) size_ <<= 1; node_.assign(size_ << 1, 0); lazy_.assign(size_ << 1, 0); awaiting_.assign(size_ << 1, false); while(pow_.size() <= size_) pow_.emplace_back(pow_.back() * B); } ULL find(int left, int right) {return find(left, right + 1, 1, 0, size_).value;} void update(int left, int right, ULL value) {update(left, right + 1, value, 1, 0, size_);} private: struct Node {ULL value; int length;}; inline int left_child(int node) const {return node << 1;} inline int right_child(int node) const {return (node << 1) + 1;} inline ULL merge(ULL vl, ULL vr, int l) const {return vl * pow_.at(l) + vr;} inline Node merge(Node& l, Node& r) const {return {l.value * pow_.at(r.length) + r.value, l.length + r.length};} inline ULL hash(ULL v, int l) const { using Memo = pair<ULL, int>; static map<Memo, ULL> memo; auto m = Memo(v, l); if(memo.count(m)) return memo.at(m); ULL res = v; for(auto i = 1; i < l; ++i) res = res * B + v; memo.insert(make_pair(m, res)); return res; } inline void propagate(int k, int l, int r) { if(awaiting_.at(k)) { if(k < size_) lazy_.at(left_child(k)) = lazy_.at(right_child(k)) = lazy_.at(k); if(k < size_) awaiting_.at(left_child(k)) = awaiting_.at(right_child(k)) = true; node_.at(k) = hash(lazy_.at(k), r - l); lazy_.at(k) = 0; awaiting_.at(k) = false; } } Node find(int a, int b, int k, int l, int r) { propagate(k, l, r); if(b <= l || r <= a) return {0, 0}; if(a <= l && r <= b) return {node_.at(k) , r - l}; auto vl = find(a, b, left_child(k), l, (l + r) / 2); auto vr = find(a, b, right_child(k), (l + r) / 2, r); return merge(vl, vr); } ULL update(int a, int b, ULL value, int k, int l, int r) { propagate(k, l, r); if(b <= l || r <= a) return node_.at(k); if(a <= l && r <= b) {lazy_.at(k) = value; awaiting_.at(k) = true; propagate(k, l, r); return node_.at(k);} auto vl = update(a, b, value, left_child(k), l, (l + r) / 2); auto vr = update(a, b, value, right_child(k), (l + r) / 2, r); return node_.at(k) = merge(vl, vr, (r - l) / 2); } int size_; vector<ULL> node_; vector<ULL> lazy_; vector<bool> awaiting_; vector<ULL> pow_; public: void traverse() {traverse(1,0,size_);} void traverse(int k, int l, int r, int d=0) { propagate(k, l, r); if(k < size_) { traverse(right_child(k),(l+r)/2,r,d+1); for(auto i=0;i<d;++i)cout<<" "; cout<<node_.at(k)<<endl; traverse(left_child(k),l,(l+r)/2,d+1); } else { for(auto i=0;i<d;++i)cout<<" "; cout<<node_.at(k)<<endl; } } }; string compare(auto& t, int a, int b, int c, int d) { if(t.find(a, b) == t.find(c, d)) return "e"; int low = -1, high = min(b - a, d - c) + 1; while(low + 1 != high) { auto middle = (low + high) / 2; if(t.find(a, a + middle) == t.find(c, c + middle)) low = middle; else high = middle; } if(low == b - a) return "s"; if(low == d - c) return "t"; return t.find(a + high, a + high) < t.find(c + high, c + high) ? "s" : "t"; } int main() { int N; string U; int Q; cin >> N >> U >> Q; SegmentTree segtree(N); for(auto i = 0; i < N; ++i) segtree.update(i, i, U[i]); // segtree.traverse(); for(auto i = 0; i < Q; ++i) { string s; cin >> s; if(s == "set") { int x, y; char z; cin >> x >> y >> z; --x; --y; segtree.update(x, y, z); } else { int a, b, c, d; cin >> a >> b >> c >> d; --a; --b; --c; --d; cout << compare(segtree, a, b, c, d) << endl; } } }
a.cc:59:3: error: 'vector' does not name a type 59 | vector<ULL> node_; | ^~~~~~ a.cc:60:3: error: 'vector' does not name a type 60 | vector<ULL> lazy_; | ^~~~~~ a.cc:61:3: error: 'vector' does not name a type 61 | vector<bool> awaiting_; | ^~~~~~ a.cc:62:3: error: 'vector' does not name a type 62 | vector<ULL> pow_; | ^~~~~~ a.cc: In constructor 'SegmentTree::SegmentTree(int)': a.cc:8:34: error: class 'SegmentTree' does not have any field named 'pow_' 8 | SegmentTree(int n) : size_(1), pow_(1, 1) { | ^~~~ a.cc:10:5: error: 'node_' was not declared in this scope 10 | node_.assign(size_ << 1, 0); | ^~~~~ a.cc:11:5: error: 'lazy_' was not declared in this scope 11 | lazy_.assign(size_ << 1, 0); | ^~~~~ a.cc:12:5: error: 'awaiting_' was not declared in this scope 12 | awaiting_.assign(size_ << 1, false); | ^~~~~~~~~ a.cc:13:11: error: 'pow_' was not declared in this scope 13 | while(pow_.size() <= size_) pow_.emplace_back(pow_.back() * B); | ^~~~ a.cc: In member function 'ULL SegmentTree::merge(ULL, ULL, int) const': a.cc:21:62: error: 'pow_' was not declared in this scope 21 | inline ULL merge(ULL vl, ULL vr, int l) const {return vl * pow_.at(l) + vr;} | ^~~~ a.cc: In member function 'SegmentTree::Node SegmentTree::merge(Node&, Node&) const': a.cc:22:64: error: 'pow_' was not declared in this scope 22 | inline Node merge(Node& l, Node& r) const {return {l.value * pow_.at(r.length) + r.value, l.length + r.length};} | ^~~~ a.cc:22:112: error: could not convert '{<expression error>, (l.SegmentTree::Node::length + r.SegmentTree::Node::length)}' from '<brace-enclosed initializer list>' to 'SegmentTree::Node' 22 | inline Node merge(Node& l, Node& r) const {return {l.value * pow_.at(r.length) + r.value, l.length + r.length};} | ^ | | | <brace-enclosed initializer list> a.cc: In member function 'ULL SegmentTree::hash(ULL, int) const': a.cc:24:18: error: 'pair' does not name a type 24 | using Memo = pair<ULL, int>; | ^~~~ a.cc:25:12: error: 'map' does not name a type 25 | static map<Memo, ULL> memo; | ^~~ a.cc:26:14: error: 'Memo' was not declared in this scope 26 | auto m = Memo(v, l); | ^~~~ a.cc:27:8: error: 'memo' was not declared in this scope 27 | if(memo.count(m)) return memo.at(m); | ^~~~ a.cc:30:5: error: 'memo' was not declared in this scope 30 | memo.insert(make_pair(m, res)); | ^~~~ a.cc:30:17: error: 'make_pair' was not declared in this scope 30 | memo.insert(make_pair(m, res)); | ^~~~~~~~~ a.cc:1:1: note: 'std::make_pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>' +++ |+#include <utility> 1 | using namespace std; a.cc: In member function 'void SegmentTree::propagate(int, int, int)': a.cc:34:8: error: 'awaiting_' was not declared in this scope 34 | if(awaiting_.at(k)) { | ^~~~~~~~~ a.cc:35:21: error: 'lazy_' was not declared in this scope 35 | if(k < size_) lazy_.at(left_child(k)) = lazy_.at(right_child(k)) = lazy_.at(k); | ^~~~~ a.cc:37:7: error: 'node_' was not declared in this scope 37 | node_.at(k) = hash(lazy_.at(k), r - l); | ^~~~~ a.cc:37:26: error: 'lazy_' was not declared in this scope 37 | node_.at(k) = hash(lazy_.at(k), r - l); | ^~~~~ a.cc: In member function 'SegmentTree::Node SegmentTree::find(int, int, int, int, int)': a.cc:45:34: error: 'node_' was not declared in this scope 45 | if(a <= l && r <= b) return {node_.at(k) , r - l}; | ^~~~~ a.cc:45:53: error: could not convert '{<expression error>, (r - l)}' from '<brace-enclosed initializer list>' to 'SegmentTree::Node' 45 | if(a <= l && r <= b) return {node_.at(k) , r - l}; | ^ | | | <brace-enclosed initializer list> a.cc: In member function 'ULL SegmentTree::update(int, int, ULL, int, int, int)': a.cc:52:33: error: 'node_' was not declared in this scope 52 | if(b <= l || r <= a) return node_.at(k); | ^~~~~ a.cc:53:27: error: 'lazy_' was not declared in this scope 53 | if(a <= l && r <= b) {lazy_.at(k) = value; awaiting_.at(k) = true; propagate(k, l, r); return node_.at(k);} | ^~~~~ a.cc:53:48: error: 'awaiting_' was not declared in this scope 53 | if(a <= l && r <= b) {lazy_.at(k) = value; awaiting_.at(k) = true; propagate(k, l, r); return node_.at(k);} | ^~~~~~~~~ a.cc:53:99: error: 'node_' was not declared in this scope 53 | if(a <= l && r <= b) {lazy_.at(k) = value; awaiting_.at(k) = true; propagate(k, l, r); return node_.at(k);} | ^~~~~ a.cc:56:12: error: 'node_' was not declared in this scope 56 | return node_.at(k) = merge(vl, vr, (r - l) / 2); | ^~~~~ a.cc: In member function 'void SegmentTree::traverse(int, int, int, int)': a.cc:69:28: error: 'cout' was not declared in this scope 69 | for(auto i=0;i<d;++i)cout<<" "; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:70:7: error: 'cout' was not declared in this scope 70 | cout<<node_.at(k)<<endl; | ^~~~ a.cc:70:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:70:13: error: 'node_' was not declared in this scope 70 | cout<<node_.at(k)<<endl; | ^~~~~ a.cc:70:26: error: 'endl' was not declared in this scope 70 | cout<<node_.at(k)<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:73:28: error: 'cout' was not declared in this scope 73 | for(auto i=0;i<d;++i)cout<<" "; | ^~~~ a.cc:73:28: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:74:7: error: 'cout' was not declared in this scope 74 | cout<<node_.at(k)<<endl; | ^~~~ a.cc:74:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:74:13: error: 'node_' was not declared in this scope 74 | cout<<node_.at(k)<<endl; | ^~~~~ a.cc:74:26: error: 'endl' was not declared in this scope 74 | cout<<node_.at(k)<<endl; | ^~~~ a.cc:74:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc: At global scope: a.cc:79:1: error: 'string' does not name a type 79 | string compare(auto& t, int a, int b, int c, int d) { | ^~~~~~ a.cc: In function 'int main()': a.cc:94:3: error: 'string' was not declared in this scope 94 | string U; | ^~~~~~ 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:96:3: error: 'cin' was not declared in this scope 96 | cin >> N >> U >> Q; | ^~~ a.cc:96:3: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:96:15: error: 'U' was not declared in this scope 96 | cin >> N >> U >> Q; | ^ a.cc:103:11: error: expected ';' before 's' 103 | string s; | ^~ | ; a.cc:104:12: error: 's' was not declared in this scope 104 | cin >> s; | ^ a.cc:114:7: error: 'cout' was not declared in this scope 114 | cout << compare(segtree, a, b, c, d) << endl; | ^~~~ a.cc:114:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:114:15: error: 'compare' was not declared in this scope 114 | cout << compare(segtree, a, b, c, d) << endl; | ^~~~~~~ a.cc:114:47: error: 'endl' was not declared in this scope 114 | cout << compare(segtree, a, b, c, d) << endl; | ^~~~ a.cc:114:47: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s905115574
p00352
Java
import java.util.Scanner; public class Main{ public static void main (String [ ] args){ Scanner sc = new Scanner (System.in); int a = sc.next Int( ); int b = sc.nextInt( ); System.out.printLn((a+b)/2); } }
Main.java:7: error: ';' expected int a = sc.next Int( ); ^ 1 error
s615784510
p00352
Java
import java.util.Scanner; public class Main{ public static void main (String [] args){ Scanner sc = new Scanner (System.in); int a = sc.next Int(); int b = sc.nextInt(); System.out.printLn((a+b)/2); } }
Main.java:7: error: ';' expected int a = sc.next Int(); ^ 1 error