submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s096308096
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; int main(){ ll a[7]; for(int i=0; i<7; i++) cin >> a[i]; ll ans=a[1]; ll p=2*(a[0]/2+a[3]/2+a[4]/2); ll q=3+2*((a[0]-1)/2+(a[3]-1)/2+(a[4]-1)/2); if(a[0]>0 && a[3]>0 && a[4]>0) ans+=max({p, q}); else ans+=p; cout << ans << endl; return 0; }#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; int main(){ ll a[7]; for(int i=0; i<7; i++) cin >> a[i]; ll ans=a[1]; ll p=2*(a[0]/2+a[3]/2+a[4]/2); ll q=3+2*((a[0]-1)/2+(a[3]-1)/2+(a[4]-1)/2); if(a[0]>0 && a[3]>0 && a[4]>0) ans+=max({p, q}); else ans+=p; cout << ans << endl; return 0; }
a.cc:18:2: error: stray '#' in program 18 | }#include <bits/stdc++.h> | ^ a.cc:18:3: error: 'include' does not name a type 18 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:25:5: error: redefinition of 'int main()' 25 | int main(){ | ^~~~ a.cc:8:5: note: 'int main()' previously defined here 8 | int main(){ | ^~~~
s516548464
p03840
C++
#include <assert.h> #include <limits.h> #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using ll = long long; using P = std::pair<ll, ll>; #define rep(i, a, b) for (ll(i) = (a); i < (b); i++) #define all(i) i.begin(), i.end() #define debug(i) std::cerr << "debug " << i << std::endl template <typename T1, typename T2> std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) { return os << pa.first << " " << pa.second; } template <typename T> std::ostream& operator<<(std::ostream& os, std::vector<T> vec) { for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " "); return os; } template<typename T1,typename T2> inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);} template<typename T1,typename T2> inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);} // const ll MOD = 998244353; const ll MOD = 1e9 + 7; ll pow_mod(ll a, ll b, ll mod=-1) { if ((a == 0)||(mod!=-1&&a%mod==0)) { return 0; } ll x = 1; while (b > 0) { if (b & 1) { x = (mod!=-1)?(x * a) % mod:x*a; } a = (mod!=-1)?(a * a) % mod:a*a; b >>= 1; } return x; } int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); ll i,o,t,j,l,s,z; std::cin>>i>>o>>t>>j>>l>>s>>z; ll ans=o+(i/2)*2+(j/2)*2+(l/2)*2; if(i==0||l==0||j==0){ std::cout<<ans; return 0; } chmax(ans,o+((i-1)/2)*2+((j-1)/2)*2+((l-1)/2)*2+2) return 0; }
a.cc: In function 'int main()': a.cc:79:53: error: expected ';' before 'return' 79 | chmax(ans,o+((i-1)/2)*2+((j-1)/2)*2+((l-1)/2)*2+2) | ^ | ; 80 | 81 | return 0; | ~~~~~~
s567456423
p03840
C++
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #include <queue> #define inf 0x3f3f3f3f #define cases(t) for (int cas = 1; cas <= int(t); ++cas) typedef long long ll; typedef double db; using namespace std; #ifdef NO_ONLINE_JUDGE #define LOG(args...) do { cout << #args << " -> "; err(args); } while (0) void err() { cout << endl; } template<typename T, typename... Args> void err(T a, Args... args) { cout << a << ' '; err(args...); } #else #define LOG(...) #endif ll i, o, t, j, l, s, z; int main() { scanf("%lld%lld%lld%lld%lld%lld%lld", &i, &o, &t, &j, &l, &s, &z); ll mn = min(i, min(j, l)); ll ans1 = o * 2 + mn * 6; ans1 += (i - mn) / 2 * 4 + (j - mn) / 2 * 4 + (l - mn) / 2 * 4; mn = max(mn - 1, 0); ll ans2 = o * 2 + mn * 6; ans1 += (i - mn) / 2 * 4 + (j - mn) / 2 * 4 + (l - mn) / 2 * 4; printf("%lld\n", max(ans1, ans2) / 2); return 0; }
a.cc: In function 'int main()': a.cc:33:13: error: no matching function for call to 'max(ll, int)' 33 | mn = max(mn - 1, 0); | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:33:13: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 33 | mn = max(mn - 1, 0); | ~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:33:13: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 33 | mn = max(mn - 1, 0); | ~~~^~~~~~~~~~~
s153899155
p03840
C++
#include <iostream> using namespace std; int main () { long long a, b, c, d, e, f, g; while (cin >> a >> b >> c >> d >> e >> f >> g) { long long res = 0 ; long long m = min (a, min (d, e)); for ( long long i = max (m- 2 , 0LL ); i <= m; ++ i) { long long tmp = i * 3 ; long long na = a-i, nd = d-i, ne = e-i; tmp + = na / 2 * 2 ; tmp + = nd / 2 * 2 ; tmp + = ne / 2 * 2 ; res = max (res, tmp); } cout << res + b << endl; } }
a.cc: In function 'int main()': a.cc:12:19: error: expected primary-expression before '=' token 12 | tmp + = na / 2 * 2 ; | ^ a.cc:13:19: error: expected primary-expression before '=' token 13 | tmp + = nd / 2 * 2 ; | ^ a.cc:14:19: error: expected primary-expression before '=' token 14 | tmp + = ne / 2 * 2 ; | ^
s591794929
p03840
C++
#include <iostream> using namespace std; int main () { long long a, b, c, d, e, f, g; while (cin >> a >> b >> c >> d >> e >> f >> g) { long long res = 0 ; long long m = min (a, min (d, e)); for ( long long i = max (m- 2 , 0LL ); i <= m; ++ i) ( long long tmp = i * 3 ; long long na = a-i, nd = d-i, ne = e-i; tmp + = na / 2 * 2 ; tmp + = nd / 2 * 2 ; tmp + = ne / 2 * 2 ; res = max (res, tmp); } cout << res + b << endl; } }
a.cc: In function 'int main()': a.cc:10:14: error: expected primary-expression before 'long' 10 | long long tmp = i * 3 ; | ^~~~ a.cc:9:65: error: expected ')' before 'long' 9 | for ( long long i = max (m- 2 , 0LL ); i <= m; ++ i) ( | ~^ | ) 10 | long long tmp = i * 3 ; | ~~~~ a.cc:11:32: error: 'i' was not declared in this scope 11 | long long na = a-i, nd = d-i, ne = e-i; | ^ a.cc:12:13: error: 'tmp' was not declared in this scope; did you mean 'tm'? 12 | tmp + = na / 2 * 2 ; | ^~~ | tm a.cc:12:19: error: expected primary-expression before '=' token 12 | tmp + = na / 2 * 2 ; | ^ a.cc:13:19: error: expected primary-expression before '=' token 13 | tmp + = nd / 2 * 2 ; | ^ a.cc:13:21: error: 'nd' was not declared in this scope; did you mean 'na'? 13 | tmp + = nd / 2 * 2 ; | ^~ | na a.cc:14:19: error: expected primary-expression before '=' token 14 | tmp + = ne / 2 * 2 ; | ^ a.cc:14:21: error: 'ne' was not declared in this scope; did you mean 'na'? 14 | tmp + = ne / 2 * 2 ; | ^~ | na a.cc:17:17: error: 'res' was not declared in this scope 17 | cout << res + b << endl; | ^~~ a.cc: At global scope: a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s896958916
p03840
C++
#include<bits/stdc++.h> #include <math.h> #include <algorithm> #include <functional> #include<iostream> #include <string> using namespace std; typedef long long ll; int main() { int a,b,c,d,e,f,g,ans; cin >> a>> b>> c>> d>> e>> f >> g; int s=min({a,d,e}); a-=s; d-=s; e-=s; int k = a%2+d%2+e%2; if(s==0)k=0; ll ans=3*s+(a/2)*2+b+(d/2)*2+(e/2)*2+max(k-1,0); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:8: error: conflicting declaration 'll ans' 20 | ll ans=3*s+(a/2)*2+b+(d/2)*2+(e/2)*2+max(k-1,0); | ^~~ a.cc:11:23: note: previous declaration as 'int ans' 11 | int a,b,c,d,e,f,g,ans; | ^~~
s297061726
p03840
C++
#include<bits/stdc++.h> #include <math.h> #include <algorithm> #include <functional> #include<iostream> #include <string> using namespace std; typedef long long ll; int main() { int a,b,c,d,e,f,g,ans; cin >> a>> b>> c>> d>> e>> f >> g; int s=min({a,d,e}); a-=s; d-=s; e-=s; int k = a%2+d%2+e%2; if(s==0)k=0; ll ans=3*s+(a/2)*2+b+(d/2)*2+(e/2)*2+max(k-1,0) cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:8: error: conflicting declaration 'll ans' 20 | ll ans=3*s+(a/2)*2+b+(d/2)*2+(e/2)*2+max(k-1,0) | ^~~ a.cc:11:23: note: previous declaration as 'int ans' 11 | int a,b,c,d,e,f,g,ans; | ^~~
s014396419
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define pb push_back #define mp make_pair #define rep(i,n) for(int i=0;i<(n);++i) const int mod=1000000007; const int mod1=998244353; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll ai,ao,at,aj,al,as,az;cin >> ai >> ao >> at >> aj >> al >> as >> az; if(aj%2==1 && al%2==1){ if(ai%2==0){ ai-=2; aj--; al--; ans+=4; } else{ ai--; aj--; al--; ans+=3; } } else if(ai%2==1 && aj%2==1 && al>0){ ai--; aj--; al--; ans+=3; } else if(ai%2==1 && al%2==1 && aj>0){ ai--; aj--; al--; ans+=3; } ans+=ai/2*2+aj/2*2+al/2*2; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:25: error: 'ans' was not declared in this scope; did you mean 'as'? 20 | ans+=4; | ^~~ | as a.cc:26:25: error: 'ans' was not declared in this scope; did you mean 'as'? 26 | ans+=3; | ^~~ | as a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'as'? 33 | ans+=3; | ^~~ | as a.cc:39:17: error: 'ans' was not declared in this scope; did you mean 'as'? 39 | ans+=3; | ^~~ | as a.cc:41:9: error: 'ans' was not declared in this scope; did you mean 'as'? 41 | ans+=ai/2*2+aj/2*2+al/2*2; | ^~~ | as
s185489635
p03840
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int i = Integer.parseInt(sa[0]); int o = Integer.parseInt(sa[1]); int j = Integer.parseInt(sa[3]); int l = Integer.parseInt(sa[4]); br.close(); long ans = o; while ((j>=0) && (l>=0) && (i>=0)) { ans += 3; i--; j--; l--; } if(j==0 && l%2==1 && i%2==1){ ans +=1; } if(l==0 && j%2==1 && i%2==1){ ans +=1; } if(i=0 && l%2==1 && i%2==1){ ans +=1; } ans += i / 2 * 2; ans += j / 2 * 2; ans += l / 2 * 2; System.out.println(ans); } }
Main.java:28: error: bad operand types for binary operator '&&' if(i=0 && l%2==1 && i%2==1){ ^ first type: int second type: boolean Main.java:28: error: incompatible types: int cannot be converted to boolean if(i=0 && l%2==1 && i%2==1){ ^ 2 errors
s358855387
p03840
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int i = Integer.parseInt(sa[0]); int o = Integer.parseInt(sa[1]); int j = Integer.parseInt(sa[3]); int l = Integer.parseInt(sa[4]); br.close(); long ans = o; while (j>=0 && l>=0 && i>=0) { ans += 3; i--; j--; l--; } if((j==0 && l%2==1 && i%2==1)||(l==0 && j%2==1 && i%2==1)||(i=0 && l%2==1 && i%2==1)){ ans +=1; } ans += i / 2 * 2; ans += j / 2 * 2; ans += l / 2 * 2; System.out.println(ans); } }
Main.java:22: error: bad operand types for binary operator '&&' if((j==0 && l%2==1 && i%2==1)||(l==0 && j%2==1 && i%2==1)||(i=0 && l%2==1 && i%2==1)){ ^ first type: int second type: boolean Main.java:22: error: bad operand types for binary operator '||' if((j==0 && l%2==1 && i%2==1)||(l==0 && j%2==1 && i%2==1)||(i=0 && l%2==1 && i%2==1)){ ^ first type: boolean second type: int 2 errors
s553441222
p03840
C++
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <vector> static const int IINF = 1 << 30; static const long long LINF = 1LL << 60; static const long long MOD = 1.0e+9 + 7; template <typename T> std::vector<T> vectors(std::size_t n, T val) { return std::vector<T>(n, val); } template <typename T, typename... Args> auto vectors(std::size_t n, Args... args) { return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...)); } template <class T> inline bool chmin(T &a, const T &b) { return (a > b) ? a = b, true : false; } template <class T> inline bool chmax(T &a, const T &b) { return (a < b) ? a = b, true : false; } template <class T> inline void chadd(T &a, const T &b) { a += b, a %= MOD; // TODO minus case } template <class T> std::ostream &operator<<(std::ostream &s, const std::vector<T> &v) { if (v.empty()) return s; s << *v.begin(); for (auto iter = v.begin() + 1; iter != v.end(); ++iter) if (std::is_fundamental<T>::value) s << " " << *iter; else s << std::endl << *iter; return s; } int main() { // Input long long aI, aO, aT, aJ, aL, aS, aZ; std::cin >> aI >> aO >> aT >> aJ >> aL >> aS >> aZ; // Main long long res1 = 0; res1 += aO; long long tmp = std::min({aI, aJ, aL}); res1 += 3 * tmp; aI -= tmp; aJ -= tmp; aL -= tmp; if (aI == 0) { res1 += (aJ / 2) * 2; res1 += (aL / 2) * 2; } else if (aJ == 0) { res1 += (aI / 2) * 2; res1 += (aL / 2) * 2; } else { assert(aL == 0); res1 += (aI / 2) * 2; res1 += (aJ / 2) * 2; } if (aI + aJ + aL % 6 == 5) res1 += 1; long long res2 = 0; res2 += aO; long long tmp = std::min({aI, aJ, aL}) - 1; if (tmp < 0) tmp = 0; res2 += 3 * tmp; aI -= tmp; aJ -= tmp; aL -= tmp; if (aI <= 1) { res2 += (aJ / 2) * 2; res2 += (aL / 2) * 2; } else if (aJ <= 1) { res2 += (aI / 2) * 2; res2 += (aL / 2) * 2; } else { assert(aL <= 1); res2 += (aI / 2) * 2; res2 += (aJ / 2) * 2; } if (aI + aJ + aL % 6 == 5) res2 += 1; // Output std::cout << std::max(res1, res2) << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:75:13: error: redeclaration of 'long long int tmp' 75 | long long tmp = std::min({aI, aJ, aL}) - 1; | ^~~ a.cc:54:13: note: 'long long int tmp' previously declared here 54 | long long tmp = std::min({aI, aJ, aL}); | ^~~
s347846929
p03840
C++
#include <iostream> using namespace std; int main() { long long a, b, c, d, e, f, g; while (cin >> a >> b >> c >> d >> e >> f >> g) { long long res = 0; long long m = min(a, min(d, e)); for (long long i = max(m-2, 0); i <= m; ++i) { long long tmp = i * 3; long long na = a - i, nd = d - i, ne = e - i; tmp += na/2 * 2; tmp += nd/2 * 2; tmp += ne/2 * 2; res = max(res, tmp); } cout << res + b << endl; } }
a.cc: In function 'int main()': a.cc:9:31: error: no matching function for call to 'max(long long int, int)' 9 | for (long long i = max(m-2, 0); i <= m; ++i) { | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:9:31: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 9 | for (long long i = max(m-2, 0); i <= m; ++i) { | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
s955099154
p03840
C++
#include<bits/stdc++.h> using namespace std; #define evn(a) (a<0?-1:(a)/2*2) int main(){ long I,O,J,L; cin>>I>>O>>J>>J>>L; cout<<max(O+max(evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3),0); return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: no matching function for call to 'max(long int, int)' 7 | cout<<max(O+max(evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3),0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:7:12: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 7 | cout<<max(O+max(evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3),0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:7:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 7 | cout<<max(O+max(evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3),0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s913735900
p03840
C++
#include<bits/stdc++.h> using namespace std; #define evn(a) (a<0?-1:(a)/2*2) int main(){ long I,O,J,L; cin>>I>>O>>J>>J>>L; cout=max({evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3,0}); return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: no matching function for call to 'max(<brace-enclosed initializer list>)' 7 | cout=max({evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3,0}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:7:11: note: deduced conflicting types for parameter '_Tp' ('long int' and 'int') 7 | cout=max({evn(I)+evn(J)+evn(L),evn(I-1)+evn(J-1)+evn(L-1)+3,0}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided
s070340770
p03840
C++
#include<bits/stdc++.h> using namespace std; #define evn(a) (a-a%2) int main(){ long res=0; vector<long> a(7); for(int i=0;i<7;++i)cin>>a[i]; cout<<max( evn(a[0])+evn(a[3])+evn(a[4]), evn(a[0]-1)+evn(a[3]-1)+evn(a[4]-1)+3, )+a[1]; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: expected primary-expression before ')' token 11 | )+a[1]; | ^
s143795514
p03840
C++
#include <bits/stdc++.h> using namespace std; int main() { int I,O,T,J,L,S,Z; cin >> I >> O >> T >> J >> L >> S >> Z; if( J % 2 = 1 && L % 2 = 1){ cout << ( I + O + J + L ) * 2 - 2 << endl; } else { cout << I / 2 * 4 + O * 2 + J / 2 * 4 + L / 2 * 4 << endl; } }
a.cc: In function 'int main()': a.cc:7:17: error: lvalue required as left operand of assignment 7 | if( J % 2 = 1 && L % 2 = 1){ | ~~^~~~~~~~
s421805006
p03840
C++
#include <bits/stdc++.h> using namespace std; int main() { int I,O,T,J,L,S,Z; cin >> I >> O >> T >> J >> L >> S >> Z; if( J % 2 = 1 && L % 2 = 1){ cout << ( I + O + J + L ) * 2 - 2 << endl; } else { cout << I / 2 * 4 + O * 2 + J / 2 * 4 + L / 2 * 4 << endl; }
a.cc: In function 'int main()': a.cc:7:17: error: lvalue required as left operand of assignment 7 | if( J % 2 = 1 && L % 2 = 1){ | ~~^~~~~~~~ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s623821763
p03840
C++
v#include<bits/stdc++.h> using namespace std; #define int long long const int MOD = 1000000007LL; const int INF = LLONG_MAX; signed main(){ int a, b, c, d, e, f, g; cin >> a >> b >> c >> d >> e >> f >> g; int ans = 0; if(d >= 1 && e >= 1){ ans += a; ans += b; ans += 2 * min(d, e); }else{ ans += (a / 2) * 2; ans += b; } cout << ans << endl; return 0; }
a.cc:1:2: error: stray '#' in program 1 | v#include<bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include<bits/stdc++.h> | ^ a.cc:5:17: error: 'LLONG_MAX' was not declared in this scope 5 | const int INF = LLONG_MAX; | ^~~~~~~~~ a.cc:1:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' +++ |+#include <climits> 1 | v#include<bits/stdc++.h> a.cc: In function 'int main()': a.cc:9:30: error: 'cin' was not declared in this scope 9 | int a, b, c, d, e, f, g; cin >> a >> b >> c >> d >> e >> f >> g; | ^~~ a.cc:14:20: error: 'min' was not declared in this scope; did you mean 'main'? 14 | ans += 2 * min(d, e); | ^~~ | main a.cc:20:5: error: 'cout' was not declared in this scope 20 | cout << ans << endl; | ^~~~ a.cc:20:20: error: 'endl' was not declared in this scope 20 | cout << ans << endl; | ^~~~
s095188362
p03840
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll ai,ao,at,aj,al,as,az;cin>>ai>>ao>>at>>aj>>al>>as>>az; ll ans=(ai/2)*2+ao+(aj/2)*2+(al/2)*2<<endl; if(ai%2==1&&aj%2==1&&al%2==1)ans+=3; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:39: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<' 6 | ll ans=(ai/2)*2+ao+(aj/2)*2+(al/2)*2<<endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
s648407668
p03840
C++
#include<bits/stdc++.h> #define INF 1e9 #define llINF 1e18 #define MOD 1000000007 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long #define vi vector<ll> #define vvi vector<vi> #define substr(s,f,t) (s.substr(f-1,t-f+1)) #define ALL(a) (a).begin(),(a).end() #define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl; #define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl; using namespace std; struct Grid{ll x,y,t;}; struct Edge{ll to,cost;}; struct Graph{vector<vector<Edge>>E;int V; const ll Inf = llINF;const int MAX_V=201010;vector<ll>d; Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;} void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;} void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});} }; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll i,o,t,j,l,s,z; cin>>i>>o>>t>>j>>l>>s>>z; if(i>0&&j>0&&l>0){ cout<<o+max((i-1)/2+(j-1)/2+(l-1)/2+3,i/2+j/2+l/2)<<endl; }else{ cout<<<o+i/2+j/2+l/2<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:33:11: error: expected primary-expression before '<' token 33 | cout<<<o+i/2+j/2+l/2<<endl; | ^ a.cc:33:25: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<' 33 | cout<<<o+i/2+j/2+l/2<<endl; | ~~~~~~~~~~~~~^~~~~~
s005988158
p03840
C++
/** SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ== */ #include <cstring> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <queue> #include <cmath> #include <cstdlib> #include <ctime> #include <cassert> #define F first #define S second #define endl '\n' #define deb(x) cout<<#x<<' '<<x<<endl; #define pb push_back #ifdef IZI_KATKA #define int __int64_t #else #define int __int64_t #endif const long long MOD = 1e9 + 7; const long long MAXN = 1e6 + 1; using namespace std; typedef long long ll; typedef pair<int, int> pii; long long readInt() { bool minus1 = false; long long result = 0; char ch; ch = getchar(); while (true) { if (ch == '-') break; if (ch >= '0' && ch <= '9') break; ch = getchar(); } if (ch == '-') minus1 = true; else result = ch-'0'; while (true) { ch = getchar(); if (ch < '0' || ch > '9') break; result = result*10 + (ch - '0'); } if (minus1) return -result; else return result; } int main() { #ifdef IZI_KATKA assert(freopen("input", "r", stdin)); assert(freopen("output", "w", stdout)); #endif int a = readInt(), b = readInt(), useless = readInt(), d = readInt(), e = readInt(); int kek = 0; int ans = 0; while(a - 1 >= 0 && (d - 2) >= 0) { a--; d-= 2; ans += 6; } while(a - 1 >= 0 && (e - 2) >= 0) { a--; e-= 2; ans += 6; } while(d - 2 >= 0) { d--; d--; ans += 4; } while(e - 2 >= 0) { e--; e--; ans += 4; } cout << ((a / 2) * 4 + 2 * b + ans) / 2; return 0; }
a.cc:36:13: error: '::main' must return 'int' 36 | #define int __int64_t | ^~~~~~~~~ a.cc:71:1: note: in expansion of macro 'int' 71 | int main() { | ^~~
s376050009
p03840
C++
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using ll = long long; #define endl "\n" #define REP(i, n) for (ll i = 0; i < n; i++) #define REPR(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, m, n) for (ll i = m; i < n; i++) #define pb push_back #define fill(x, y) memset(x, y, sizeof(x)) #define even(x) (x) % 2 == 0 #define odd(x) (x) % 2 != 0 #define all(x) x.begin(), x.end() #define pcnt __builtin_popcount #define buli(x) __builtin_popcountll(x) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); #define IN1(type, x) type x; cin >> x; #define inll(x) ll x; cin >> x; #define indo(x) double x; cin >> x; // these functions return the position of result of Binary Search. #define LB(s, t, x) (int) (lower_bound(s, t, x) - s) #define UB(s, t, x) (int) (upper_bound(s, t, x) - s) ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1) ans = 1ll * ans * a % mo; a = 1ll * a * a % mo; } while (b >>= 1); return ans; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { ll temp = gcd(a, b); return temp ? (a / temp * b) : 0; } int mDays[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 }, dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 }; template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, ts...)); } template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; } template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); } // auto dp = make_v<int>(4, h, w); // fill_v(dp, 0); template<class T> inline bool contains(const std::set<T>& container, const T& value) { return container.find(value) != container.end(); } const ll MOD_CONST = (ll)(1e9 + 7); template <typename T> vector<T> pows(int b, int n) { vector<T> ret; T x = 1; while (ret.size() < n) { ret.push_back(x); x *= b; } return ret; } // find string "from" in "str", and replace them to "to" void strReplace(std::string& str, const std::string& from, const std::string& to) { std::string::size_type pos = 0; while (pos = str.find(from, pos), pos != std::string::npos) { str.replace(pos, from.length(), to); pos += to.length(); } } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } inline tuple<ll, ll> rotate45(tuple<ll, ll> point) { ll x = get<0>(point), y = get<1>(point); return tuple<ll, ll>(x + y, x - y); } inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; } template <typename T> vector<T> INPA(ll n) { vector<T> x; REP(i, n) { T tmp; cin >> tmp; x.push_back(tmp); } return move(x); } template <typename T> void out(T o) { cout << o << endl; } template <typename T> void out(vector<T> &out) { REP(i, (int)out.size()) { cout << out[i]; if (i == (int)out.size() - 1) cout << endl; else cout << " "; } } template <typename T> void out(vector<vector<T>> o) { REP(i, o.size()) out(o[i]); } void YesNo(bool f) { cout << (f?"Yes":"No") << endl; } void YESNO(bool f) { cout << (f?"YES":"NO") << endl; } // use " for (const auto& e : V) string longestCommonPrefix(vector<string>& strs) { int n = INT_MAX; if (strs.size() <= 0) { return ""; } if (strs.size() == 1) { return strs[0]; } // get the min length for (int i = 0; i < strs.size(); i ++) { n = strs[i].length() < n ? strs[i].length() : n ; } for (int i = 0; i < n; i ++) { // check each character for (int j = 1; j < strs.size(); j ++) { if (strs[j][i] != strs[j - 1][i]) { // we find a mis-match return strs[0].substr(0, i); } } } // prefix is n-length return strs[0].substr(0, n); } ll p_base(ll base, ll x) { ll ans = 1; REP(i, x) { ans *= base; ans %= MOD_CONST; } return ans; } class ListG { public: // there's directed edge between A and B // if to[A] has element B vector<vector<int>> to; map<pair<int, int>, ll> cost; void setCost(int u, int v, ll c) { cost[{min(u, v), max(u, v)}] = c; } ll getCost(int u, int v) { return cost[{min(u, v), max(u, v)}]; } ListG(int s) : root(-1) { size = s; to = make_v<vector<int>>(size); } void setDirectedEdge(int f, int t) { to[f].push_back(t); } void setIndirectedEdge(int v1, int v2) { setDirectedEdge(v1, v2); setDirectedEdge(v2, v1); } void dfs(int x) { // do something } void makeTree(int r) { root = r; p = make_v<int>(size); p[root] = -1; depth = make_v<int>(size); mtdfs(root, 0); // count leaf node auto idxs = make_v<int>(size); iota(all(idxs), 0); leaf_idx = set<int>(all(idxs)); REP(i, size) { if (i == root) continue; leaf_idx.erase(p[i]); } } void makeEulerTour() { assert(root >= 0); et_begin = make_v<int>(size); et_end = make_v<int>(size); tmp_k = 0; etdfs(root, -1); } int size, root; vector<int> p; // parent for each node. parent of root = -1 vector<int> depth; // for each node. depth of root node = 0 vector<int> euler_tour; vector<int> et_begin, et_end; set<int> leaf_idx; int tmp_k; private: void mtdfs(int c, int d) { depth[c] = d; REP(i, to[c].size()) { int next = to[c][i]; if (p[c] == next) continue; p[next] = c; mtdfs(next, d + 1); } } void etdfs(int vidx, int pidx) { et_begin[vidx] = tmp_k; euler_tour.push_back(vidx); tmp_k++; REP(i, to[vidx].size()) { if (to[vidx][i] != pidx) { etdfs(to[vidx][i], vidx); euler_tour.push_back(vidx); tmp_k++; } } et_end[vidx] = tmp_k; } }; template <typename T> class BinaryIndexedTree { public: int size; vector<T> data; BinaryIndexedTree(int s, T initial_value = T(0)) { size = s; data = make_v<T>(size+1); fill_v(data, initial_value); } void add(int idx, T value) { while (idx <= size) { data[idx] += value; idx += idx & -idx; } } T sum(int idx) { T s = 0; while (idx > 0) { s += data[idx]; idx -= idx & -idx; } return s; } }; // lambda auto f = [](int arg1, double arg2) { return ret; }; struct UnionFind { vector<int> data; UnionFind(int size) : data(size, -1) { } bool unionSet(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return x != y; } bool findSet(int x, int y) { return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } int size(int x) { return -data[root(x)]; } }; int main(void) { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20); auto a = INPA<ll>(7); ll ans = 0; ll k3 = min({a[0], a[3], a[4], 1}); a[0] -= k3, a[3] -= k3, a[4] -= k3; ans += 3 * k3; ans += a[0] / 2 * 2; ans += a[3] / 2 * 2; ans += a[4] / 2 * 2; a[0] += k3, a[3] += k3, a[4] += k3; ll nans = 0; nans += a[0] / 2 * 2; nans += a[3] / 2 * 2; nans += a[4] / 2 * 2; chmax(ans, nans); out(ans + a[1]); return 0; }
a.cc: In function 'int main()': a.cc:280:16: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 280 | ll k3 = min({a[0], a[3], a[4], 1}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ 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: candidate expects 2 arguments, 1 provided /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, 1 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: template argument deduction/substitution failed: a.cc:280:16: note: deduced conflicting types for parameter '_Tp' ('long long int' and 'int') 280 | ll k3 = min({a[0], a[3], a[4], 1}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ /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: candidate expects 2 arguments, 1 provided
s414884648
p03840
C++
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int i o,t,j,l,s,z,q; cin>>i>>o>>t>>j>>l>>s>>z; if (i>0&&j>0&&l>0)q=2*((i-1)/2+(j-1)/2+(l-1)/2)+o+3; else q=0; cout<<max(2*(i/2+j/2+l/2)+o,q); }
a.cc: In function 'int main()': a.cc:5:11: error: expected initializer before 'o' 5 | int i o,t,j,l,s,z,q; | ^ a.cc:6:10: error: 'i' was not declared in this scope 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ a.cc:6:13: error: 'o' was not declared in this scope 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ a.cc:6:16: error: 't' was not declared in this scope; did you mean 'tm'? 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ | tm a.cc:6:19: error: 'j' was not declared in this scope; did you mean 'jn'? 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ | jn a.cc:6:22: error: 'l' was not declared in this scope 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ a.cc:6:25: error: 's' was not declared in this scope 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ a.cc:6:28: error: 'z' was not declared in this scope 6 | cin>>i>>o>>t>>j>>l>>s>>z; | ^ a.cc:7:23: error: 'q' was not declared in this scope 7 | if (i>0&&j>0&&l>0)q=2*((i-1)/2+(j-1)/2+(l-1)/2)+o+3; | ^ a.cc:8:10: error: 'q' was not declared in this scope 8 | else q=0; | ^ a.cc:9:37: error: 'q' was not declared in this scope 9 | cout<<max(2*(i/2+j/2+l/2)+o,q); | ^
s608233210
p03840
C++
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬██╬╬╬╬╬╬███ // ███████████ ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓▓█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ ███████████████████ #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 #define INF 1LL<<60 #define fs first #define sc second #define pb push_back #define int long long #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(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define debug(x) cout << #x << " = " << (x) << endl; typedef pair<int,int> P; typedef vector<vector<P>> Graph; signed main(){ ios::sync_with_stdio(false); cin.tie(0); int a,b,x,c,d,y,z; cin >> a >> b >> x >> c >> d >> y >> z; int ans = b; if((c % 2 == 1 && d % 2 == 1) || (a % 2 == 1 && d % 2 == 1) || (c % 2 == 1 && a % 2 == 1)){ if(a == 0 || c == 0 || d == 0) continue; ans += 3; a--; c--; d--; } ans += c/2*2; ans += d/2*2; ans += a/2*2; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:51:36: error: continue statement not within a loop 51 | if(a == 0 || c == 0 || d == 0) continue; | ^~~~~~~~
s327243917
p03840
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ long a[7],b; for(int i=0;i<7;i++) scanf("%ld",&a[i]); b=min(a[3] printf("%ld\n",a[0]/2*2+a[1]+min(a[3],a[4])/2*3); }
a.cc: In function 'int main()': a.cc:8:13: error: expected ')' before 'printf' 8 | b=min(a[3] | ~ ^ | ) 9 | printf("%ld\n",a[0]/2*2+a[1]+min(a[3],a[4])/2*3); | ~~~~~~
s434457702
p03840
C++
asd
a.cc:1:1: error: 'asd' does not name a type 1 | asd | ^~~
s086858387
p03840
C++
#include<iostream> using namespace std; int main(){ long long a[7]; for(int i=0;i<7;i++){ cin >> a[i]; } long long ans = a[0]/2 + a[1] + a[3]/2 + a[4]/2; if(a[0]%2 && a[3]%2 && a[4]%2)ans++; ans++; cout << ans << }
a.cc: In function 'int main()': a.cc:12:1: error: expected primary-expression before '}' token 12 | } | ^
s872532192
p03840
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; long long int i,o,t,j,l,s,z; int main(){ scanf("%lld%lld%lld%lld%lld%lld%lld",&i,&o,&t,&j,&l,&s,&z); printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); return 0; }
a.cc: In function 'int main()': a.cc:8:44: error: no matching function for call to 'max(int, long long int)' 8 | printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:8:44: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 8 | printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
s905074756
p03840
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; long long int i,o,t,j,l,s,z; int main(){ scanf("%lld%lld%lld%lld%lld%lld%lld",&i,&o,&t,&j,&l,&s,&z); printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); return 0; }
a.cc: In function 'int main()': a.cc:8:44: error: no matching function for call to 'max(int, long long int)' 8 | printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:8:44: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 8 | printf("%lld",max(3+((i-1)/2)*2+max(0,min(j-1,l-1)*2)+o,(i/2)*2+2*min(j,l)+o)); | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
s402893722
p03840
C++
#include <bits/stdc++.h> #define FOR(i, begin, end) for(int i=(begin);i<(end);i++) #define REP(i, n) FOR(i,0,n) #define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--) #define IREP(i, n) IFOR(i,0,n) #define SORT(a) sort(a.begin(), a.end()) #define REVERSE(a) reverse(a.begin(), a.end()) #define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x)) #define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x)) #define int long long #define INF 1000000000000000000 using namespace std; typedef vector<int> vec; typedef vector<vec> mat; typedef pair<int, int> Pii; template<typename T> void readvec(vector<T> &a); void readindex(vector<int> &a); signed main(){ vec a(7); readvec(a); int ans = (a[0] / 2) * 2 + a[1] + (a[3] / 2) * 2 + (a[4] / 2) * 2; if(a[0] % 2 == 1 && a[3] % 2 == 1 && a[4] % 2 == 1){ ans2 = 3; a[0]--; a[3]--; a[4]--; ans2 += (a[0] / 2) * 2 + a[1] + (a[3] / 2) * 2 + (a[4] / 2) * 2; ans = max(ans, ans2); } cout << ans; return 0; } template<typename T> void readvec(vector<T> &a){ REP(i, a.size()){ cin >> a[i]; } } void readindex(vector<int> &a){ REP(i, a.size()){ cin >> a[i]; a[i]--; } }
a.cc: In function 'int main()': a.cc:29:9: error: 'ans2' was not declared in this scope; did you mean 'ans'? 29 | ans2 = 3; | ^~~~ | ans
s204597861
p03840
C++
#include<algorithm> #include<iostream> #include<vector> #include<string> #include<cstring> #include<utility> #include<queue> using namespace std; #define REP(i, a,b) for(i=a;i<b;i++) #define REP1(i,b,a) for(i=b-1;i>=a;i--) #define output(x) cout<<x<<endl; #define pb(x) push_back(x); typedef long long int ll; const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } long long ruijyo(ll n, ll k) { if (k == 0) { return 1; } ll sum = 1; ll i; REP(i, 0, k) { sum *= n; sum %= MOD; } return sum; } int main() { ll i, j, k, l, m,n, sum, flag, N, M, K, H, W, B,C,D; sum = 0; flag = 0; ll A[7]; REP(i, 0, 7) { cin >> A[i]; } ll ans,ans1; ans =ans1= 0; ans += 3; ans += ((A[0] - 1) / 2) * 2 + (A[1]) + ((A[3] - 1) / 2) * 2 + ((A[4] - 1) / 2) * 2; ans1 += (A[0] / 2) * 2 + (A[1]) + (A[3] / 2) * 2 + (A[4] / 2) * 2; ll k = fmax(ans, ans1); output(k); return 0; }
a.cc: In function 'int main()': a.cc:67:25: error: redeclaration of 'll k' 67 | ll k = fmax(ans, ans1); | ^ a.cc:54:19: note: 'll k' previously declared here 54 | ll i, j, k, l, m,n, sum, flag, N, M, K, H, W, B,C,D; | ^ a.cc:67:29: error: 'fmax' was not declared in this scope 67 | ll k = fmax(ans, ans1); | ^~~~
s815294969
p03840
C++
#include<cstdio> int I,O,T,J,L,S,Z,now; long long ans; int main() { scanf("%d%d%d%d%d%d%d",&I,&O,&T,&J,&L,&S,&Z); now=(I&1)+(J&1)+(L&1); if(now>2&&I&&J&&L) { --I,--J,--L; ans+=3; }return printf("%lld\n",(ll)ans+O+I/2*2+J/2*2+L/2*2); return 0; }
a.cc: In function 'int main()': a.cc:12:34: error: 'll' was not declared in this scope 12 | }return printf("%lld\n",(ll)ans+O+I/2*2+J/2*2+L/2*2); | ^~
s635634737
p03840
C++
#include <iostream> #include <limits.h> using namespace std; int main(void){ int ai, ao, at, aj, al, as, az; long long ans = 0; cin >> ai >> ao >> at >> aj >> al >> as >> az; //O型のみ ans += ao; while (ai > 0 && aj > 0 && al > 0) { ans += (min(ai, aj, al) * 3); ai -= min(ai, aj, al); aj -= min(ai, aj, al); al -= min(ai, aj, al); } while (ai >= 2) { ans += 2 * (ai / 2); ai -= 2 * (ai / 2); } while (aj >= 2) { ans += 2 * (aj / 2); aj -= 2 * (aj / 2); } while (al >= 2) { ans += 2 * (al / 2); al -= 2 * (al / 2); } cout << ans << endl; }
In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:14:20: required from here 14 | ans += (min(ai, aj, al) * 3); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s263985627
p03840
C++
#include <iostream> using namespace std; int main() { int i, o, t, j, l; cin >> i >> o >> t >> j >> l; ll ans = 0; ans += (i / 2) * 2; i %= 2; ans += o; ans += (j / 2) * 2; j %= 2; ans += (l / 2) * 2; l %= 2; if (i == j && j == l && l == 1) ans++; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: 'll' was not declared in this scope; did you mean 'l'? 7 | ll ans = 0; | ^~ | l a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | ans += (i / 2) * 2; i %= 2; | ^~~ | abs
s596944308
p03840
C++
main(I,O,J,L){ scanf("%d%d%*d%d%d",&I,&O,&J,&L); J=J<L?J:L; printf("%d",O+(J?I+J:I/2*2)); return 0; }
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(I,O,J,L){ | ^
s927380836
p03840
C++
#include <iostream> int main(){ long long I,O,T,J,L,S,Z; long long ans; cin >> I >> O >> T >> J >> L >> S >> Z ; if(I==0){ ans = O + J/2 + L/2; } else if(I%2==1 && J%2==1 && L%2==1){ ans = O + I/2*2 + J/2*2 + L/2*2 + 3; } else{ ans = O + I/2*2 + J/2*2 + L/2*2 : } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> I >> O >> T >> J >> L >> S >> Z ; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:15:48: error: expected ';' before ':' token 15 | ans = O + I/2*2 + J/2*2 + L/2*2 : | ^~ | ; a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 17 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:17:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 17 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s138016426
p03840
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int main() { LL I,O,T,J,L,S,Z; LL flag=0; LL K,K1,K2; while(~scanf("%lld%lld%lld%lld%lld%lld%lld",&I,&O,&T,&J,&L,&S,&Z)) { K=0; K1=0; K2=0; flag=0; LL MIN = min(I,min(L,J)); K+=((I/2)*4+(J/2)*4+(L/2)*4); if(MIN==0) { K+=(O*2) printf("%lld\n",K); continue; } else { K1+=(MIN*6)+(J-MIN)/2*4+(L-MIN)/2*4; K2+=(MIN-1)*6+(J-MIN+1)/2*4+(L-MIN+1)/2*4; K=max(K,(K1,K2)); K+=(O*2); printf("%lld\n",K/2); } } return 0; }
a.cc: In function 'int main()': a.cc:19:21: error: expected ';' before 'printf' 19 | K+=(O*2) | ^ | ; 20 | printf("%lld\n",K); | ~~~~~~
s181526547
p03840
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,x,m,b,c,d,e; cin >> a >> x >> m >> b >> c >> d >> e; long long sum= x*4; if(a%2==0&&b%2==0&&c%2==0){ sum+=(a+b+c)*4; } else if(a%2==0&&b%2==0&&c%2==1){ sum+=(a+b+c-1)*4; } else if(a%2==0&&b%2==1&&c%2==0){ sum+=(a+b+c-1)*4; } else if(a%2==0&&b%2==1&&c%2==1){ if(a==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==0&&c%2==0){ sum+=(a+b+c-1)*4; } else if(a%2==1&&b%2==0&&c%2==1){ if(b==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==1&&c%2==0){ if(c==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==1&&c%2==1){ sum+=(a+b+c)*4; } cout << sum /4 << endl; return 0; }
a.cc:1:26: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h> using namespace std; int main(){ int a,x,m,b,c,d,e; cin >> a >> x >> m >> b >> c >> d >> e; long long sum= x*4; if(a%2==0&&b%2==0&&c%2==0){ sum+=(a+b+c)*4; } else if(a%2==0&&b%2==0&&c%2==1){ sum+=(a+b+c-1)*4; } else if(a%2==0&&b%2==1&&c%2==0){ sum+=(a+b+c-1)*4; } else if(a%2==0&&b%2==1&&c%2==1){ if(a==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==0&&c%2==0){ sum+=(a+b+c-1)*4; } else if(a%2==1&&b%2==0&&c%2==1){ if(b==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==1&&c%2==0){ if(c==0){ sum+=(a+b+c-2)*4; } else{ sum+=(a+b+c-1)*4; } } else if(a%2==1&&b%2==1&&c%2==1){ sum+=(a+b+c)*4; } cout << sum /4 << endl; return 0; } | ^~~~~ /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
s964348264
p03840
C++
#include <iostream> #include <cstdio> using namespace std; int main() { int i,o,t,j,l,s,z; scanf("%d %d %d %d %d %d %d",&i,&o,&t,&j,&l,&s,&z); int ans=0; ans+=(i/2)*4; ans+=2*o; int ll = l; int jj = j; if(i%2!=0&&jj!=0&&ll!=0) { ans+=6; jj--; li--; } ans+=(jj/2)*2; ans+=(ll/2)*2; printf("%d",ans/2); }
a.cc: In function 'int main()': a.cc:19:9: error: 'li' was not declared in this scope; did you mean 'll'? 19 | li--; | ^~ | ll
s143820700
p03840
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int I,O,T,J,L,S,Z; long long int ans = -1; while(scanf("%lld%lld%lld%lld%lld%lld%lld",&I,&O,&T,&J,&L,&S,&Z) != EOF){ if(I > 0 && J > 0 && L > 0){ ans = O; int t1 = (I / 2) * 2 + (J / 2) * 2 + (L / 2) * 2; int t2 = ((I - 1) / 2) * 2 + ((J - 1) / 2) * 2 + ((L - 1) / 2) * 2 int t = max(t1,t2); ans += t; } else{ ans = O + (I / 2) * 2 + (J / 2) * 2 + (L / 2) * 2; } printf("%lld\n",ans); } return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: expected ',' or ';' before 'int' 12 | int t = max(t1,t2); | ^~~ a.cc:13:20: error: 't' was not declared in this scope 13 | ans += t; | ^
s763588237
p03840
C++
#include <bits/stdc++.h> using namespace std; int main(){ long long int I,O,T,J,L,S,Z; long long int ans = -1; while(scanf("%lld%lld%lld%lld%lld%lld%lld",&I,&O,&T,&J,&L,&S,&Z) != EOF){ if(I > 0 && J > 0 && L > 0){ ans = O; int t1 = (I / 2) * 2 + (J / 2) * 2 + (L / 2) * 2; int t2 = ((I - 1) / 2) * 2 + ((J - 1) / 2) * 2 + ((L - 1) / 2) * 2 int t = max(t1,t2); ans += t; } else{ ans = O + (I / 2) * 2 + (J / 2) * 2 + (L / 2) * 2; } printf("%lld\n",ans); } return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: expected ',' or ';' before 'int' 12 | int t = max(t1,t2); | ^~~ a.cc:13:20: error: 't' was not declared in this scope 13 | ans += t; | ^
s270885281
p03840
C++
#include <bits/stdc++.h> #define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(long long int i=(a);i<(b);i++) #define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Abs(a,b) max(a,b)-min(a,b) #define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;} #define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;} #define Cout(x) cout<<(x)<<endl #define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;} #define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;} #define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;} #define Size(n) (n).size() typedef long long ll; using namespace std; const int INF = 1e9,MOD = 1e9 + 7; const ll LINF = 1e18; /*--------------------------------------------------------------- long long int kaizyo(long long int hh){ cmp=1; while(hh>1){ cmp=(cmp*hh)%MOD; hh--; } return cmp; } long long int ruizyo(long long int aa, long long int bb){ if(aa==0){ return 1; } else if(aa%2==0){ long long int tt=ruizyo(aa/2,bb); return (tt*tt)%MOD; } else{ return (ruizyo(aa-1,bb)*bb)%MOD; } }フェルマ-のア --------------------------------------------------------------- while(x!=0){ sum+=x%10; / x/=10; } 各桁の和 --------------------------------------------------------------- pair<int,int> p[100000]; cin >> tmp; p[i]=make_pair(tmp,i); cout << p[i].second+1 << endl;//ペアの右側つまりiを出力 --------------------------------------------------------------- s.find(w[i])==string::npos findの使い方 --------------------------------------------------------------- for(int i=0;i<n;i++){ b[i]=x%2; x/=2; }二進数 --------------------------------------------------------------- bool f[100001];//1000000以下の素数を調べよう! rrep(i,2,100001){ f[i]=false; } rrep(i,2,100001){ if(!f[i]){ for(int j=i+i;j<=100000;j+=i){ f[j]=true; } } } for(int i=3;i<=100000;i+=2){ if(!f[i]){ c[i]++; } } --------------------------------------------------------------- visited=vector<vector<bool>>(10,vector<bool>(10,false));アを全部falseに --------------------------------------------------------------- long long gcd(long long aaa,long long bbb){ if(bbb==0){ return aaa; } return gcd(bbb,aaa%bbb); } long long lcm(long long aaa,long long bbb){ long long g = gcd(aaa,bbb); return aaa/g * bbb; }左から最大公約数と最小公倍数 --------------------------------------------------------------- long long int prime_cnt[10000]; for(int i=2;i*i<=n;i++){ while(n%i==0){ n/=i; prime_cnt[i]+=1; } if(n>1){ prime_cnt[n]+=1; break; } }ある数nを素因数分解しましょう ---------------------------------------------------------------*/ long long int n,cnt=0,ans=0,a,b,c,d,e,cmp,cmpp,m,h,w,x,y,sum=0,pos; int dy[]={1,0,-1,0}; int dx[]={0,1,0,-1}; string alph("abcdefghijklmnopqrstuvwxyz"),s; bool fl=true; struct edge{int to,cost;}; //-------------------------↓↓↓↓↓↓------------------------ int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b >> c >> d >> e; Cout((a/2)*2+b) return 0; }
a.cc: In function 'int main()': a.cc:136:1: error: expected ';' before 'return' 136 | return 0; | ^~~~~~
s248642798
p03840
C++
// IO library #include <cstdio> #include <iomanip> #include <ios> #include <iostream> // algorithm library #include <algorithm> #include <cmath> #include <numeric> // container library #include <deque> #include <list> #include <map> #include <set> #include <string> #include <vector> // namespace using namespace std; // typedef typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef vector<bool> VB; typedef vector<VB> VVB; // container #define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++) #define SORT(c) sort((c).begin(), (c).end()) #define GSORT(c) sort((c).begin(), (c).end(), greater<decltype((c).front())>()) #define SZ(x) ((int)(x).size()) #define MEMSET(c, v) memset((c), v, sizeof(c)) // repetition #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define NREP(i, n) FOR(i, 1, n + 1) #define RFOR(i, a, b) for (int i = (a); i >= (b); i--) #define RREP(i, n) RFOR(i, n, 0) #define RNREP(i, n) RFOR(i, n, 1) // constant // const ll MOD = 1e9 + 7; // const int INF = 1e9; // const ll INF = 1e15; // const int dx[4] = {0, -1, 1, 0}; // const int dy[4] = {-1, 0, 0, 1}; // const int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1}; // const int dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1}; // debug #define test(x) cout << #x << " = " << x << endl // answer output #define Yes(c) cout << ((c) ? "Yes" : "No") << endl; #define YES(c) cout << ((c) ? "YES" : "NO") << endl; #define possible(c) cout << ((c) ? "possible" : "impossible") << endl; #define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl; // -------------------------------------------------------- int main() { cin.tie(0); ios::sync_with_stdio(false); vector<ll> a(7); REP(i, 7) { cin >> a[i]; } if (a[0] % 2 > 0 && min(a[3], a[4] > 0)) { a[0]--; a[3]--; a[4]--; a[1] += 3; } cout << a[0] / 2 * 2 + a[1] + min(a[3], a[4]) * 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:77:26: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, bool)' 77 | if (a[0] % 2 > 0 && min(a[3], a[4] > 0)) { | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/iomanip:42, from a.cc:3: /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:77:26: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'bool') 77 | if (a[0] % 2 > 0 && min(a[3], a[4] > 0)) { | ~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:8: /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:77:26: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 77 | if (a[0] % 2 > 0 && min(a[3], a[4] > 0)) { | ~~~^~~~~~~~~~~~~~~~
s995754438
p03840
C++
#include<iostream> #include<algorithm> using namespace std; int main() { long long i, o, t, j, l, s, z; cin >> i >> o >> t >> j >> l >> s >> z; long long p = min(i, j, l); long long ans = o + p; ans += (i - p) / 2; ans += (j - p) / 2; ans += (l - p) / 2; cout << ans << endl; return 0; }
In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]': a.cc:7:19: required from here 7 | long long p = min(i, j, l); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s354777093
p03840
C++
const int MAX=1e5; int main(){ lli a[7]; rep(i,7)cin>>a[i]; lli ans=0; lli i=a[0]%2,j=a[3]%2,l=a[4]%2; if(i==0&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]; if(i==1&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; if(i==0&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; if(i==1&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-2; if(i==0&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; if(i==1&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-2; if(i==1&&j==1&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; if(i==0&&j==1&&l==1){ if(i>=2)ans=a[0]+a[1]+a[3]+a[4]; else ans=a[0]+a[1]+a[3]+a[4]-2; } cout<<ans*2; }
a.cc: In function 'int main()': a.cc:4:9: error: 'lli' was not declared in this scope 4 | lli a[7]; | ^~~ a.cc:5:13: error: 'i' was not declared in this scope 5 | rep(i,7)cin>>a[i]; | ^ a.cc:5:9: error: 'rep' was not declared in this scope 5 | rep(i,7)cin>>a[i]; | ^~~ a.cc:6:12: error: expected ';' before 'ans' 6 | lli ans=0; | ^~~~ | ; a.cc:7:12: error: expected ';' before 'i' 7 | lli i=a[0]%2,j=a[3]%2,l=a[4]%2; | ^~ | ; a.cc:8:18: error: 'j' was not declared in this scope 8 | if(i==0&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]; | ^ a.cc:8:24: error: 'l' was not declared in this scope 8 | if(i==0&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]; | ^ a.cc:8:29: error: 'ans' was not declared in this scope 8 | if(i==0&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]; | ^~~ a.cc:8:33: error: 'a' was not declared in this scope 8 | if(i==0&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]; | ^ a.cc:9:18: error: 'j' was not declared in this scope 9 | if(i==1&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:9:24: error: 'l' was not declared in this scope 9 | if(i==1&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:9:29: error: 'ans' was not declared in this scope 9 | if(i==1&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^~~ a.cc:9:33: error: 'a' was not declared in this scope 9 | if(i==1&&j==0&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:10:18: error: 'j' was not declared in this scope 10 | if(i==0&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:10:24: error: 'l' was not declared in this scope 10 | if(i==0&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:10:29: error: 'ans' was not declared in this scope 10 | if(i==0&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^~~ a.cc:10:33: error: 'a' was not declared in this scope 10 | if(i==0&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:11:18: error: 'j' was not declared in this scope 11 | if(i==1&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:11:24: error: 'l' was not declared in this scope 11 | if(i==1&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:11:29: error: 'ans' was not declared in this scope 11 | if(i==1&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-2; | ^~~ a.cc:11:33: error: 'a' was not declared in this scope 11 | if(i==1&&j==0&&l==1)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:12:18: error: 'j' was not declared in this scope 12 | if(i==0&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:12:24: error: 'l' was not declared in this scope 12 | if(i==0&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:12:29: error: 'ans' was not declared in this scope 12 | if(i==0&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^~~ a.cc:12:33: error: 'a' was not declared in this scope 12 | if(i==0&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:13:18: error: 'j' was not declared in this scope 13 | if(i==1&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:13:24: error: 'l' was not declared in this scope 13 | if(i==1&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:13:29: error: 'ans' was not declared in this scope 13 | if(i==1&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-2; | ^~~ a.cc:13:33: error: 'a' was not declared in this scope 13 | if(i==1&&j==1&&l==0)ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:14:18: error: 'j' was not declared in this scope 14 | if(i==1&&j==1&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:14:24: error: 'l' was not declared in this scope 14 | if(i==1&&j==1&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:14:29: error: 'ans' was not declared in this scope 14 | if(i==1&&j==1&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^~~ a.cc:14:33: error: 'a' was not declared in this scope 14 | if(i==1&&j==1&&l==1)ans=a[0]+a[1]+a[3]+a[4]-1; | ^ a.cc:15:18: error: 'j' was not declared in this scope 15 | if(i==0&&j==1&&l==1){ | ^ a.cc:15:24: error: 'l' was not declared in this scope 15 | if(i==0&&j==1&&l==1){ | ^ a.cc:16:25: error: 'ans' was not declared in this scope 16 | if(i>=2)ans=a[0]+a[1]+a[3]+a[4]; | ^~~ a.cc:16:29: error: 'a' was not declared in this scope 16 | if(i>=2)ans=a[0]+a[1]+a[3]+a[4]; | ^ a.cc:17:22: error: 'ans' was not declared in this scope 17 | else ans=a[0]+a[1]+a[3]+a[4]-2; | ^~~ a.cc:17:26: error: 'a' was not declared in this scope 17 | else ans=a[0]+a[1]+a[3]+a[4]-2; | ^ a.cc:19:5: error: 'cout' was not declared in this scope 19 | cout<<ans*2; | ^~~~ a.cc:19:11: error: 'ans' was not declared in this scope 19 | cout<<ans*2; | ^~~
s282993808
p03840
C++
I,O,T,J,L,S,Z=[int(i) for i in input().split()] ans=O ans+=int(J/2)*2 J%=2 ans+=int(L/2)*2 L%=2 if J==1 and L==1 and I>=1: I-=1 J-=1 L-=1 ans+=3 ans+=int(I/2)*2 I%=2 print(ans)
a.cc:1:1: error: 'I' does not name a type 1 | I,O,T,J,L,S,Z=[int(i) for i in input().split()] | ^
s314980962
p03840
C++
#include <stdio.h> #include <bits/stdc++.h> #define pb push_back #define pf push_front #define pp pop_back #define sz(a) (int)(a.size()) #define mp make_pair #define F first #define S second #define next _next #define prev _prev #define left _left #define right _right #define y1 _y1 #define all(x) x.begin(), x.end() #define what_is(x) #x << " is " << (x) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int N = (int)1e6 + 123; const ll INF = (ll)1e18 + 123; const int inf = (int)1e9 + 123; const int MOD = (int)1e9 + 7; void megaRandom() { unsigned int FOR; asm("rdtsc" : "=A"(FOR)); srand(FOR); } ll a[10]; int main() { megaRandom(); for(int i = 1; i <= 7; i ++) cin >> a[i]; ll k = a[2] * 2, k2 = k, res = 0; for(int it = 0; it <= min({(int)1e8, a[1], a[4], a[5]}); it ++) { a[1] -= it, a[4] -= it, a[5] -= it; ll now = k + (a[1] / 2) * 4 + (a[4] / 2) * 4 + (a[5] / 2) * 4; res = max(res, now); a[1] += it, a[4] += it, a[5] += it; } cout << res / 2; return 0; }
a.cc: In function 'int main()': a.cc:46:34: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 46 | for(int it = 0; it <= min({(int)1e8, a[1], a[4], a[5]}); it ++) { | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:2: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /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, 1 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: template argument deduction/substitution failed: a.cc:46:34: note: deduced conflicting types for parameter '_Tp' ('int' and 'long long int') 46 | for(int it = 0; it <= min({(int)1e8, a[1], a[4], a[5]}); it ++) { | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /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: candidate expects 2 arguments, 1 provided
s225958046
p03840
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int i,o,t,j,l,s,z; int main() { cin >>i>>o>>t>>j>>l>>s>>z; int result = 0; result += o; int v1 = 0; int v2 = 0; int cou; cou = i / 2; v1 += cou * 2; cou = l / 2; v1 += cou * 2; cou = j / 2; v1 += cou * 2; if(i > 0 && j > 0 && l > 0) { v1 = 3; i--;j--;k--; cou = i / 2; v2 += cou * 2; cou = l / 2; v2 += cou * 2; cou = j / 2; v2 += cou * 2; } cout << result + max(v1,v2) << endl; }
a.cc: In function 'int main()': a.cc:31:13: error: 'k' was not declared in this scope 31 | i--;j--;k--; | ^
s761330924
p03840
C++
#include <bits/stdc++.h> #define LL long long using namespace std; LL I, O, J, L; inline LL Min(LL x, LL y, LL z) { return min(x, min(y, z)); } int main() { #ifdef hk_cnyali freopen("C.in", "r", stdin); freopen("C.out", "w", stdout); #endif LL x; scanf("%lld%lld%lld%lld%lld", &I, &O, &x, &J, &L); LL Ans = O; Ans = max(Ans, Ans + I / 2 * 2 + J / 2 * 2 + L / 2 * 2 + (I % 2 && J % 2 && L % 2) ? 1 : 0); LL k = Min(I, J, L); Ans = max(Ans, Ans + k * 3 + (I - k) / 2 * 2 + (J - k) / 2 * 2 + (L - k) / 2 * 2); cout<<Ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:18: error: no matching function for call to 'max(long long int&, int)' 18 | Ans = max(Ans, Ans + I / 2 * 2 + J / 2 * 2 + L / 2 * 2 + (I % 2 && J % 2 && L % 2) ? 1 : 0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:18:18: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 18 | Ans = max(Ans, Ans + I / 2 * 2 + J / 2 * 2 + L / 2 * 2 + (I % 2 && J % 2 && L % 2) ? 1 : 0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:18:18: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 18 | Ans = max(Ans, Ans + I / 2 * 2 + J / 2 * 2 + L / 2 * 2 + (I % 2 && J % 2 && L % 2) ? 1 : 0); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s318591625
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ai, ao, at, aj, al, as, az, ans; int main() { cin >> ai >> ao >> at >> aj >> al >> as >> az; if(ai & 1) { if(aj > 0 && al > 0) { aj--; al--; ans = max(ans, ai + ao + (aj / 2) * 2 + (al / 2) * 2); } else { ans = max(ans, ai - 1 + ao + (aj / 2) * 2 + (al / 2) * 2); } ans = max(ans, (ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:9:12: note: to match this '{' 9 | int main() { | ^
s610391869
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ai, ao, at, aj, al, as, az, ans; int main() { cin >> ai >> ao >> at >> aj >> al >> as >> az; if(ai & 1) { if(aj > 0 && al > 0) { aj--; al--; ans = max(ans, ai + ao + (aj / 2) * 2 + (al / 2) * 2); } else { ans = max(ans, ai - 1 + ao + (aj / 2) * 2 + (al / 2) * 2); } ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:14: error: no matching function for call to 'max(ll)' 21 | ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:21:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:9:12: note: to match this '{' 9 | int main() { | ^
s116866641
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ai, ao, at, aj, al, as, az, ans; int main() { cin >> ai >> ao >> at >> aj >> al >> as >> az; if(ai & 1) { if(aj > 0 && al > 0) { aj--; al--; ans = max(ans, ai + ao + (aj / 2) * 2 + (al / 2) * 2); } else { ans = max(ai - 1 + ao + (aj / 2) * 2 + (al / 2) * 2); } ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:22: error: no matching function for call to 'max(ll)' 18 | ans = max(ai - 1 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:18:22: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 18 | ans = max(ai - 1 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided a.cc:21:14: error: no matching function for call to 'max(ll)' 21 | ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:21:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | ans = max((ai / 2) * 2 + ao + (aj / 2) * 2 + (al / 2) * 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:9:12: note: to match this '{' 9 | int main() { | ^
s568533504
p03840
C++
#include <iostream> #include <algorithm> #include <string> #include <stack> #include <queue> #include <vector> #include <set> #include <cmath> #define FOR(i,a,b) for(int i=a;i<b;i++) #define ROF(i,a,b) for(int i=b-1;i>=a;i--) #define FI first #define SE second #define MA(i,j) make_pair(i,j) #define PA pair<int,int> #define PB push_back #define PQ priority_queue<int> #define PGQ priority_queue<int,vector<int>,greater<int> > #define VE vector<int> #define VP vector<PA> #define YES(i) cout<<(i?"YES":"NO")<<endl #define Yes(i) cout<<(i?"Yes":"No")<<endl #define MOD 1000000007 #define INF 1000000007 using namespace std; // int main(){ int A[7]; FOR(i,0,7){ cin>>A[i]; } int K=0; K+=A[0]/2*4; K+=A[1]*2; K+=A[3]/4*6; K+=A[4]/4*=6; cout<<K/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:35:10: error: lvalue required as left operand of assignment 35 | K+=A[4]/4*=6; | ~~~~^~
s810421904
p03840
C++
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(c) begin(c),end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } signed main() { cin.tie(0); ios::sync_with_stdio(false); int I, O, T, J; cin >> I >> O >> T >> J; int L, S, Z; cin >> L >> S >> Z; int K = O; int k = 0; for (int x = 0; x < 1000; x++) { if (x > min(I, L, J))continue; chmax(k, (I - x) / 2 + (J - x) / 2 + (L - x) / 2 + x * 3); } K += k; cout << K << endl; return 0; }
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:26:14: required from here 26 | if (x > min(I, L, J))continue; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s778595646
p03840
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class L { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String[] data = bf.readLine().split(" "); long rta = 0; long l,ai,aj,al; rta +=Long.parseLong(data[1]); aj= Long.parseLong(data[3]); al = Long.parseLong(data[4]); ai = Long.parseLong(data[0]); l = Math.min(aj, Math.min(ai, al)); rta +=l; al-=l; aj -=l; ai-=l; rta +=(al)-(al%2); rta +=(aj)-(aj%2); rta +=(ai)-(ai%2); System.out.println(rta); } }
Main.java:5: error: class L is public, should be declared in a file named L.java public class L { ^ 1 error
s984078427
p03840
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class L { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String[] data = bf.readLine().split(" "); long rta = 0; rta +=Long.parseLong(data[1]); long l = Long.parseLong(data[3]); rta += l-(l%2); l = Long.parseLong(data[4]); rta += l-(l%2); l = Long.parseLong(data[0]); rta += l-(l%2); System.out.println(rta); } }
Main.java:5: error: class L is public, should be declared in a file named L.java public class L { ^ 1 error
s889583820
p03840
C++
#include <bits/stdc++.h> using namespace std; #define forn(i, s, f) for(int i = (s); i <= (f); ++i) #define for1(i, f, s) for(int i = (f); i >= (s); --i) #define fora(i, x) for (auto i : x) #define show(x) cout << #x << " = " << x << " "; #define skip continue; #define pb push_back #define _1 first #define _2 second typedef long long ll; const int N3 = 1e3 + 5; const int N4 = 1e4 + 5; const int N5 = 1e5 + 5; const int N6 = 1e6 + 5; const int N7 = 1e7 + 5; const int N8 = 1e8 + 5; const int N9 = 1e9 + 5; const int mod = N9 + 2; int ans, a[8], x, res; int main() { forn (i, 1, 7) cin >> a[i], b[i] = a[i]; x = min({a[1], a[4], a[5]}); ans += x; a[1] -= x, a[4] -= x, a[5] -= x; res = b[1] - (b[1] % 2 == 1); res *= 2; if (b[1] && b[4] && b[5]) ++res; cout << max(ans, res) + a[2]; }
a.cc: In function 'int main()': a.cc:31:22: error: 'b' was not declared in this scope 31 | cin >> a[i], b[i] = a[i]; | ^ a.cc:35:11: error: 'b' was not declared in this scope 35 | res = b[1] - (b[1] % 2 == 1); | ^
s161627745
p03840
C++
#include <iostream> using namespace std; typedef long long lli; lli i,o,t,j,l,s,z; lli ans = 0; int main(){ cin >> i >> o >> t >> j >> l >> s >> z; ans = o; lli t = max({i,j,l}); lli s = (i - t) / 2 * 2 + (j - t) / 2 * 2 + (l - t) / 2 * 2 + t * 3; lli u = i / 2 * 2 + j / 2 * 2 + l / 2 * 2 + (i%2 && j%2 && l%2 ? 3 : 0); cout << ans + max(s,u) << endl; }
a.cc: In function 'int main()': a.cc:9:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)' 9 | lli t = max({i,j,l}); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided
s230052189
p03840
C
#include<stdio.h> int* make_sequence(int*); int calculate(int*); int main(){ int sequence[7]; int K=(calculate(make_sequence(sequence)); printf("%d\n",K); } int* make_sequence(int *temp){ static int nsequence[4]; for(int i=0; i<7; i++) { scanf("%d",&temp[i]); if((i==0) || (i==1) || (i==3) || (i==4)) nsequence[i]=temp[i]; } return nsequence; } int calculate(int *temp){ int min=0; int k=0; if((temp[0]>1) && (temp[1]==0) && (temp[2]==0) && (temp[3]==0)) k+=4*(temp[0]/2); if(temp[1]!=0) k+=(2*temp[1]); if((temp[0]==2) && (temp[2]==1) && (temp[3]==1)) k=8+temp[1]*2; for(int i=0; i<4; i++){ if(min>temp[i]) min=temp[i]; } if((temp[0]>0) && (temp[2]>0) && temp[3]>0){ k+=(min*6); temp[0]-=min; temp[1]-=min; temp[2]-=min; if(temp[0]>0) k+=((temp[0]/2)*4); } return k/2; }
main.c: In function 'main': main.c:8:44: error: expected ')' before ';' token 8 | int K=(calculate(make_sequence(sequence)); | ~ ^ | ) main.c:10:1: error: expected ',' or ';' before '}' token 10 | } | ^ main.c:40:6: error: expected declaration or statement at end of input 40 | } | ^
s907469086
p03840
Java
public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int xi = sc.nextInt(); int xo = sc.nextInt(); int xt = sc.nextInt(); int xj = sc.nextInt(); int xl = sc.nextInt(); int ans = 0; if( xj%2 == 1 && xl%2 == 1 && xi >= 1 ){ ans += 3; xj--; xl--; xi--; } ans += (xj/2)*2; ans += (xl/2)*2; ans += (xi/2)*2; ans += xo; System.out.println(ans); return; } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s851699737
p03840
C++
#include <iostream> #include <vector> #include <cstdio> #include <algorithm> #define rep(i,n) for(int i = 0; i < n; i++) using namespace std; vector<string> split(const string &str, char sep){ std::vector<std::string> v; auto first = str.begin(); while(first != str.end()){ auto last = first; while(last != str.end() && *last != sep) ++last; v.push_back(std::string(first,last)); if(last!=str.end()) ++last; first=last; } return v; } long long ai,ao,at,aj,al,as,az; long long ans; int main(){ cin>>ai>>ao>>at>>aj>>al>>as>>az; ans=ao; int x=min({ai,aj,al}); rep(i,min((long long)10,x+1){ ans=max(ans,ao+i*3+((ai-i)/2)*2+((aj-i)/2)*2+((al-i)/2)*2); } cout<<ans<<endl; return 0; }
a.cc:30:2: error: unterminated argument list invoking macro "rep" 30 | } | ^ a.cc: In function 'int main()': a.cc:25:5: error: 'rep' was not declared in this scope 25 | rep(i,min((long long)10,x+1){ | ^~~ a.cc:25:8: error: expected '}' at end of input 25 | rep(i,min((long long)10,x+1){ | ^ a.cc:21:11: note: to match this '{' 21 | int main(){ | ^
s254441547
p03840
C++
#include <iostream> #include <ccomplex> #include <vector> #include <cassert> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <numeric> #include <list> #include <assert.h> #include <math.h> #include <valarray> #include <stdio.h> #include <algorithm> #include <set> #include <complex> #include <list> #include <time.h> #include <stack> #include <locale> #include <clocale> #include <ctype.h> #include <wchar.h> using namespace std; typedef long long int LL; typedef pair<long long int, long long int> pii; typedef pair<double, double> pdd; #define SORT(c) sort((c).begin(),(c).end()) #define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>()) #define FOR(i,a,b) for(LL i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(x) (x).begin(),(x).end() LL mod = 1000000007; typedef int LL; int main() { int aI, aO, aT, aJ, aL, aS, aZ; cin>> aI >> aO >> aT >> aJ >> aL >> aS>>aZ; int sum = aO; if (aI % 2 == 0) { sum += aI; aI = 0; } else { sum += aI - 1; aI = 1; } if (aL % 2 == 0) { sum += aL; aL = 0; } else { sum += aL - 1; aL = 1; } if (aJ % 2 == 0) { sum += aJ; aJ = 0; } else { sum += aJ - 1; aJ = 1; } if (aI == 1 && aJ == 1 && aL == 1) { sum += 3; } cout << sum << endl; }
a.cc:45:13: error: conflicting declaration 'typedef int LL' 45 | typedef int LL; | ^~ a.cc:32:23: note: previous declaration as 'typedef long long int LL' 32 | typedef long long int LL; | ^~
s009447865
p03840
C++
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <iomanip> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define LONG_INF 100000000000000 int main() { long long a, b, c, d, e, f, g; cin >> a >> b >> c >> d >> e >> f >> g; long long ans = 2 * b; ans += min(a, d, e) * 6; a -= min(a, d, e); long long pre = a / 2; ans += pre * 4; ans += min(d, e) * 4; cout << ans/2 << endl; return 0; }
In file included from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]': a.cc:31:12: required from here 31 | ans += min(a, d, e) * 6; | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s033913753
p03840
C++
#include <iostream> #include <string> #include <algorithm> #include <cstdio> using namespace std; int main() { int i,o,t,j,l,s,z; cin >> i >> o >> t >> j >> l >> s >> z; int a = 4 * (i / 2) + 2 * o + 4 * min(j,l); int b = //0;4 * ((i-1) / 2) + 2 * o + 4 * min(j-1,l-1) + 6; cout << max(a,b) / 2; return 0; }
a.cc: In function 'int main()': a.cc:18:14: error: cannot convert 'std::basic_ostream<char>' to 'int' in initialization 18 | cout << max(a,b) / 2; | ~~~~~^~~~~~~~~~~~~~~ | | | std::basic_ostream<char>
s053732358
p03840
C++
#include <cstdio> #include <iostream> #include <iomanip> #include <sstream> #include <cmath> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <queue> #include <deque> #include <stack> #include <list> #include <bitset> #include <utility> #include <ctime> #include <cassert> #include <climits> using namespace std; #define TRACE #ifdef TRACE template<class T, class U> ostream& operator<<(ostream& out, const pair<T,U>& a){out<<"["<<a.first<<" "<<a.second<<"]";return out;} template<class T> ostream& operator<<(ostream& out, const vector<T>& a){out<<"[ ";for(auto &it:a)out<<it<<" ";out<<"]";return out;} template<class T> ostream& operator<<(ostream& out, const set<T>& a){out<<"[ ";for(auto &it:a)out<<it<<" ";out<<"]";return out;} template<class T> ostream& operator<<(ostream& out, const multiset<T>& a){out<<"[ ";for(auto &it:a)out<<it<<" ";out<<"]";return out;} template<class T,class U> ostream& operator<<(ostream& out, const map<T,U>& a){for(auto &it:a)out<<it.first<<" -> "<<it.second<<" | ";return out;} template<class T,class U> ostream& operator<<(ostream& out, const multimap<T,U>& a){for(auto &it:a)out<<it.first<<" -> "<<it.second<<" | ";return out;} #define pra(a,n) cerr<<#a<<" : ";for(int i=0;i<n;++i)cerr<<a[i]<<" ";cerr<<endl; #define praa(a,n,m) cerr<<#a<<" : "<<endl;for(int i=0;i<n;++i){for(int j=0;j<m;++j)cerr<<a[i][j]<<" ";cerr<<endl;} #define pr(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char* name, Arg1&& arg1){ cerr << name << " : " << arg1 << std::endl; } template <typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...); } #else #define pr(...) #define pra(a,n) #define praa(a,n,m) #endif #define int long long void Main() { int ai, ao, at, aj, as, az; cin >> ai >> ao >> at >> aj >> as >> az; int ans = ao + ai - ai % 2 + aj - aj % 2 + al - al % 2 + (ai % 2 and aj % 2 and ai % 2) * 3; cout << ans << "\n"; } #undef int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); //freopen("", "r", stdin); //freopen("", "w", stdout); Main(); }
a.cc: In function 'void Main()': a.cc:61:48: error: 'al' was not declared in this scope; did you mean 'az'? 61 | int ans = ao + ai - ai % 2 + aj - aj % 2 + al - al % 2 + (ai % 2 and aj % 2 and ai % 2) * 3; | ^~ | az
s930141096
p03840
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++) #define REP(i,b) FOR(i,0,b) using namespace std; LL N,K; LL A[SIZE]; int main(){ REP(i,7){ cin >> A[i]; } LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2; if((A[0] && A[3] && A[4] )){ ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3); } cout << ans << endl; return 0; }
a.cc:5:1: error: 'LL' does not name a type 5 | LL N,K; | ^~ a.cc:6:1: error: 'LL' does not name a type 6 | LL A[SIZE]; | ^~ a.cc: In function 'int main()': a.cc:2:24: error: 'ut' was not declared in this scope 2 | #define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++) | ^~ a.cc:3:18: note: in expansion of macro 'FOR' 3 | #define REP(i,b) FOR(i,0,b) | ^~~ a.cc:8:9: note: in expansion of macro 'REP' 8 | REP(i,7){ | ^~~ a.cc:8:13: error: 'i' was not declared in this scope 8 | REP(i,7){ | ^ a.cc:2:33: note: in definition of macro 'FOR' 2 | #define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++) | ^ a.cc:8:9: note: in expansion of macro 'REP' 8 | REP(i,7){ | ^~~ a.cc:9:24: error: 'A' was not declared in this scope 9 | cin >> A[i]; | ^ a.cc:11:9: error: 'LL' was not declared in this scope 11 | LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2; | ^~ a.cc:12:13: error: 'A' was not declared in this scope 12 | if((A[0] && A[3] && A[4] )){ | ^ a.cc:13:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3); | ^~~ | abs a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | cout << ans << endl; | ^~~ | abs
s137118018
p03840
C++
#include <bits/stdc++.h> using namespace std; LL N,K; LL A[SIZE]; int main(){ REP(i,7){ cin >> A[i]; } LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2; if((A[0] && A[3] && A[4] )){ ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3); } cout << ans << endl; return 0; }
a.cc:3:1: error: 'LL' does not name a type 3 | LL N,K; | ^~ a.cc:4:1: error: 'LL' does not name a type 4 | LL A[SIZE]; | ^~ a.cc: In function 'int main()': a.cc:6:13: error: 'i' was not declared in this scope 6 | REP(i,7){ | ^ a.cc:6:9: error: 'REP' was not declared in this scope 6 | REP(i,7){ | ^~~ a.cc:9:9: error: 'LL' was not declared in this scope 9 | LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2; | ^~ a.cc:10:13: error: 'A' was not declared in this scope 10 | if((A[0] && A[3] && A[4] )){ | ^ a.cc:11:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3); | ^~~ | abs a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | cout << ans << endl; | ^~~ | abs
s707370643
p03840
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define INF 999999999 #define MOD 1000000007 int main() { int i,o,t,j,l,s,z; ll res=0; cin >> i; cin >> o; cin >> t; cin >> j; cin >> l; cin >> s; cin >> z; g = i%2 + j%2 + l%2; res += (i/2) * 4; res += o*2; res += (j/2) * 4; res += (l/2) * 4; if(g == 3){ res += 6 } if(g == 2 && i > 0 && j > 0 && l > 0){ res += 2; } cout << res / 2; }
a.cc: In function 'int main()': a.cc:21:9: error: 'g' was not declared in this scope 21 | g = i%2 + j%2 + l%2; | ^ a.cc:27:25: error: expected ';' before '}' token 27 | res += 6 | ^ | ; 28 | } | ~
s256704290
p03840
C++
#include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <vector> using namespace std; int a[10]; int main() { int sum = 0; for(int i = 1; i <= 7; i ++) cin >> a[i]; long long ans = 0; ans += a[1] / 2 * 2; ans += a[2]; ans += a[4] / 2 * 2; ans += a[5] / 2 * 2; if(a[1]-- && a[4]-- && a[5]--) ans = max(ans, 3 + a[1]/2*2+a[4]/2*2+a[5]/2*2 + a[2]); printf("%lld\n", ans); }
a.cc: In function 'int main()': a.cc:21:49: error: no matching function for call to 'max(long long int&, int)' 21 | if(a[1]-- && a[4]-- && a[5]--) ans = max(ans, 3 + a[1]/2*2+a[4]/2*2+a[5]/2*2 + a[2]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:4: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:21:49: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 21 | if(a[1]-- && a[4]-- && a[5]--) ans = max(ans, 3 + a[1]/2*2+a[4]/2*2+a[5]/2*2 + a[2]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:21:49: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 21 | if(a[1]-- && a[4]-- && a[5]--) ans = max(ans, 3 + a[1]/2*2+a[4]/2*2+a[5]/2*2 + a[2]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s811241569
p03840
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <cassert> #include <cstddef> #include <iomanip> #include <numeric> #include <tuple> #include <sstream> #include <fstream> using namespace std; #define REP(i, n) for (int (i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++) #define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--) #define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--) #define DEBUG(C) cerr << #C << " = " << C << endl; using LL = long long; using VI = vector<int>; using VVI = vector<VI>; using VL = vector<LL>; using VVL = vector<VL>; using VD = vector<double>; using VVD = vector<VD>; using PII = pair<int, int>; using PDD = pair<double, double>; using PLL = pair<LL, LL>; using VPII = vector<PII>; template<typename T> using VT = vector<T>; #define ALL(a) begin((a)), end((a)) #define RALL(a) rbegin((a)), rend((a)) #define SORT(a) sort(ALL((a))) #define RSORT(a) sort(RALL((a))) #define REVERSE(a) reverse(ALL((a))) #define MP make_pair #define FORE(a, b) for (auto &&a : (b)) #define FIND(s, e) ((s).find(e) != (s).end()) #define EB emplace_back const int INF = 1e9; const int MOD = INF + 7; const LL LLINF = 1e18; char C[] = {'I', 'O', 'T', 'J', 'L', 'S', 'Z'}; int func1(map<char, LL> mp) { LL ans = mp['O']; LL buf = mp['I'] / 2; ans += (buf) * 2; LL buf = mp['L'] / 2; ans += (buf) * 2; LL buf = mp['J'] / 2; ans += (buf) * 2; mp['I'] %= 2; mp['L'] %= 2; mp['J'] %= 2; return ans; } int func2(map<char, LL> mp) { LL ans = mp['O']; if (mp['I'] > 0 && mp['L'] > 0 && mp['J'] > 0) { mp['I'] --; mp['J'] --; mp['L'] --; ans += 3; } LL buf = mp['I'] / 2; ans += (buf) * 2; LL buf = mp['L'] / 2; ans += (buf) * 2; LL buf = mp['J'] / 2; ans += (buf) * 2; mp['I'] %= 2; mp['L'] %= 2; mp['J'] %= 2; return ans; } int main(void) { map<char, LL> mp; REP(i, 7) { LL buf; scanf("%lld", &buf); mp[C[i]] = buf; } cout << max(func1(mp), func2(mp)) << endl; }
a.cc: In function 'int func1(std::map<char, long long int>)': a.cc:69:8: error: redeclaration of 'LL buf' 69 | LL buf = mp['L'] / 2; | ^~~ a.cc:67:8: note: 'LL buf' previously declared here 67 | LL buf = mp['I'] / 2; | ^~~ a.cc:71:8: error: redeclaration of 'LL buf' 71 | LL buf = mp['J'] / 2; | ^~~ a.cc:67:8: note: 'LL buf' previously declared here 67 | LL buf = mp['I'] / 2; | ^~~ a.cc: In function 'int func2(std::map<char, long long int>)': a.cc:92:8: error: redeclaration of 'LL buf' 92 | LL buf = mp['L'] / 2; | ^~~ a.cc:90:8: note: 'LL buf' previously declared here 90 | LL buf = mp['I'] / 2; | ^~~ a.cc:94:8: error: redeclaration of 'LL buf' 94 | LL buf = mp['J'] / 2; | ^~~ a.cc:90:8: note: 'LL buf' previously declared here 90 | LL buf = mp['I'] / 2; | ^~~
s675324116
p03840
C++
#include <algorithm> #include <iostream> long long i, o, t, j, l, s, z; int main() { std::cin >> i >> o >> t >> j >> l >> s >> z; std::cout << std::max(i / 2 * 2 + o + j / 2 * 2 + l / 2 * 2), ((i - 1) / 2 * 2 + o + (j - 1) / 2 * 2 + (l - 1) / 2 * 2 + 1)) << std::endl; }
a.cc: In function 'int main()': a.cc:9:26: error: no matching function for call to 'max(long long int)' 9 | std::cout << std::max(i / 2 * 2 + o + j / 2 * 2 + l / 2 * 2), ((i - 1) / 2 * 2 + o + (j - 1) / 2 * 2 + (l - 1) / 2 * 2 + 1)) << std::endl; | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:9:26: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 9 | std::cout << std::max(i / 2 * 2 + o + j / 2 * 2 + l / 2 * 2), ((i - 1) / 2 * 2 + o + (j - 1) / 2 * 2 + (l - 1) / 2 * 2 + 1)) << std::endl; | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided
s512941596
p03840
C++
#include <bits/stdc++.h> using namespace std; long long i,o,t,j,l,s,z; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>i>>o>>t>>j>>l>>s>>z; long long ans=0; ans=2*(int)(i/2)+o+2*(int)(j/2)+2*(int)(l/2); if(i-1>=0 && j-1>=0 && l-1>=0)2ans=max(ans,2*(int)((i-1)/2)+o+2*(int)((j-1)/2)+2*(int)((l-1)/2)+3); cout<< ans; return 0; }
a.cc: In function 'int main()': a.cc:13:35: error: unable to find numeric literal operator 'operator""ans' 13 | if(i-1>=0 && j-1>=0 && l-1>=0)2ans=max(ans,2*(int)((i-1)/2)+o+2*(int)((j-1)/2)+2*(int)((l-1)/2)+3); | ^~~~
s022791393
p03840
C++
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "<<x<<endl; #define MOD 1000000007 ll a, b, c, d, e, f, g; ll f1(ll p){ ll a1 = a-p; ll d1 = d-p; ll e1 = e-p; ll ret = 0; ret += (a1/2)*2; ret += (d1/2)*2; ret += (e1/2)*2; return ret + p*3; } int main() { cin >> a >> b >> c >> d >> e >> f >> g; ll mx = min(a,min(d,e)); ll ans = 0; ans += b; long long left = 0; long long right = mx; while (left != right) { long long d1 = (right - left) / 3; long long l = f1(left + d1); long long r = f1(right - d1); if (d1 == 0) { if (l < r)left++; else right--; } else { if (l < r)left = left + d1; else right = right - d1; } } ans += f(left); printf("%lld\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:72:11: error: 'f' cannot be used as a function 72 | ans += f(left); | ~^~~~~~
s352828958
p03840
C++
#include <iostream> #include <vector> #include <utility> #define DEB1(x) std::cout << (x) << std::endl; int n; std::pair<int, int> arr[501]; int cntl[501], cntr[501]; int main() { std::cin >> n; for(int i = 0; i < n; ++i) { cntl[i] = i; cntr[i] = n - i - 1; std::cin >> arr[i].first; --arr[i].first; arr[i].second = i; } std::sort(arr, arr + n); int a = 0, b = 0; std::vector<int> vec; vec.reserve(n * n); for(int i = 0; i < n * n; ++i) { // DEB1(b) if(a != n && i == arr[a].first) { if(cntl[arr[a].second] != 0) { std::cout << "No" << std::endl; return 0; } vec.push_back(arr[a].second + 1); ++a; }else if(b < n) { while(cntl[arr[b].second] == 0) { ++b; if(n <= b) { goto SECOND; } } --cntl[arr[b].second]; vec.push_back(arr[b].second + 1); }else { SECOND:; if(b - n >= a) { std::cout << "No" << std::endl; return 0; } while(cntr[arr[b - n].second] == 0) ++b; --cntr[arr[b - n].second]; vec.push_back(arr[b - n].second + 1); } } for(int i = 0; i < n; ++i) { if(cntl[i] != 0 || cntr[i] != 0) { std::cout << "No" << std::endl; return 0; } } std::cout << "Yes" << std::endl; for(int i = 0; i < n * n; ++i) { std::cout << vec[i] << (i == n * n - 1 ? "\n" : " "); } }
a.cc: In function 'int main()': a.cc:21:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 21 | std::sort(arr, arr + n); | ^~~~ | qsort
s339133160
p03840
C++
#include <algorithm> #include <iostream> #include <cstdio> #include <map> #include <numeric> #include <cmath> #include <set> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <complex> #include <string.h> #include <unordered_set> #include <unordered_map> #include <bitset> #include <iomanip> #include <sys/time.h> #include <random> using namespace std; #define endl '\n' #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) #define int long long typedef complex<double> comp; typedef vector< vector<ld> > matrix; struct pairhash { public: template<typename T, typename U> size_t operator()(const pair<T, U> &x) const { size_t seed = hash<T>()(x.first); return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2); } }; const int inf = 1e9 + 9; const double eps = 1e-8; const double pi = acos(-1); int a[7]; int solve() { int res = 2 * a[1]; if (a[0]%2==1) { if (a[3] > 0 && a[4] > 0) { res += 6; a[0]--; a[3]--; a[4]--; } } res += (a[0] / 2) * 4; res += 4 * min(a[3], a[4]); return res / 2; } void input() { for (int i = 0; i < 7; i++) cin >> a[i]; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); input(); cout << solve() << endl; }
a.cc:34:24: error: 'ld' was not declared in this scope 34 | typedef vector< vector<ld> > matrix; | ^~ a.cc:34:26: error: template argument 1 is invalid 34 | typedef vector< vector<ld> > matrix; | ^ a.cc:34:26: error: template argument 2 is invalid a.cc:34:28: error: template argument 1 is invalid 34 | typedef vector< vector<ld> > matrix; | ^ a.cc:34:28: error: template argument 2 is invalid
s251396879
p03840
C
#include<stdio.h> int main(void){ unsigned long long int i,o,t,j,l,s,z,r=0; scanf("%llu%llu%llu%llu%llu%llu%llu",&i,&o,&t,&j,&l,&s,&z); r+=(o+i+t+j); printf("%llu\n",r-1) return 0; }
main.c: In function 'main': main.c:7:29: error: expected ';' before 'return' 7 | printf("%llu\n",r-1) | ^ | ; 8 | return 0; | ~~~~~~
s254947576
p03840
C++
#include <algorithm> #include <iostream> #include <cstdio> #include <map> #include <numeric> #include <cmath> #include <set> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <complex> #include <string.h> #include <unordered_set> #include <unordered_map> #include <bitset> #include <iomanip> #include <sys/time.h> #include <random> using namespace std; #define endl '\n' #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) #define int long long typedef complex<double> comp; typedef vector< vector<ld> > matrix; struct pairhash { public: template<typename T, typename U> size_t operator()(const pair<T, U> &x) const { size_t seed = hash<T>()(x.first); return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2); } }; const int inf = 1e9 + 9; const ll mod = 1e9 + 7; const double eps = 1e-8; const double pi = acos(-1); int a[7]; int solve() { int res = 2 * a[1]; if (a[0]%2==1) { if (a[3] > 0 && a[4] > 0) { res += 6; a[0]--; a[3]--; a[4]--; } } res += (a[0] / 2) * 4; res += 4 * min(a[3], a[4]); return res / 2; } void input() { for (int i = 0; i < 7; i++) cin >> a[i]; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); input(); cout << solve() << endl; }
a.cc:34:24: error: 'ld' was not declared in this scope 34 | typedef vector< vector<ld> > matrix; | ^~ a.cc:34:26: error: template argument 1 is invalid 34 | typedef vector< vector<ld> > matrix; | ^ a.cc:34:26: error: template argument 2 is invalid a.cc:34:28: error: template argument 1 is invalid 34 | typedef vector< vector<ld> > matrix; | ^ a.cc:34:28: error: template argument 2 is invalid a.cc:44:7: error: 'll' does not name a type 44 | const ll mod = 1e9 + 7; | ^~
s063781122
p03840
C++
#include <bits/stdc++.h> using namespace std; long long a[7]; int main() { for (int i = 0; i < 7; i++){ cin >> a[i]; } long long m = min(min(a[0], a[3]), a[4]); /* a[0] -= m; a[3] -= m; a[4] -= m; */ long long ans = 0; for (int i = 0; i <= min(m, 100); i++){ ans = max(ans, 3 * i + (a[0] - i) / 2 * 2 + (a[3] - i) / 2 * 2 + (a[4] - i) / 2 * 2); } cout << ans + a[1] << endl; }
a.cc: In function 'int main()': a.cc:19:27: error: no matching function for call to 'min(long long int&, int)' 19 | for (int i = 0; i <= min(m, 100); i++){ | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:19:27: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 19 | for (int i = 0; i <= min(m, 100); i++){ | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:19:27: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 19 | for (int i = 0; i <= min(m, 100); i++){ | ~~~^~~~~~~~
s468963611
p03840
C++
#include <iostream> #include <vector> #include <set> #include <algorithm> #include <assert.h> using namespace std; #define rep(i,n) for(int i = 0;i < n;i++) #define each(i,n) for(auto &i : n) #define int long long signed main() { int i, o, t, j, l, s, z; cin >> i >> o >> t >> j >> l >> s >> z; //t,s,z int ans = 0; ans += o; int t = min(i, j, l); i -= t; j -= t; l -= t; int oi = 0, oj = 0, ol = 0; bool f = true; while (f) { f = false; if (i % 2) { oi++; i--; f = true;} if (j % 2) { oj++; j--; f = true;} if (l % 2) { ol++; l--; f = true;} if (oj && ol && oi) { ans += 3; oj--; ol--; oi--; f = true; } if (oj && ol) { ans += 2; oj--; ol--; f = true; } if (oi && oj) { ans += 3; oi--; oj--; l--; f = true; } if (oi && ol) { ans += 3; oi--; ol--; j--; f = true; } if (oj) { ans += 2; oj--; l--; f = true; } if (ol) { ans += 2; ol--; j--; f = true; } } ans += i / 2 * 2; ans += j / 2 * 2; ans += l / 2 * 2; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:13: error: redeclaration of 'long long int t' 23 | int t = min(i, j, l); | ^ a.cc:16:19: note: 'long long int t' previously declared here 16 | int i, o, t, j, l, s, z; | ^ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]': a.cc:23:13: required from here 23 | int t = min(i, j, l); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s779348496
p03840
C++
#include <bits/stdc++.h> using namespace std; typedef long long int64; int main() { int64 a, b, c, d, e, f, g; cin >> a >> b >> c >> d >> e >> f >> g; // d, e, a int64 ret = 0; int64 get; get = d / 2; d -= get * 2; ret += get * 2; get = e / 2; e -= get * 2; ret += get * 2; get = a / 2; a -= get * 2; ret += get * 2; get = b; b -= get; ret += get; get = min({d, e, a}); d -= get; e -= get; a -= get; ret += get * 3; cout << ret << endl; } #include <bits/stdc++.h> using namespace std; typedef long long int64; int main() { int64 A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; int64 z = 0; int64 ss = min({D, E, A}); for(int i = 0; i <= ss; i++) { int64 a = A, b = B, c = C, d = D, e = E, f = F, g = G; int64 ret = 0; int64 get; get = i; d -= get; e -= get; a -= get; ret += get * 3; get = d / 2; d -= get * 2; ret += get * 2; get = e / 2; e -= get * 2; ret += get * 2; get = a / 2; a -= get * 2; ret += get * 2; get = b; b -= get; ret += get; z = max(z, ret); } cout << z << endl; }
a.cc:48:5: error: redefinition of 'int main()' 48 | int main() | ^~~~ a.cc:7:5: note: 'int main()' previously defined here 7 | int main() | ^~~~
s030777823
p03840
C++
#include <iostream> #define int long long using namespace std; int ai, ao, at, aj, al, as, az; signed main() { cin >> ai >> ao >> at >> aj >> al >> as >> az; int ans = ao; //i, j, l int IJL = min(ai, min(aj, al)); int remI = ai - IJL; int remJ = aj - IJL; int remL = al - IJL; if (remJ % 2 == 1 && remL % 2 == 1 && aj >= 2 && aj % 2 == 0 && al >= 2 && al % 2 == 0) { IJL--; remI++; remJ++; remL++; } ans += IJK * 3 + (remJ / 2) * 2 + (remL / 2) * 2 + (remI / 2) * 2; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:16: error: 'IJK' was not declared in this scope; did you mean 'IJL'? 26 | ans += IJK * 3 + (remJ / 2) * 2 + (remL / 2) * 2 + (remI / 2) * 2; | ^~~ | IJL
s308792420
p03840
C++
#include<cstdio> #include<iostream> #include<vector> #include<set> #include<algorithm> using namespace std; long long ans=0; int main(){ int i,o,t,j,l,s,z,t; cin>>i>>o>>t>>j>>l>>s>>z; t=min(i,j); t=min(t,l); ans+=6*t; i-=t; l-=t; j-=t; ans+=o*2; ans+=(i/2)*4; ans+=(j/2)*4; ans+=(l/2)*4; cout<<ans/2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:27: error: redeclaration of 'int t' 9 | int i,o,t,j,l,s,z,t; | ^ a.cc:9:17: note: 'int t' previously declared here 9 | int i,o,t,j,l,s,z,t; | ^
s338650786
p03840
C++
#include<bits/stdc++.h> using namespace std; int a, b; int main () { //freopen ("input", "r", stdin); //freopen ("output", "w", stdout); int a, b, nim, c, d; scanf ("%d %d %d %d %d", &a, &b, &nim, &c, &d); ans = 2 * (a / 2) + b + 2 * (c / 2 + d / 2) + 3 * (c % 2 == 1 && d % 2 == 1 && a % 2 == 1); if (a % 2 == 1 && c >= 1 && d >= 1) ans = max (ans, 2 * (a / 2) + b + 2 * ((c - 1) / 2 + (d - 1) / 2) + 3); printf ("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:14:1: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | ans = 2 * (a / 2) + b + 2 * (c / 2 + d / 2) + 3 * (c % 2 == 1 && d % 2 == 1 && a % 2 == 1); | ^~~ | abs
s014255461
p03841
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define FORR(i, m, n) for (int i = (m); i >= (n); --i) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ll mod = 1000000007; //const ll mod = 998244353; const int inf = 1e9 + 10; const ll INF = 1e18; const ld EPS = 1e-10; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } typedef pair<int, int> P; int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(25); int n; cin >> n; vector<int> x(n); rep(i, n) { cin >> x[i]; x[i]--; } rep(i, n) { rep(j, i) { if (x[i] == x[j]) { cout << "No\n"; return 0; } } } vector<int> cnt(n, 0); priority_queue<P, vector<P>, greater<P>> pq; FOR(i, 1, n) pq.push({x[i] - i, i}); vector<P> p(n); rep(i, n) p[i] = {x[i], i}; sort(p.begin(), p.end()); int idx = 0, res = 0; vector<int> ans(n * n, -1); rep(i, n * n) { if (p[idx].first == i) { if (cnt[p[idx].second] != p[idx].second) { cout << "No\n"; return 0; } ans[i] = p[idx].second; cnt[p[idx].second]++; idx++; } else if (pq.size()) { int now = pq.top().second; pq.pop(); ans[i] = now; cnt[now]++; if (cnt[now] < now) pq.push({x[now] - now + cnt[now], now}); } else { while (cnt[res] == n) res++; ans[i] = res; cnt[res]++; } } cout << "Yes\n"; rep(i, n * n) cout << ans[i] + 1 << ' '; cout << '\n' return 0; }
a.cc: In function 'int main()': a.cc:77:15: error: expected ';' before 'return' 77 | cout << '\n' | ^ | ; ...... 87 | return 0; | ~~~~~~
s568974098
p03841
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex<double> Complex; const int INF = 1e9; const ll MOD = 1e9 + 7; const ll LINF = 1e18; template <class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); } template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); } template <typename T> ostream& operator<<(ostream& os, vector<T> v) { for (int i = 0; i < sz(v); i++) { os << v[i]; if (i < sz(v) - 1) os << " "; } return os; } int main() { int n; cin >> n; vector<pair<int, int>> x(n); rep(i, n) { cin >> x[i].first, x[i].first--; x[i].second = i + 1; } vector<int> ans(n * n, -1); sort(all(x)); queue<int> q, qq; for (auto p : x) { tie(idx, num) = p; ans[idx] = num; rep(_, num - 1) q.push(num); rep(_, n - num) qq.push(num); } rep(i, n * n) { if (ans[i] != -1) { if (q.front() == ans[i]) { cout << "No" << endl; return 0; } } else if (sz(q)) { ans[i] = q.front(); q.pop(); } } cout << ans << endl; rep(i, n * n) { if (ans[i] == -1) { ans[i] = qq.front(); qq.pop(); } } cout << "Yes" << endl; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:57:13: error: 'idx' was not declared in this scope 57 | tie(idx, num) = p; | ^~~ a.cc:57:18: error: 'num' was not declared in this scope; did you mean 'enum'? 57 | tie(idx, num) = p; | ^~~ | enum
s615124194
p03841
C++
mespace std; int main() { int n, mi = 0, ma = 0; cin >> n; vector<P> x(n); vector<int> ans(n*n, -1), a; rep(i, n){ cin >> x[i].first; x[i].second = i+1; ans[x[i].first-1] = i+1; } sort(all(x)); int p = 0, k = 0; rep(i, n){ rep(j, x[i].second-1){ ans[p] = x[i].second; p++; } while(ans[p] == -1 && p < x[i].first-1){ if(k >= a.size()){ cout << "No" << endl; return 0; } ans[p] = a[k]; p++; k++; } rep(j, n-x[i].second)a.push_back(x[i].second); p++; } cout << "Yes" << endl; rep(i, n*n)cout << ans[i] << " "; cout << endl; }
a.cc:1:1: error: 'mespace' does not name a type 1 | mespace std; | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:6:5: error: 'vector' was not declared in this scope 6 | vector<P> x(n); | ^~~~~~ a.cc:6:12: error: 'P' was not declared in this scope 6 | vector<P> x(n); | ^ a.cc:6:15: error: 'x' was not declared in this scope 6 | vector<P> x(n); | ^ a.cc:7:12: error: expected primary-expression before 'int' 7 | vector<int> ans(n*n, -1), a; | ^~~ a.cc:8:9: error: 'i' was not declared in this scope; did you mean 'mi'? 8 | rep(i, n){ | ^ | mi a.cc:8:5: error: 'rep' was not declared in this scope 8 | rep(i, n){ | ^~~ a.cc:13:10: error: 'all' was not declared in this scope 13 | sort(all(x)); | ^~~ a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(all(x)); | ^~~~ | short a.cc:31:5: error: 'cout' was not declared in this scope 31 | cout << "Yes" << endl; | ^~~~ a.cc:31:22: error: 'endl' was not declared in this scope 31 | cout << "Yes" << endl; | ^~~~
s582289907
p03841
C++
#include<cstdio> #include<algorithm> #include<cctype> #include<cstring> #include<iostream> #include<vector> using namespace std; #define bomb exit(1) #define INF 1061109567 #define LINF 4557430888798830399ll #define pprint(x) print(x),putchar(' ') #define fprint(x) print(x),putchar('\n') #define EE(x); struct edge { int nxt,to;ll w; }e[M << 1]; int head[N],ecnt = 1;\ void add(int u,int v,ll w = 0) { e[++ecnt].w = w,e[ecnt].to = v,e[ecnt].nxt = head[u];head[u] = ecnt; }\ void add_edge(int u,int v,ll w = 0) { add(u,v,w),add(v,u,w * x); } #define ll long long const double pi = acos(-1); int mod = 1000000007; ll Mod(ll x) { return x >= mod ? x - mod : x; } #define eps 0.0000000001 #define sqr(x) ((x) * (x)) #define iter iterator #define fi first #define se second //#define getchar() (SS == TT && (TT = (SS = BB) + fread(BB,1,1 << 15,stdin),TT == SS) ? EOF : *SS++) //char BB[1 << 15],*SS = BB,*TT = BB; ll read() { ll x = 0;int f = 1;char ch = getchar(); for(;!isdigit(ch);ch = getchar()) if(ch == '-') f = -1; for(;isdigit(ch);ch = getchar()) x = x * 10 + (ch ^ 48); return x * f; } void print(ll x) { if(x < 0) putchar('-'),x = -x; if(x > 9) print(x / 10);putchar(x % 10 + '0'); } const int N = 510; int n,x[N],c[N],a[N * N]; int main() { n = read(); for(int i = 1;i <= n;i++) x[i] = read(); for(int i = 1;i <= n * n;i++) { for(int j = 1;j <= n;j++) if(x[j] == i) { c[j]++; if(c[j] ^ j) { puts("No");return 0; } a[i] = j; break; } if(!a[i]) { int p = 0,lc = n * n + 2; for(int j = 1;j <= n;j++) if(c[j] < j - 1) if(x[j] < lc) lc = x[j],p = j; if(p) a[i] = p,c[p]++; } if(!a[i]) for(int j = 1;j <= n;j++) if(c[j] < n && x[j] < i) { a[i] = j; c[j]++; break; } if(!a[i]) { puts("No");return 0; } } puts("Yes"); for(int i = 1;i <= n * n;i++) pprint(a[i]); }
a.cc:19:19: error: 'acos' was not declared in this scope 19 | const double pi = acos(-1); | ^~~~
s707278716
p03841
C++
#include <bits/stdc++.h> #include <iomanip> using namespace std; #define reps(i,s,n) for(int i = s; i < n; i++) #define rep(i,n) reps(i,0,n) #define ALL(a) a.begin(), a.end() typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; ll N,M,H,W,K,Q,A,B; int main(){ cin>>N; vec x(N), ans(0), ord(N), oinv(N); rep(i,N) cin>>x[i], --x[i], ord[i] = i; sort(ALL(ord), [&](ll a, ll b){ return x[a] < x[b]; }); rep(i,N) oinv[ord[i]] = i; rep(i,N) rep(j,ord[i]) ans.push_back(ord[i]); rep(i,N) { ll num= ord[i], nx = x[num]; if(nx >= ans.size()){ cout<<"No"<<endl; return 0; } ll tar = ans[nx]; if(oinv[tar] <= i && nx < N*(N-1)/2 + i){ cout<<"No"<<endl; return 0; } insert(ans.begin() + nx, num); rep(j, N-num-1) ans.push_back(num); } rep(i,N*N){ cout<<ans[i]; i == N*N - 1 ? cout<<endl ? cout<<' '; } }
a.cc: In function 'int main()': a.cc:32:7: error: 'insert' was not declared in this scope; did you mean 'assert'? 32 | insert(ans.begin() + nx, num); | ^~~~~~ | assert a.cc:37:42: error: expected ':' before ';' token 37 | i == N*N - 1 ? cout<<endl ? cout<<' '; | ^ | : a.cc:37:42: error: expected primary-expression before ';' token a.cc:37:42: error: expected ':' before ';' token 37 | i == N*N - 1 ? cout<<endl ? cout<<' '; | ^ | : a.cc:37:42: error: expected primary-expression before ';' token
s011308312
p03841
C++
#include <iostream> #include <set> using namespace std; const int N = 502; int n, x[N], ans[N * N]; struct Item { int pre, x, y; // in pre, x show y times bool operator < (const Item & o) const{ return pre < o.pre; } } it[N]; int cnt[N]; void print() { bool ok = 1; for (int i = 1; i <= n * n; i ++) { cnt[ans[i]] ++; if (cnt[ans[i]] == ans[i] && i != x[ans[i]]) { // printf("val = %d, cnt = %d, pos = %d\n", ans[i], cnt[ans[i]], i); ok = 0; } } if (!ok) printf("No\n"); else { printf("Yes\n"); for (int i = 1; i <= n * n; i ++) { printf("%d ", ans[i]); } } } int main() { scanf("%d", &n); set<int> st; for (int i = 1; i <= n * n; i ++) { st.insert(i); } for (int i = 1; i <= n; i ++) { scanf("%d", &x[i]); ans[x[i]] = i; it[i] = (Item){x[i] - 1, i, i - 1}; st.erase(x[i]); } sort(it + 1, it + 1 + n); for (int i = 1; i <= n; i ++) { for (int j = 1; j <= it[i].y; j ++) { if (st.size()) { ans[ * st.begin() ] = it[i].x; st.erase(st.begin()); } } } for (int i = 1; i <= n; i ++) { for (int j = 1; j <= n - i; j ++) { if (st.size()) { ans[ * st.begin() ] = it[i].x; st.erase(st.begin()); } } } print(); }
a.cc: In function 'int main()': a.cc:47:5: error: 'sort' was not declared in this scope; did you mean 'short'? 47 | sort(it + 1, it + 1 + n); | ^~~~ | short
s272669769
p03841
C++
#include <bits/stdc++.h> using namespace std; class dsu { public: int n; vector<int> parent; dsu(int _n) : n(_n) { parent.resize(n); iota(parent.begin(), parent.end(), 0); } int find(int x) { if (x == -1 || x == n || x == parent[x]) { return x; } return parent[x] = find(parent[x]); } }; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> ans(n * n, -1); dsu d_left(n * n), d_right(n * n); vector<int> x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 0; i < n; i++) { int t = i; for (int j = x[i] - 1; j >= 0 && t >= 0; t--, j = d_left.find(j)) { ans[j] = i; d_left.parent[j] = j - 1; } if (t > 0) { cout << "No\n"; return 0; } } for (int i = n * n - 1; i >= 0; i--) { if (a[i] != -1) { d_right.parent[i] = i + 1; } } for (int i = n - 1; i >= 0; i--) { int t = n - i - 1; for (int j = x[i] + 1; j < n * n && t >= 0; t--, j = d_right.find(j)) { ans[j] = i; d_right.parent[j] = j + 1; } if (t > 0) { cout << "No\n"; return 0; } } cout << "Yes\n"; for (int i = 0; i < n * n; i++) { cout << ans[i] + 1 << ' '; } cout << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:47:9: error: 'a' was not declared in this scope 47 | if (a[i] != -1) { | ^
s156206574
p03841
C++
#include<bits/stdc++.h> int main(){ using namespace std; size_t N; cin >> N; deque<pair<size_t, size_t>> bef, aft; vector<size_t> ans(N * N), a(N); for(size_t i = !N, A; i < N;){ cin >> A; if(i)for(size_t j = i ^ i; j < i; ++j)bef.emplace_back(A, -~i); if(++i != N)for(size_t j = i; j < N; ++j)aft.emplace_back(N * N - A, i); ans[--A] = i; } sort(bef.begin(), bef.end()); sort(aft.begin(), aft.end()); size_t cnt{}; auto f = [&bef, &cnt](auto& i){ ++cnt; if(i)return; if(bef.empty())return; if(bef.front().first < cnt)return; i = bef.front().second; bef.pop_front(); }; for_each(ans.begin(), ans.end(), f); if(!bef.empty())return !puts("No"); cnt ^= cnt; swap(bef, aft); for_each(ans.rbegin(), ans.rend(), f); if(!bef.empty())return !puts("No"); puts("Yes"); copy(ans.cbegin(), ans.cend(), ostream_iterator<size_t>(cout, ' ')); }
a.cc: In function 'int main()': a.cc:33:67: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 33 | copy(ans.cbegin(), ans.cend(), ostream_iterator<size_t>(cout, ' ')); | ^~~ | | | char In file included from /usr/include/c++/14/iterator:65, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54, from a.cc:1: /usr/include/c++/14/bits/stream_iterator.h:229:57: note: initializing argument 2 of 'std::ostream_iterator<_Tp, _CharT, _Traits>::ostream_iterator(ostream_type&, const _CharT*) [with _Tp = long unsigned int; _CharT = char; _Traits = std::char_traits<char>; ostream_type = std::basic_ostream<char>]' 229 | ostream_iterator(ostream_type& __s, const _CharT* __c) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~
s455863631
p03841
C++
#include<bits/stdc++.h> using namespace std; const int N=505; int ans[N*N],x[N],f[N],n; int cmp(int a,int b){ return x[a]<x[b]; } int main(){ scanf("%d",&n); for (int i=1;i<=n;i++)scanf("%d",&x[i]),f[i]=i; sort(f+1,f+n+1,cmp); int k=1; for (int i=1;i<=n;i++){ if (ans[x[f[i]]]){ puts("No"); return 0; } ans[x[f[i]]]=i; for (int j=1;j<f[i];j++){ while (ans[k])k++; if (k>x[f[i]]){ puts("No"); return 0; } ans[k]=f[i]; } } int k=n*n; for (int i=1;i<=n;i++) for (int j=1;j<=n-f[i];j++){ while (ans[k])k--; if (k<x[f[i]]){ puts("No"); return 0; } ans[k]=f[i]; } puts("Yes"); for (int i=1;i<=n*n;i++)printf("%d ",ans[i]); }
a.cc: In function 'int main()': a.cc:28:13: error: redeclaration of 'int k' 28 | int k=n*n; | ^ a.cc:12:13: note: 'int k' previously declared here 12 | int k=1; | ^
s272615775
p03841
C++
#include <bits/stdc++.h> typedef long long ll; const int INF=1e9,MOD=1e9+7,ohara=1e6; const ll LINF=1e18; using namespace std; #define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(ll i=(a);i<(b);i++) #define rrrep(i,a,b) for(ll i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Size(n) (n).size() #define Cout(x) cout<<(x)<<endl ll n,cnt,ans[ohara],b,c,d,tmp,tmpp,m,h,w,x[ohara],y,sum,pos; int dy[]={1,0,-1,0}; int dx[]={0,1,0,-1}; //int dy[]={-1,0,1,-1,1,-1,0,1}; //int dx[]={-1,-1,-1,0,0,1,1,1}; string alph("abcdefghijklmnopqrstuvwxyz"),s; bool fl; struct edge{int to,cost;}; map<pair<ll,ll>,ll> mp; map<ll,ll> cou; map<ll,ll> couu; pair<ll,ll> p[ohara]; //-------------------------↓↓↓↓↓↓------------------------ int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin>>n; rep(i,n)cin>>x[i],p[i]=make_pair(x[i],i); sort(p,p+n); rep(i,n)ans[x[i]]=i+1; rep(i,n){ tmp=p[i].second; ll ri; ri=n-tmp-1; ll cntt=0; rrep(j,1,n*n){ if(cntt==le)break; if(ans[j]==0)ans[j]=tmp+1,cntt++; } } reverse(p,p+n); rep(i,n){ tmp=p[i].second; ll ri; ri=n-tmp-1; ll cntt=0; rrrep(j,n*n,1){ if(cntt==ri)break; if(ans[j]==0)ans[j]=tmp+1,cntt++; } } rrep(i,1,n*n+1){ cou[ans[i]]++; mp[{ans[i],cou[ans[i]]}]=i; } rep(i,n){ if(mp[{i+1,i+1}]!=x[i]){ Cout("No"); return 0; } } rrep(i,1,n*n+1){ if(ans[i]==0){ Cout("No"); return 0; } } rrep(i,1,n*n+1){ couu[ans[i]]++; } rrep(i,1,n+1){ if(couu[i]!=n){ Cout("No"); return 0; } } Cout("Yes"); rrep(i,1,n*n+1){ if(i==n*n)Cout(ans[i]); else cout<<ans[i]<<" "; } return 0; }
a.cc: In function 'int main()': a.cc:45:22: error: 'le' was not declared in this scope; did you mean 'll'? 45 | if(cntt==le)break; | ^~ | ll
s389230859
p03841
C++
#include <bits/stdc++.h> typedef long long ll; const int INF=1e9,MOD=1e9+7,ohara=1e6; const ll LINF=1e18; using namespace std; #define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(ll i=(a);i<(b);i++) #define rrrep(i,a,b) for(ll i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Size(n) (n).size() #define Cout(x) cout<<(x)<<endl ll n,cnt,ans[ohara],b,c,d,tmp[ohara],tmpp,m,h,w,x[ohara],y,sum,pos; int dy[]={1,0,-1,0}; int dx[]={0,1,0,-1}; //int dy[]={-1,0,1,-1,1,-1,0,1}; //int dx[]={-1,-1,-1,0,0,1,1,1}; string alph("abcdefghijklmnopqrstuvwxyz"),s; bool fl; struct edge{int to,cost;}; map<pair<ll,ll>,ll> mp; map<ll,ll> cou; map<ll,ll> couu; pair<ll,ll> p[ohara]; //-------------------------↓↓↓↓↓↓------------------------ int main(void){ cin.tie(0); ios::sync_with_stdio(false); cin>>n; rep(i,n)cin>>x[i],p[i]=make_pair(x[i],i); sort(p,p+n); rep(i,n)ans[x[i]]=i+1; rep(i,n){ tmp=p[i].second; ll le,ri; le=tmp; ri=n-tmp-1; ll cntt=0; rrep(j,1,x[tmp]){ if(cntt==le)break; if(ans[j]==0)ans[j]=tmp+1,cntt++; } cntt=0; rrrep(j,n*n,x[tmp]+1){ if(cntt==ri)break; if(ans[j]==0)ans[j]=tmp+1,cntt++; } } rrep(i,1,n*n+1){ cou[ans[i]]++; mp[{ans[i],cou[ans[i]]}]=i; } rep(i,n){ if(mp[{i+1,i+1}]!=x[i]){ Cout("No"); return 0; } } rrep(i,1,n*n+1){ if(ans[i]==0){ Cout("No"); return 0; } } rrep(i,1,n*n+1){ couu[ans[i]]++; } rrep(i,1,n+1){ if(couu[i]!=n){ Cout("No"); return 0; } } Cout("Yes"); rrep(i,1,n*n+1){ if(i==n*n)Cout(ans[i]); else cout<<ans[i]<<" "; } return 0; }
a.cc: In function 'int main()': a.cc:40:12: error: incompatible types in assignment of 'long long int' to 'll [1000000]' {aka 'long long int [1000000]'} 40 | tmp=p[i].second; | ~~~^~~~~~~~~~~~ a.cc:42:12: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive] 42 | le=tmp; | ^~~ | | | ll* {aka long long int*} a.cc:43:13: error: invalid operands of types 'll' {aka 'long long int'} and 'll [1000000]' {aka 'long long int [1000000]'} to binary 'operator-' 43 | ri=n-tmp-1; | ~^~~~ | | | | | ll [1000000] {aka long long int [1000000]} | ll {aka long long int} a.cc:45:19: error: invalid types 'll [1000000] {aka long long int [1000000]}[ll [1000000] {aka long long int [1000000]}]' for array subscript 45 | rrep(j,1,x[tmp]){ | ^ a.cc:8:37: note: in definition of macro 'rrep' 8 | #define rrep(i,a,b) for(ll i=(a);i<(b);i++) | ^ a.cc:47:36: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive] 47 | if(ans[j]==0)ans[j]=tmp+1,cntt++; | ~~~^~ | | | ll* {aka long long int*} a.cc:50:22: error: invalid types 'll [1000000] {aka long long int [1000000]}[ll [1000000] {aka long long int [1000000]}]' for array subscript 50 | rrrep(j,n*n,x[tmp]+1){ | ^ a.cc:9:39: note: in definition of macro 'rrrep' 9 | #define rrrep(i,a,b) for(ll i=(a);i>=(b);i--) | ^ a.cc:52:36: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive] 52 | if(ans[j]==0)ans[j]=tmp+1,cntt++; | ~~~^~ | | | ll* {aka long long int*}
s653886675
p03841
C++
#include<iostream> using namespace std; int main(){ int n;cin>>n; for(int i=0;i<n;i++){int a;cin>>a;} cout<<"No"<<endl; reutrn 0; }
a.cc: In function 'int main()': a.cc:7:3: error: 'reutrn' was not declared in this scope 7 | reutrn 0; | ^~~~~~
s633945701
p03841
C++
b#include<cstdio> #include<algorithm> using namespace std; int n,tot,now,x[510],b[510],a[250010]; bool cmp(int a,int b){ return x[a]<x[b]; } int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",x+i); if(a[x[i]]){ puts("No"); return 0; } a[x[i]]=i; b[++tot]=i; } sort(b+1,b+n+1,cmp); now=1; for(int k=1;k<=n;k++){ int i=b[k],cnt=i-1; while(cnt&&now<x[i]){ if(!a[now]){ cnt--; a[now]=i; } now++; } if(cnt){ puts("No"); return 0; } } int now=n*n; for(int k=n;k;k--){ int i=b[k],cnt=n-i; while(cnt&&now>x[i]){ if(!a[now]){ cnt--; a[now]=i; } now--; } if(cnt){ puts("No"); return 0; } } puts("Yes"); for(int i=1;i<=n*n;i++) printf("%d ",a[i]); return 0; }
a.cc:1:2: error: stray '#' in program 1 | b#include<cstdio> | ^ a.cc:1:1: error: 'b' does not name a type 1 | b#include<cstdio> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 |
s702432075
p03841
C++
#include <iostream> #include <utility> #include <algorithm> using namespace std; int i,j,n,x[510],a[300000],b[300000],y[510]; pair<int,int> p[510]; int main(){ cin >> n; for(i=1;i<=n;i++){ cin >> x[i]; a[x[i]] = i; b[x[i]] = 1; y[i]=n-i; p[i]=make_pair(x[i],i); } for(i=1;i<=n*n;i++){ if(b[i]==1){ int cnt = a[i]-1; for(j=d;j<=i;j++){ if(cnt==0){ break; } if(b[j]==0){ a[j] = a[i]; b[j] = 1; cnt--; } if(j==i){ cout << "No" << endl; return 0; } } } } sort(p,p+n); for(i=1;i<=n*n;i++){ if(b[i]==0){ for(j=1;j<=n;j++){ if(y[p[j].second]!=0){ y[p[j].second]--; a[i]=p[j].second; b[i]=1; break; } } } } for(i=1;i<=n*n;i++){ b[i]=0; } for(i=1;i<=n*n;i++){ b[a[i]]++; if(b[a[i]]==a[i]){ if(i!=x[i]){ cout << "No" << endl; return 0; } } } cout << "Yes" << endl; for(i=1;i<=n*n;i++){ cout << a[i] << " "; } cout << endl; }
a.cc: In function 'int main()': a.cc:22:31: error: 'd' was not declared in this scope 22 | for(j=d;j<=i;j++){ | ^
s445212146
p03841
C++
#include <iostream> #include <vector> #include <utility> using namespace std; using P = pair<int, int>; int main() { int N; cin >> N; vector<P> xi(N); vector<int> x(N); for (int i = 0; i < N; i++) { cin >> x[i]; x[i]--; xi[i] = {x[i], i + 1}; } sort(xi.begin(), xi.end()); static int num[510]; vector<int> ans(N * N, -1); int idx = 0; for (int i = 0; i < N; i++) { // xi[i].secondを見ようとしている int f = xi[i].first; int s = xi[i].second; cerr << "f: " << f << " s: " << s << endl; while (idx < f and num[s] < s - 1) { if (ans[idx] < 0) { ans[idx] = s; num[s]++; } idx++; } if (num[s] != s - 1) { cout << "No" << endl; return 0; } ans[f] = s; num[s]++; } for (int n = 1; n <= N; n++) { while (idx < N * N and num[n] < N) { if (ans[idx] < 0) { ans[idx] = n; num[n]++; if (idx < x[n - 1]) { cout << "No" << endl; return 0; } } idx++; } } int sum = 0; for (int n = 1; n <= N; n++) sum += num[n]; if (sum != N * N) { cout << "No" << endl; return 0; } cout << "Yes" << endl; for (int a : ans) { cout << a << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'? 20 | sort(xi.begin(), xi.end()); | ^~~~ | short
s778782541
p03841
C++
#include<bits/stdc++.h> #define N 505 using namespace std; int n,x[N],a[N*N],cnt[N],b[N],top; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&x[i]); a[x[i]]=i; } for(int i=1;i<=n*n;i++)if(a[i])b[++top]=a[i]; for(int i=1;i<=n;i++)cnt[i]=i-1; for(int i=1;i<=n*n;i++) { if(!a[i]) { for(int now=1;now<=n;now++) { if(!cnt[b[now]])continue; a[i]=b[now]; cnt[b[now]]--; break; } } } int flag=0;now=n; for(int i=1;i<=n;i++)cnt[i]=n-i; for(int i=n*n;i>=1;i--) { if(!a[i]) { for(int now=1;now<=n;now++) { if(!cnt[b[now]])continue; a[i]=b[now]; cnt[b[now]]--; break; } } } for(int i=1;i<=n;i++) { int cnt=0; for(int j=1;j<=x[i];j++)if(a[j]==i)cnt++; if(cnt!=i)flag=1; } if(flag)puts("No"); else { puts("Yes"); for(int i=1;i<=n*n;i++) { printf("%d ",a[i]); }puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:28:16: error: 'now' was not declared in this scope; did you mean 'pow'? 28 | int flag=0;now=n; | ^~~ | pow
s431062379
p03841
C++
#include<bits/stdc++.H> using namespace std; using pii = pair<int, int>; const int N = 505; pii p[N]; int n, vis[N * N]; int main () { scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d", &p[i].first), p[i].second = i; sort(p + 1, p + n + 1); for (int i = 1, j = 1, k; i <= n; ++i) { k = p[i].second; for (; p[i].second > 1 && j < p[i].first; ++j) if (!vis[j]) --p[i].second, vis[j] = k; if (p[i].second > 1) return puts("No"), 0; vis[p[i].first] = k; } puts("Yes"); for (int i = 1, j = 1, k = n - 1; i <= n * n; ++i) { if (!vis[i]) { vis[i] = j; if (--k == 0) k = n - (++j); } printf("%d ", vis[i]); } return 0; }
a.cc:1:9: fatal error: bits/stdc++.H: No such file or directory 1 | #include<bits/stdc++.H> | ^~~~~~~~~~~~~~~ compilation terminated.