submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s053220220
p00548
C++
16 4 12 3 10 13 10 19 9 12 16 11 2 19 9 13 2 13 19
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 16 4 12 | ^~
s376301393
p00548
C++
#include <stdio.h> #include <cmath> #include <algorithm> #include <cfloat> #include <stack> #include <queue> #include <vector> #include <string> #include <iostream> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; #define NUM 99999999999999 ll** memo; ll** memo2; enum Type{ max_value, min_value, }; struct RMQ{ void set(ll arg_minimum,ll arg_maximum){ minimum = arg_minimum; maximum = arg_maximum; } ll minimum,maximum; }; int N = 1; RMQ* Tree; void init(int first_N){ while(N < first_N)N *= 2; } void update(int index, ll orange){ index += N-1; Tree[index].minimum = min(Tree[index].minimum,orange); Tree[index].maximum = max(Tree[index].maximum,orange); index = (index-1)/2; while(true){ Tree[index].minimum = min(Tree[2*index+1].minimum,Tree[2*index+2].minimum); Tree[index].maximum = max(Tree[2*index+1].maximum,Tree[2*index+2].maximum); if(index == 0)break; else{ index = (index-1)/2; } } } ll find(int search_left,int search_right,int node_id,int node_left,int node_right,Type type){ if(search_right < node_left || search_left > node_right){ if(type == max_value){ return -1; }else{ //type == min_value; return NUM; } } if(search_left <= node_left && search_right >= node_right){ if(type == max_value){ return Tree[node_id].maximum; }else{ return Tree[node_id].minimum; } } if(type == min_value){ ll left_min = find(search_left,search_right,2*node_id+1,node_left,(node_left+node_right)/2,type); ll right_min = find(search_left,search_right,2*node_id+2,(node_left+node_right)/2+1,node_right,type); return min(left_min,right_min); }else{ //type == max_value ll left_max = find(search_left,search_right,2*node_id+1,node_left,(node_left+node_right)/2,type); ll right_max = find(search_left,search_right,2*node_id+2,(node_left+node_right)/2+1,node_right,type); return max(left_max,right_max); } } ll box_Cost; int first_N,contain_Max; ll recursive(int left,int width){ ll ret = 0,next = NUM; if(memo[left][width] != -1){ return memo[left][width]; }else{ if(memo2[left][right] != -1){ ret = memo2[left][right]; }else{ ll min_orange = find(left,min(N-1,left+width-1),0,0,N-1,min_value); ll max_orange = find(left,min(N-1,left+width-1),0,0,N-1,max_value); memo2[left][right] = box_Cost+(ll)width*(max_orange-min_orange); ret = memo2[left][right]; } } if(left + width <= first_N-1){ for(int i = 1; i <= contain_Max; i++){ next = min(next,recursive(left+width,i)); } return memo[left][width] = ret + next; }else{ return memo[left][width] = ret; } } void func(){ ll ans = NUM; for(int i = 1; i <= contain_Max; i++){ ans = min(ans,recursive(0,i)); } printf("%lld\n",ans); } int main(){ scanf("%d %d %lld",&first_N,&contain_Max,&box_Cost); init(first_N); memo = new ll*[first_N]; memo2 = new ll*[first_N]; for(int i = 0; i < first_N; i++){ memo[i] = new ll[contain_Max+1]; memo2[i] = new ll[contain_Max+1]; for(int k = 0; k <= contain_Max; k++){ memo[i][k] = -1; memo2[i][k] = -1; } } Tree = (RMQ*)malloc(sizeof(RMQ)*(2*N)); for(int i = 0; i < 2*N-1; i++){ Tree[i].set(NUM,-1); } ll tmp; for(int i = 0; i < first_N; i++){ scanf("%lld",&tmp); update(i,tmp); } func(); return 0; }
a.cc: In function 'll recursive(int, int)': a.cc:106:31: error: invalid types 'll* {aka long long int*}[std::ios_base&(std::ios_base&)]' for array subscript 106 | if(memo2[left][right] != -1){ | ^ a.cc:107:42: error: invalid types 'll* {aka long long int*}[std::ios_base&(std::ios_base&)]' for array subscript 107 | ret = memo2[left][right]; | ^ a.cc:111:36: error: invalid types 'll* {aka long long int*}[std::ios_base&(std::ios_base&)]' for array subscript 111 | memo2[left][right] = box_Cost+(ll)width*(max_orange-min_orange); | ^ a.cc:112:42: error: invalid types 'll* {aka long long int*}[std::ios_base&(std::ios_base&)]' for array subscript 112 | ret = memo2[left][right]; | ^
s667107530
p00549
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <functional> using namespace std; #define rep(i,a,n) for(int i = a; n > i; i++) #define REP(i,n) rep(i,0,n) #define MP(a,b) make_pair(a,b) #define ALL(a) (a).begin(),(a).end() typedef pair<int,int> pii; typedef long long ll; #define int ll int main(){ int n; scanf("%lld%*c", &n); int jsum = 0,osum = 0,isum = 0; vector<char> str(n); REP(i,n){ scanf("%c", &str[i]); switch(str[i]){ case 'J': jsum++; break; case 'O': osum++; break; case 'I': isum++; break; } } int cans[3] = {},Oad = 0, cj = 0,ci = isum; REP(i,n){ if(str[i] == 'O'){ cans[0] += (cj+1)*ci; cans[1] += cj*ci; Oad = max(Oad, cj*ci); cans[2] += cj*(ci+1); } else if(str[i] == 'I'){ ci--; } else{ cj++; } } cans[1] += Oad; printf("%lld\n", max({cans[0], cans[1], cans[2]})); return 0; }
a.cc:20:13: error: '::main' must return 'int' 20 | #define int ll | ^~ a.cc:21:1: note: in expansion of macro 'int' 21 | int main(){ | ^~~
s912281909
p00550
C++
#include "bits/stdc++.h" #include<unordered_map> #include<unordered_set> #pragma warning(disable:4996) using namespace std; using ld = long double; template<class T> using Table = vector<vector<T>>; const ld eps=1e-9; //// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer" struct aEdge { int u; int v; }; typedef pair<int, int> Edge; vector<int>gettimes(const int N,const vector<Edge>&alles) { vector<vector<Edge>>es(N); for (auto e : alles) { es[e.first].push_back(e); es[e.second].push_back(Edge{ e.second,e.first }); } vector<int>times(N,1e9); queue<int>que; que.push(0); times[0] = 0; while (!que.empty()) { int now = que.front(); que.pop(); for (const auto& e : es[now]) { if(times[now]+1<times[e.second]){ times[e.second] = times[now] + 1; que.push(e.second); } } } return times; } int main() { int N, M, Q; cin >> N >> M >> Q; vector<Edge>alles; for (int i = 0; i < M; ++i) { int u, v; cin >> u >> v; u--; v--; alles.push_back(Edge{ u, v }); } vector<int>times = gettimes(N, alles); vector<int>qs(Q); vector<int>used(M); for (int i = 0; i < Q; ++i) { int n; cin >> n; n--; qs[i] = n; used[n] = true; } vector<vector<Edge>>es(N); for (int i = 0; i < M; ++i) { if (!used[i]) { Edge e = alles[i]; es[e.first].push_back(e); es[e.second].push_back(Edge{ e.second,e.first }); } } vector<int>canmove(N); canmove[0] = true; queue<int>que; que.push(0); int monku = N - 1; vector<int>anss; for (int q = Q - 1; q >= 0; --q) { while (!que.empty()) { int now = que.front(); que.pop(); if (canmove[now]) { vector<Edge>newes; for (const auto& e : es[now]) { if (!canmove[e.second]&&times[e.second]==times[e.first]+1) { canmove[e.second] = true; que.push(e.second); monku--; } else { newes.emplace_back(es); } } es[now] = newes; } } anss.emplace_back(monku); Edge e = alles[qs[q]]; es[e.first].push_back(e); es[e.second].push_back(Edge{ e.second,e.first }); if (canmove[e.first] ^ canmove[e.second]) { if (canmove[e.first]) { que.push(e.first); } if (canmove[e.second]) { que.push(e.second); } } } for (int i = anss.size()-1; i>=0; --i) { cout << anss[i] << endl; } return 0; }
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/new_allocator.h: In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<int, int>; _Args = {std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >&}; _Tp = std::pair<int, int>]': /usr/include/c++/14/bits/alloc_traits.h:575:17: required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<int, int>; _Args = {std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >&}; _Tp = std::pair<int, int>; allocator_type = std::allocator<std::pair<int, int> >]' 575 | __a.construct(__p, std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:117:30: required from 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >&}; _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; reference = std::pair<int, int>&]' 117 | _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | std::forward<_Args>(__args)...); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:87:25: required from here 87 | newes.emplace_back(es); | ~~~~~~~~~~~~~~~~~~^~~~ /usr/include/c++/14/bits/new_allocator.h:191:11: error: no matching function for call to 'std::pair<int, int>::pair(std::vector<std::vector<std::pair<int, int> > >&)' 191 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:913:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 913 | explicit constexpr pair(pair<_U1, _U2>&& __p) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:913:28: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/new_allocator.h:191:11: note: 'std::vector<std::vector<std::pair<int, int> > >' is not derived from 'std::pair<_T1, _T2>' 191 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:902:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 902 | constexpr pair(pair<_U1, _U2>&& __p) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:902:19: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/new_allocator.h:191:11: note: 'std::vector<std::vector<std::pair<int, int> > >' is not derived from 'std::pair<_T1, _T2>' 191 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:891:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && (! _ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 891 | explicit constexpr pair(_U1&& __x, _U2&& __y) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:891:28: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_pair.h:881:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && _ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 881 | constexpr pair(_U1&& __x, _U2&& __y) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:881:19: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_pair.h:869:9: note: candidate: 'template<class _U2, typename std::enable_if<std::__and_<std::is_pointer<int>, std::__not_<std::is_reference<_Tp> >, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::__not_<std::is_convertible<_U1, int> > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(__zero_as_null_pointer_constant, _U2&&, ...) [with typename std::enable_if<std::__and_<std::is_pointer<_Tp>, std::__not_<std::is_reference<_U1> >, std::is_constructible<_T2, _U2>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::__not_<std::is_convertible<_U2, _T2> > >::value, bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 869 | pair(__zero_as_null_pointer_constant, _U2&& __y, ...) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:869:9: note: candidate expects at least 2 arguments, 1 provided /usr/include/c++/14/bits/stl_pair.h:856:9: note: candidate: 'template<class _U2, typename std::enable_if<std::__and_<std::is_pointer<int>, std::__not_<std::is_reference<_Tp> >, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::is_convertible<_U1, int> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(__zero_as_null_pointer_constant, _U2&&, ...) [with typename std::enable_if<std::__and_<std::is_pointer<_Tp>, std::__not_<std::is_reference<_U1> >, std::is_constructible<_T2, _U2>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::is_convertible<_U2, _T2> >::value, bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]' 856 | pair(__zero_as_null_pointer_constant, _U2&& __y, ...) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:856:9: note: candidate expects at least 2 arguments, 1 provided /usr/include/c++/14/bits/stl_pair.h:843:9: note: candidate: 'template<class _U1, typename std::enable_if<std::__and_<std::__not_<std::is_reference<_Tp> >, std::is_pointer<int>, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::__not_<std::is_convertible<_U1, int> > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, __zero_as_null_pointer_constant, ...) [with typename std::enable_if<std::__and_<std::__not_<std::is_reference<_U1> >, std::is_pointer<_T2>, std::is_constructible<_T1, _U1>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::__not_<std::is_convertible<_U1, _T1> > >::value, bool>::type <anonymous> = _U1; _T1 = int; _T2 = int]' 843 | pair(_U1&& __x, __zero_as_null_pointer_constant, ...) | ^~~~ /usr/include/c++/14/bits/stl_pair.h:843:9: note: candidate expects at least 2 arguments, 1 provided /usr/include/c++/14/bits/stl_pair.h:830:9: note: candidate: 'template<class _U1, typename std::enable_if<std::__and_<std::__not_<std::is_reference<_Tp> >, std::is_pointer<int>, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::is_convertible<_U1, int> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, __zero_as_null_pointer_constant, ...) [with typename std::enable_if<std::__and_<std::__not_<std::is_reference<_U1> >, std::is_pointer<_T2>, std::is_constructible<_T1, _U1>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::is_c
s692747539
p00550
C++
#include<bits/stdc++.h> int n, m, q, a[210000], b[210000], c, dist[110000], T[110000], cnt, U[110000]; vector<pair<int, int> >x[110000], y[110000]; bool used[210000]; int main() { scanf("%d%d%d", &n, &m, &q); for (int i = 0; i < m; i++) { scanf("%d%d", &a[i], &b[i]); x[a[i]].push_back(make_pair(b[i], i)); x[b[i]].push_back(make_pair(a[i], i)); } fill(dist, dist + n + 1, 999999); dist[1] = 0; queue<int> Q; Q.push(1); while (!Q.empty()) { int a1 = Q.front(); Q.pop(); for (pair<int, int> i : x[a1]) { if (dist[i.first] > dist[a1] + 1) { dist[i.first] = dist[a1] + 1; Q.push(i.first); } } } for (int i = 1; i <= n; i++) { for (pair<int, int> j : x[i]) { if (dist[i] < dist[j.first]) { y[i].push_back(j); T[j.first]++; } } } for (int i = 0; i < q; i++) { scanf("%d", &c); c--; queue<pair<int, int> > Q1; int ss = -1; if (dist[a[c]] < dist[b[c]])ss = b[c]; if (dist[a[c]] > dist[b[c]])ss = a[c]; if (ss >= 1 && U[ss] == 0 && used[c] == false) { Q1.push(make_pair(ss, c)); while (!Q1.empty()) { int a1 = Q1.front().first, a2 = Q1.front().second; Q1.pop(); if (U[a1] == 1 || used[a2] == true) continue; T[a1]--; used[a2] = true; if (T[a1] != 0) continue; cnt++; U[a1] = 1; for (pair<int, int> j : y[a1]) { if (U[j.first] == 0) Q1.push(j); } } } cout << cnt << endl; } return 0; }
a.cc:3:1: error: 'vector' does not name a type 3 | vector<pair<int, int> >x[110000], y[110000]; bool used[210000]; | ^~~~~~ a.cc: In function 'int main()': a.cc:8:17: error: 'x' was not declared in this scope 8 | x[a[i]].push_back(make_pair(b[i], i)); | ^ a.cc:8:35: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'? 8 | x[a[i]].push_back(make_pair(b[i], i)); | ^~~~~~~~~ | std::make_pair In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here 1132 | make_pair(_T1&& __x, _T2&& __y) | ^~~~~~~~~ a.cc:11:9: error: 'fill' was not declared in this scope; did you mean 'std::fill'? 11 | fill(dist, dist + n + 1, 999999); dist[1] = 0; | ^~~~ | std::fill In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:191:1: note: 'std::fill' declared here 191 | fill(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~ a.cc:12:9: error: 'queue' was not declared in this scope; did you mean 'std::queue'? 12 | queue<int> Q; Q.push(1); | ^~~~~ | std::queue In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157: /usr/include/c++/14/bits/stl_queue.h:96:11: note: 'std::queue' declared here 96 | class queue | ^~~~~ a.cc:12:15: error: expected primary-expression before 'int' 12 | queue<int> Q; Q.push(1); | ^~~ a.cc:12:23: error: 'Q' was not declared in this scope 12 | queue<int> Q; Q.push(1); | ^ a.cc:15:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 15 | for (pair<int, int> i : x[a1]) { | ^~~~ | std::pair /usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here 89 | struct pair; | ^~~~ a.cc:15:27: error: expected primary-expression before 'int' 15 | for (pair<int, int> i : x[a1]) { | ^~~ a.cc:21:9: error: expected primary-expression before '}' token 21 | } | ^ a.cc:20:18: error: expected ';' before '}' token 20 | } | ^ | ; 21 | } | ~ a.cc:21:9: error: expected primary-expression before '}' token 21 | } | ^ a.cc:20:18: error: expected ')' before '}' token 20 | } | ^ | ) 21 | } | ~ a.cc:15:21: note: to match this '(' 15 | for (pair<int, int> i : x[a1]) { | ^ a.cc:21:9: error: expected primary-expression before '}' token 21 | } | ^ a.cc:23:22: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 23 | for (pair<int, int> j : x[i]) { | ^~~~ | std::pair /usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here 89 | struct pair; | ^~~~ a.cc:23:27: error: expected primary-expression before 'int' 23 | for (pair<int, int> j : x[i]) { | ^~~ a.cc:29:9: error: expected primary-expression before '}' token 29 | } | ^ a.cc:28:18: error: expected ';' before '}' token 28 | } | ^ | ; 29 | } | ~ a.cc:29:9: error: expected primary-expression before '}' token 29 | } | ^ a.cc:28:18: error: expected ')' before '}' token 28 | } | ^ | ) 29 | } | ~ a.cc:23:21: note: to match this '(' 23 | for (pair<int, int> j : x[i]) { | ^ a.cc:29:9: error: expected primary-expression before '}' token 29 | } | ^ a.cc:32:23: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 32 | queue<pair<int, int> > Q1; | ^~~~ | std::pair /usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here 89 | struct pair; | ^~~~ a.cc:32:28: error: expected primary-expression before 'int' 32 | queue<pair<int, int> > Q1; | ^~~ a.cc:37:25: error: 'Q1' was not declared in this scope; did you mean 'y1'? 37 | Q1.push(make_pair(ss, c)); | ^~ | y1 a.cc:37:33: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'? 37 | Q1.push(make_pair(ss, c)); | ^~~~~~~~~ | std::make_pair /usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here 1132 | make_pair(_T1&& __x, _T2&& __y) | ^~~~~~~~~ a.cc:40:56: error: 'a2' was not declared in this scope; did you mean 'a1'? 40 | if (U[a1] == 1 || used[a2] == true) continue; T[a1]--; used[a2] = true; | ^~ | a1 a.cc:40:93: error: 'a2' was not declared in this scope; did you mean 'a1'? 40 | if (U[a1] == 1 || used[a2] == true) continue; T[a1]--; used[a2] = true; | ^~ | a1 a.cc:42:43: error: expected primary-expression before 'int' 42 | for (pair<int, int> j : y[a1]) { | ^~~ a.cc:45:25: error: expected primary-expression before '}' token 45 | } | ^ a.cc:44:34: error: expected ';' before '}' token 44 | } | ^ | ; 45 | } | ~ a.cc:45:25: error: expected primary-expression before '}' token 45 | } | ^ a.cc:44:34: error: expected ')' before '}' token 44 | } | ^ | ) 45 | } | ~ a.cc:42:37: note: to match this '(' 42 | for (pair<int, int> j : y[a1]) { | ^ a.cc:45:25: error: expected primary-expression before '}' token 45 | } | ^ a.cc:47:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 47 | cout << cnt << endl; | ^~~~ | std::cout In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:47:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 47 | cout << cnt << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s046441316
p00550
C++
#include<iostream> #include<functional> #include<queue> #include<vector> #include<algorithm> using namespace std; #pragma warning(disable:4996) int n, m, q, a[1 << 18], b[1 << 18], c[1 << 18], d[1 << 18], e[1 << 18], dist[1 << 18]; vector<pair<int, int>>x[1 << 18], y[1 << 18]; int main() { scanf("%d%d%d", &n, &m, &q); fill(d, d + m + 1, 1 << 30); for (int i = 1; i <= m; i++) scanf("%d%d", &a[i], &b[i]); for (int i = 1; i <= q; i++) scanf("%d", &c[i]), d[c[i]] = i; for (int i = 1; i <= m; i++) { x[a[i]].push_back(make_pair(b[i], d[i])); x[b[i]].push_back(make_pair(a[i], d[i])); } fill(dist, dist + n + 1, -1); dist[1] = 0; queue<int> Q1; Q1.push(1); while (!Q1.empty()) { int a1 = Q1.front(); Q1.pop(); for (pair<int, int> i : x[a1]) { if (dist[i.first] == -1) { dist[i.first] = dist[a1] + 1; Q1.push(i.first); } } } for (int i = 1; i <= n; i++) { for (pair<int, int> j : x[i]) { if (dist[i] < dist[j.first]) y[i].push_back(j); } } queue<pair<int, int> >Q; Q.push(make_pair(1 << 30, 1)); e[1] = (1 << 30); while (!Q.empty()) { int a1 = Q.top().first, a2 = Q.top().second; Q.pop(); for (int i = 0; i < y[a2].size(); i++) { if (e[y[a2][i].first] < min(y[a2][i].second, a1)) { e[y[a2][i].first] = min(y[a2][i].second, a1); Q.push(make_pair(e[y[a2][i].first], y[a2][i].first)); } } } sort(e + 1, e + n + 1); int T = 1; for (int i = 1; i <= q; i++) { while (e[T] <= i) T++; printf("%d\n", T - 1); } return 0; }
a.cc: In function 'int main()': a.cc:36:28: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'? 36 | int a1 = Q.top().first, a2 = Q.top().second; Q.pop(); | ^~~ | pop a.cc:37:39: error: 'a2' was not declared in this scope; did you mean 'a1'? 37 | for (int i = 0; i < y[a2].size(); i++) { | ^~ | a1
s174773706
p00550
C++
//------------------------------------------- //- Train Fare - //- - //- autumn_eel niha katemasen! - //------------------------------------------- void reader(int *x) { int k = getchar_unlocked(); *x = k - '0'; while (true) { k = getchar_unlocked(); if (k < '0' || k > '9') break; *x = ((*x) << 1) + ((*x) << 3) + k - '0'; } } void writeln(int x) { int s = 0; char f[10]; while (x) { f[s++] = x % 10; x /= 10; } if (!s) f[s++] = 0; while (s--) putchar_unlocked(f[s] + '0'); putchar_unlocked('\n'); } #include<iostream> #include<functional> #include<queue> #include<vector> #include<algorithm> using namespace std; #pragma warning(disable:4996) int n, m, q, a[200003], b[200003], c[200003], d[200003], e[100003], dist[100003], E[200003]; vector<pair<int, int> > z[100003]; vector<int> x[100003]; vector<int>D[100003]; int main() { reader(&n); reader(&m); reader(&q); fill(d, d + m + 1, 1 << 30); for (int i = 1; i <= m; i++) reader(&a[i]), reader(&b[i]); for (int i = 1; i <= q; i++) reader(&c[i]), d[c[i]] = i; for (int i = 1; i <= m; i++) { x[a[i]].push_back(b[i]); x[b[i]].push_back(a[i]); } fill(dist, dist + n + 1, -1); dist[1] = 0; queue<int> Q1; Q1.push(1); while (!Q1.empty()) { int a1 = Q1.front(); Q1.pop(); for (int i : x[a1]) { if (dist[i] == -1) { dist[i] = dist[a1] + 1; Q1.push(i); } } } for (int i = 1; i <= m; i++) { if (dist[a[i]] > dist[b[i]]) z[a[i]].push_back(make_pair(b[i], d[i])); if (dist[b[i]] > dist[a[i]]) z[b[i]].push_back(make_pair(a[i], d[i])); } for (int i = 1; i <= n; i++) D[dist[i]].push_back(i); e[1] = (1 << 30); for (int i = 1; i < n; i++) { for (int j : D[i]) { for (pair<int, int>k : z[j]) { e[j] = max(e[j], min(e[k.first], k.second)); } } } for (int i = 2; i <= n; i++) { if (e[i] < 300000) E[e[i]]++; } for (int i = 1; i <= q; i++) { E[i] += E[i - 1]; writeln(E[i]); } return 0; }
a.cc: In function 'void reader(int*)': a.cc:10:17: error: 'getchar_unlocked' was not declared in this scope 10 | int k = getchar_unlocked(); *x = k - '0'; | ^~~~~~~~~~~~~~~~ a.cc: In function 'void writeln(int)': a.cc:24:21: error: 'putchar_unlocked' was not declared in this scope 24 | while (s--) putchar_unlocked(f[s] + '0'); | ^~~~~~~~~~~~~~~~ a.cc:25:9: error: 'putchar_unlocked' was not declared in this scope 25 | putchar_unlocked('\n'); | ^~~~~~~~~~~~~~~~
s056544761
p00550
C++
#include <bits/stdc++.h> using namespace std; #define mygc(c) (c)=getchar_unlocked() #define mypc(c) putchar_unlocked(c) #define ll long long #define ull unsigned ll void reader(int *x) { int k, m = 0; *x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { *x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; *x = (*x) * 10 + k - '0'; }if (m)(*x) = -(*x); } void reader(ll *x) { int k, m = 0; *x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { *x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; *x = (*x) * 10 + k - '0'; }if (m)(*x) = -(*x); } void reader(double *x) { scanf("%lf", x); } int reader(char c[]) { int i, s = 0; for (;;) { mygc(i); if (i != ' '&&i != '\n'&&i != '\r'&&i != '\t'&&i != EOF) break; }c[s++] = i; for (;;) { mygc(i); if (i == ' ' || i == '\n' || i == '\r' || i == '\t' || i == EOF) break; c[s++] = i; }c[s] = '\0'; return s; } template <class T, class S> void reader(T *x, S *y) { reader(x); reader(y); } template <class T, class S, class U> void reader(T *x, S *y, U *z) { reader(x); reader(y); reader(z); } template <class T, class S, class U, class V> void reader(T *x, S *y, U *z, V *w) { reader(x); reader(y); reader(z); reader(w); } void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x<0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); } void writer(ll x, char c) { int s = 0, m = 0; char f[20]; if (x<0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); } void writer(double x, char c) { printf("%.15f", x); mypc(c); } void writer(const char c[]) { int i; for (i = 0; c[i] != '\0'; i++)mypc(c[i]); } void writer(const char x[], char c) { int i; for (i = 0; x[i] != '\0'; i++)mypc(x[i]); mypc(c); } template<class T> void writerLn(T x) { writer(x, '\n'); } template<class T, class S> void writerLn(T x, S y) { writer(x, ' '); writer(y, '\n'); } template<class T, class S, class U> void writerLn(T x, S y, U z) { writer(x, ' '); writer(y, ' '); writer(z, '\n'); } template<class T> void writerArr(T x[], int n) { int i; if (!n) { mypc('\n'); return; }rep(i, n - 1)writer(x[i], ' '); writer(x[n - 1], '\n'); } #define rep(i,n)for(int i=0;i<n;i++) vector<int>E[100000]; int u[200000], v[200000], r[200000], ans[200000], d[100000]{ 1 }, cnt = 1; char b[200000], ok[100000]{ 1 }; deque<int>que; void bfs(int u, char t) { que.emplace_back(u); while (!que.empty()) { int p = que.front(); que.pop_front(); for (int v : E[p]) { if (t) { if (d[v] > d[p] && !ok[v]) { ok[v] = 1; cnt++; que.emplace_back(v); } } else if (!d[v]) { d[v] = d[p] + 1; que.emplace_back(v); } } } } int main() { int n, m, q; reader(&n); reader(&m); reader(&q); rep(i, m) { reader(&u[i]); reader(&v[i]); u[i]--; v[i]--; E[u[i]].emplace_back(v[i]); E[v[i]].emplace_back(u[i]); } bfs(0, 0); rep(i, m) { if (d[u[i]] > d[v[i]])swap(u[i], v[i]); } rep(i, n)E[i].clear(); rep(i, q) { reader(&r[i]); r[i]--; b[r[i]] = 1; } rep(i, m) { if (!b[i]) { if (d[v[i]] > d[u[i]]) { E[u[i]].emplace_back(v[i]); } } } bfs(0, 1); for (int i = q - 1; i >= 0; i--) { ans[i] = n - cnt; if (d[v[r[i]]] > d[u[r[i]]] && !ok[v[r[i]]]) { E[u[r[i]]].emplace_back(v[r[i]]); if (ok[u[r[i]]]) { cnt++; ok[v[r[i]]] = 1; bfs(v[r[i]], 1); } } } rep(i, q)writerLn(ans[i]); }
a.cc: In function 'void writerArr(T*, int)': a.cc:24:88: error: there are no arguments to 'rep' that depend on a template parameter, so a declaration of 'rep' must be available [-fpermissive] 24 | template<class T> void writerArr(T x[], int n) { int i; if (!n) { mypc('\n'); return; }rep(i, n - 1)writer(x[i], ' '); writer(x[n - 1], '\n'); } | ^~~ a.cc:24:88: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) a.cc:24:101: error: expected ';' before 'writer' 24 | template<class T> void writerArr(T x[], int n) { int i; if (!n) { mypc('\n'); return; }rep(i, n - 1)writer(x[i], ' '); writer(x[n - 1], '\n'); } | ^~~~~~ | ;
s401134904
p00550
C++
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;i++) using namespace std; void reader(int *x) { int k = getchar_unlocked(); *x = k - '0'; while (true) { k = getchar_unlocked(); if (k < '0') break; *x = ((*x) << 1) + ((*x) << 3) + k - '0'; } } inline void writeln(int x) { int s = 0; char f[7]; while (x) { f[s++] = x % 10; x /= 10; } if (!s) f[s++] = 0; while (s--) putchar_unlocked(f[s] + '0'); putchar_unlocked('\n'); } vector<int>E[100000]; int u[200000], v[200000], r[200000], ans[200000], d[100000]{ 1 }, cnt = 1; char b[200000], ok[100000]{ 1 }; deque<int>que; void bfs(int u, char t) { que.emplace_back(u); while (!que.empty()) { int p = que.front(); que.pop_front(); for (int v : E[p]) { if (t) { if (d[v] > d[p] && !ok[v]) { ok[v] = 1; cnt++; que.emplace_back(v); } } else if (!d[v]) { d[v] = d[p] + 1; que.emplace_back(v); } } } } int main() { int n, m, q; reader(&n); reader(&m); reader(&q); rep(i, m) { reader(&u[i]); reader(&v[i]); u[i]--; v[i]--; E[u[i]].emplace_back(v[i]); E[v[i]].emplace_back(u[i]); } bfs(0, 0); rep(i, m) { if (d[u[i]] > d[v[i]])swap(u[i], v[i]); } rep(i, n)E[i].clear(); rep(i, q) { reader(&r[i]); r[i]--; b[r[i]] = 1; } rep(i, m) { if (!b[i]) { if (d[v[i]] > d[u[i]]) { E[u[i]].emplace_back(v[i]); } } } bfs(0, 1); for (int i = q - 1; i >= 0; i--) { ans[i] = n - cnt; if (d[v[r[i]]] > d[u[r[i]]] && !ok[v[r[i]]]) { E[u[r[i]]].emplace_back(v[r[i]]); if (ok[u[r[i]]]) { cnt++; ok[v[r[i]]] = 1; bfs(v[r[i]], 1); } } } rep(i, q)writerln(ans[i]); }
a.cc: In function 'int main()': a.cc:79:18: error: 'writerln' was not declared in this scope; did you mean 'writeln'? 79 | rep(i, q)writerln(ans[i]); | ^~~~~~~~ | writeln
s578891367
p00550
C++
#include <stdio.h> #include<vector> #include<deque> using namespace std; #define mygc(c) (c)=getchar_unlocked() #define mypc(c) putchar_unlocked(c) void reader(int& x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; x = x * 10 + k - '0'; }if (m) x = -x; } void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x<0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); } template<class T> void writerLn(T x) { writer(x, '\n'); } #define rep(i,n)for(int i=0;i<n;i++) vector<int>E[100000]; int u[200000], v[200000], r[200000], ans[200000], d[100000], cnt = 1; char b[200000], ok[100000]{ 1 }; deque<int>que; void bfs(int u, int t) { que.emplace_back(u); while (!que.empty()) { int p = que.front(); que.pop_front(); for (int v : E[p]) { if (t) { if (d[v] > d[p] && !ok[v]) { ok[v] = 1; cnt++; que.emplace_back(v); } } else if (!~d[v]) { d[v] = d[p] + 1; que.emplace_back(v); } } } } int main() { int n, m, q; reader(n); reader(m); reader(q); rep(i, m) { reader(u[i]); reader(v[i]); u[i]--; v[i]--; E[u[i]].emplace_back(v[i]); E[v[i]].emplace_back(u[i]); } memset(d, -1, sizeof(d)); d[0] = 0; bfs(0, 0); rep(i, m) { if (d[u[i]] > d[v[i]])swap(u[i], v[i]); } rep(i, n)E[i].clear(); rep(i, q) { reader(r[i]); r[i]--; b[r[i]] = 1; } rep(i, m) { if (!b[i]) { if (d[v[i]] > d[u[i]]) { E[u[i]].emplace_back(v[i]); } } } bfs(0, 1); for (int i = q - 1; i >= 0; i--) { ans[i] = n - cnt; if (d[v[r[i]]] > d[u[r[i]]] && !ok[v[r[i]]]) { E[u[r[i]]].emplace_back(v[r[i]]); if (ok[u[r[i]]]) { cnt++; ok[v[r[i]]] = 1; bfs(v[r[i]], 1); } } } rep(i, q)writerLn(ans[i]); }
a.cc: In function 'int main()': a.cc:40:9: error: 'memset' was not declared in this scope 40 | memset(d, -1, sizeof(d)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<deque> +++ |+#include <cstring> 4 |
s649017475
p00550
C++
#include<iostream> #include<vector> #include<algorithm> #include<queue> #include<functional> #define PAIR pair<int,int> using namespace std; class road { public: int from, to; bool use; road() :use(true) { } }; class town { public: int fast; bool used, said; vector<road*> road; int num; town():used(false),num(0),said(false) { } }; int main() { int N, M, Q; cin >> N >> M >> Q; town *map; map = new town[N + 1]; road *train; train = new road[M * 2 + 1]; int a, b; for (int i = 1; i <= M; ++i) { cin >> a >> b; train[i].from = a; train[i].to = b; train[i + M].from = b; train[i + M].to = a; map[a].road.push_back(&train[i]); map[b].road.push_back(&train[i + M]); } priority_queue<PAIR, vector<PAIR>, greater<PAIR> > que; PAIR dummy; que.push(PAIR(0, 1)); while (!que.empty()) { dummy = que.top(); que.pop(); if (map[dummy.second].used) { continue; } map[dummy.second].used = true; map[dummy.second].fast = dummy.first; for (int i = 0, nmax = map[dummy.second].road.size(); i < nmax; ++i) { if (map[map[dummy.second].road[i]->to].used == false) { que.push(PAIR(dummy.first + 1, map[dummy.second].road[i]->to)); } } } for (int i = 1; i <= N; ++i) { for (int j = 0, nmax = map[i].road.size(); j < nmax; ++j) { if (map[map[i].road[j]->to].fast - map[i].fast == 0) { map[i].road[j]->use = false; swap(map[i].road[j], map[i].road[nmax - 1]); map[i].road.pop_back(); --nmax; } else if (map[map[i].road[j]->to].fast - map[i].fast == -1) { ++map[i].num; map[i].road[j]->use = false; swap(map[i].road[j], map[i].road[nmax - 1]); map[i].road.pop_back(); --nmax; --j; } } } int answer = 0; int up; queue<int> say; for (int i = 0; i < Q; ++i) { cin >> up; if (train[up].use) { say.push(train[up].to); train[up].use = false; } else if (train[up + M].use) { say.push(train[up + M].to); train[up + M].use = false; } while (!say.empty()) { int mati = say.front(); say.pop(); if (map[mati].said) { continue; } else if (--map[mati].num != 0) { continue; } ++answer; map[mati].said = true; for (int i = 0, nmax = map[mati].road.size(); i < nmax; ++i) { if (map[mati].road[i]->use) { say.push(map[mati].road[i]->to); } else { swap(map[mati].road[i], map[mati].road[nmax - 1]); --i; --nmax; map[mati].road.pop_back(); } } } cout << answer << endl; } return 0; }
a.cc:20:23: error: declaration of 'std::vector<road*> town::road' changes meaning of 'road' [-Wchanges-meaning] 20 | vector<road*> road; | ^~~~ a.cc:20:16: note: used here to mean 'class road' 20 | vector<road*> road; | ^~~~ a.cc:8:7: note: declared here 8 | class road { | ^~~~
s895901330
p00550
C++
#include<iostream> #include<cstdio> #include<string> #include<set> #include<vector> #include<algorithm> #include<functional> #include<queue> #define p pair<int,int> using namespace std; p d[100000]; vector<int>rinsetu[100000]; int mincost[100000]; set<int>k[100000]; int l[100000]; int main() { memset(mincost, -1, sizeof(mincost)); int a, b, c; cin >> a >> b >> c; for (int e = 0; e < b; e++) { int f, g; scanf("%d%d", &f, &g); f--; g--; d[e] = p(f, g); rinsetu[f].push_back(g); rinsetu[g].push_back(f); } queue<int>Q; Q.push(0); mincost[0] = 0; while (Q.size()) { int h = Q.front(); Q.pop(); for (int i : rinsetu[h]) { if (mincost[i] == -1) { k[h].insert(i); l[i]++; mincost[i] = mincost[h] + 1; Q.push(i); } else if (mincost[i] == mincost[h] + 1) { k[h].insert(i); l[i]++; } } } int sum = 0; for (int i = 0; i < c; i++) { int j; scanf("%d", &j); j--; auto v= k[d[j].first].find(d[j].second), t= k[d[j].second].find(d[j].first); if (v!=k[d[j].first].end()) { k[d[j].first].erase(v); l[d[j].second]--; if (l[d[j].second] == 0) { queue<int>que; que.push(d[j].second); while (que.size()) { int u = que.front(); que.pop(); sum++; for (auto w = k[u].begin(); w != k[u].end(); w++) { l[*w]--; if (l[*w] == 0)que.push(*w); k[u].erase(w); w--; } } } } else if (t!= k[d[j].second].end()) { k[d[j].second].erase(v); l[d[j].first]--; if (l[d[j].first] == 0) { queue<int>que; que.push(d[j].first); while (que.size()) { int u = que.front(); que.pop(); sum++; for (auto w = k[u].begin(); w != k[u].end(); w++) { l[*w]--; if (l[*w] == 0)que.push(*w); k[u].erase(w); w--; } } } } cout << sum<< endl; } }
a.cc: In function 'int main()': a.cc:18:9: error: 'memset' was not declared in this scope 18 | memset(mincost, -1, sizeof(mincost)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<queue> +++ |+#include <cstring> 9 | #define p pair<int,int>
s422855770
p00550
C++
#include<iostream> #include<cstdio> #include<string> #include<set> #include<vector> #include<algorithm> #include<functional> #include<queue> #define p pair<int,int> using namespace std; p d[200000]; vector<int>rinsetu[100000]; int mincost[100000]; set<int>k[100000]; int l[100000]; int main() { memset(mincost, -1, sizeof(mincost)); int a, b, c; cin >> a >> b >> c; for (int e = 0; e < b; e++) { int f, g; scanf("%d%d", &f, &g); f--; g--; d[e] = p(f, g); rinsetu[f].push_back(g); rinsetu[g].push_back(f); } queue<int>Q; Q.push(0); mincost[0] = 0; while (Q.size()) { int h = Q.front(); Q.pop(); for (int i : rinsetu[h]) { if (mincost[i] == -1) { k[h].insert(i); l[i]++; mincost[i] = mincost[h] + 1; Q.push(i); } else if (mincost[i] == mincost[h] + 1) { k[h].insert(i); l[i]++; } } } int sum = 0; for (int i = 0; i < c; i++) { int j; scanf("%d", &j); j--; auto v= k[d[j].first].find(d[j].second), t= k[d[j].second].find(d[j].first); if (v!=k[d[j].first].end()) { k[d[j].first].erase(v); l[d[j].second]--; if (l[d[j].second] == 0) { queue<int>que; que.push(d[j].second); while (que.size()) { int u = que.front(); que.pop(); sum++; for (auto w = k[u].begin(); w != k[u].end(); w++) { l[*w]--; if (l[*w] == 0)que.push(*w); k[u].erase(w); w--; } } } } else if (t!= k[d[j].second].end()) { k[d[j].second].erase(v); l[d[j].first]--; if (l[d[j].first] == 0) { queue<int>que; que.push(d[j].first); while (que.size()) { int u = que.front(); que.pop(); sum++; for (auto w = k[u].begin(); w != k[u].end(); w++) { l[*w]--; if (l[*w] == 0)que.push(*w); k[u].erase(w); w--; } } } } cout << sum<< endl; } }
a.cc: In function 'int main()': a.cc:18:9: error: 'memset' was not declared in this scope 18 | memset(mincost, -1, sizeof(mincost)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<queue> +++ |+#include <cstring> 9 | #define p pair<int,int>
s366236001
p00550
C++
#include<bits/stdc++.h> using namespace std; struct Edge{ int to,cost; }; struct Node{ int num,val; bool operator<(const Node &r)const{ return val > r.val; } }; priority_queue<Node> que; int main(){ int n,m,q; int u[200005]; int v[200005]; vector<Edge> edge[100005]; vector<Edge> test[100005]; int dist[100005]; int cnt[100005]; memset(dist,-1,sizeof(dist)); memset(cnt,0,sizeof(cnt)); cin >> n >> m >> q; for(int i = 0; i < m; i++){ int a,b; cin >> a >> b; a--;b--; test[a].push_back((Edge){b,1}); test[b].push_back((Edge){a,1}); u[i] = a; v[i] = b; } que.push((Node){0,0}); while(!que.empty()){ int num = que.top().num; int val = que.top().val; que.pop(); if(dist[num] != -1)continue; dist[num] = val; for(int i = 0; i < test[num].size(); i++){ que.push((Node){test[num][i].to,val + test[num][i].cost}); } } for(int i = 0; i < n; i++){ for(int j = 0; j < test[i].size(); j++){ if(dist[i] + 1 == dist[test[i][j].to]){ edge[i].push_back((Edge){test[i][j].to,1}); cnt[test[i][j].to]++; } } } int ans = 0; queue<int> bfs; for(int i = 0; i < q; i++){ int r; cin >> r; r--; if(u[r] > v[r]){ int tmp = u[r]; u[r] = v[r]; v[r] = tmp; } for(int j = 0; j < edge[u[r]].size(); j++){ if(edge[u[r]][j].to == v[r]){ edge[u[r]].erase(edge[u[r]].begin() + j); cnt[v[r]]--; if(cnt[v[r]] == 0){ ans++; bfs.push(v[r]); while(!bfs.empty()){ int idx = bfs.front(); bfs.pop(); for(int k = 0; k < edge[idx].size(); k++){ cnt[edge[idx][k].to]--; if(cnt[edge[idx][k].to] == 0)ans++; bfs.push(edge[idx][k].to); } } } } break; } } cout << ans << endl; } }
a.cc:97:1: error: expected declaration before '}' token 97 | } | ^
s435295519
p00550
C++
#include <cstdio> #include <algorithm> #include <vector> #include <queue> #include <set> using ll = long long; using namespace std; using pll = pair<ll, ll>; #define In_(x) scanf("%lld",&x) ll n, m, q; ll u[200000], v[200000]; vector<pll>graph[100000]; ll dist[100000]; ll parnum[100000]; bool alive[100000]; set<ll>answer; ll main() { //Input In_(n); In_(m); In_(q); for (ll i = 0; i < m; ++i) { ll u_, v_; In_(u_); In_(v_); --u_; --v_; u[i] = u_; v[i] = v_; graph[u_].push_back({ v_,i }); graph[v_].push_back({ u_,i }); } //BFS fill(parnum, parnum + n, 0); fill(dist, dist + n, -1); dist[0] = 0; queue<ll> que; que.push(0); while (!que.empty()) { ll p = que.front(); que.pop(); for (auto rawq : graph[p]) { ll next = rawq.first; if (dist[next] == -1) { dist[next] = dist[p] + 1; que.push(next); ++parnum[next]; } else if (dist[next] == dist[p] + 1) { ++parnum[next]; } } } //Solve For Query fill(alive, alive + n, true); for (ll k = 0; k < q; ++k) { ll qur; In_(qur); --qur; if (dist[v[qur]] != dist[u[qur]]) { queue<ll>que; ll pus = v[qur]; if (dist[v[qur]] < dist[u[qur]])pus = u[qur]; que.push(pus); while (!que.empty()) { ll vec = que.front(); que.pop(); if (!alive[vec])continue; --parnum[vec]; if (parnum[vec] == 0) { answer.emplace(vec); alive[vec] = false; for (auto to : graph[vec]) { if (dist[to.first] == dist[vec] + 1 && alive[to.first]) { que.push(to.first); } } } } } ll count = 0; for (ll i = 0; i < n; ++i) { if (!alive[i])++count; } while (count != answer.size()) {} printf("%d\n", answer.size()); } return 0; }
a.cc:21:1: error: '::main' must return 'int' 21 | ll main() | ^~
s126270750
p00551
C++
* 2016-ho-t4.cpp * * Created on: 2017/02/09 * Author: joi */ #include<cstdio> #include<cstring> int main(void){ int a[200][200]; char b[100]; int n,k; scanf("%d %d",&n,&k); scanf("%s",b); for(int i=0;i<200;i++){ for(int j=0;j<200;j++){ a[i][j]=0; } } int x,y; int ans; x=100; y=100; a[100][100]=1; for(int i=0;i<n;i++){ if(b[i]=='E'){ x++; } if(b[i]=='W'){ x--; } if(b[i]=='N'){ y++; } if(b[i]=='S'){ y--; } a[x][y]=1; } for(int i=0;i<199;i++){ for(int j=0;j<199;j++){ if(a[i][j]==1&&a[i][j+1]==1&&a[i+1][j]==1&&a[i+1][j+1]==1){ ans++; } } } printf("%d\n",ans); }
a.cc:3:25: error: invalid digit "9" in octal constant 3 | * Created on: 2017/02/09 | ^~ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | * 2016-ho-t4.cpp | ^~~~
s713989577
p00551
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair < ll , ll > Pi; typedef pair < Pi , Pi > PPi; typedef pair < ll , Pi > Ti; const ll LLINF = 1LL << 60; const int INF = (1 << 30) - 1; char ch[] = "NESW"; ll dy[] = {-1, 0, 1, 0}; ll dx[] = {0, 1, 0, -1}; ll llabs(ll n) { return (n < 0 ? -n : n); } ll N, K; string S; Pi route[200005]; ll vecy = 0, vecx = 0; vector < PPi > data; ll ans = 0; ll sum[4][200005]; int main() { cin >> N >> K >> S; for(int i = 0; i < N; i++) { int j = 0; while(S[i] != ch[j]) j++; vecy += dy[j], vecx += dx[j]; route[i + 1] = Pi(vecy, vecx); } route[0] = Pi(INF, 2 * N); for(int i = 1; i <= N; i++) { if(vecy < 0) route[i].first = -route[i].first; if(vecx < 0) route[i].second = -route[i].second; if(vecx == 0) swap(route[i].first, route[i].second); route[i].first += INF, route[i].second += N * 2; } vecy = llabs(vecy); vecx = llabs(vecx); if(vecx == 0) vecx = vecy, vecy = 0; sort(route, route + N + 1); if(vecx == 0) { for(int i = 0; i <= N;) { ll y = route[i].first, x = route[i].second; ll *a = route, *b = route + N + 1; if(binary_search(a, b, Pi(y + 1, x)) && binary_search(a, b, Pi(y, x + 1)) && binary_search(a, b, Pi(y + 1, x + 1))) ans++; while(i <= N && route[i].first == y && route[i].second == x) i++; } cout << ans << endl; return (0); } for(int i = 0; i <= N; i++) { ll y = route[i].first, x = route[i].second; data.push_back(PPi(Pi(y - x / vecx * vecy, x % vecx), Pi(x / vecx, x / vecx + K))); } sort(data.begin(), data.end()); data.erase(unique(data.begin(), data.end()), data.end()); for(int i = 0; i < data.size();) { vector < ll > comp; vector < Ti > d; map < ll, ll > conv; ll now[4] = {}; ll r, u, ru; ll iy = data[i].first.first, ix = data[i].first.second; ll plus = (ix + 1) / vecx; Pi pp[4] = {data[i].first, Pi(iy - plus * vecy, (ix + 1) % vecx), Pi(iy + 1, ix), Pi(iy + 1 - plus * vecy, (ix + 1) % vecx)}; Pi nop = Pi(-LLINF, -LLINF); ll pos[4]; pos[0] = i; for(int j = 1; j < 4; j++) pos[j] = lower_bound(data.begin(), data.end(), PPi(pp[j], nop)) - data.begin(); for(int j = 0; j < 4; j++) { while(pos[j] < data.size() && data[pos[j]].first == pp[j]) { ll s = data[pos[j]].second.first - plus * (j % 2) , t = data[pos[j]].second.second - plus * (j % 2); comp.push_back(s); comp.push_back(t); d.push_back(Ti(1, Pi(j, s))); d.push_back(Ti(-1, Pi(j, t))); pos[j]++; } } sort(comp.begin(), comp.end()); comp.erase(unique(comp.begin(), comp.end()), comp.end()); for(int j = 0; j < comp.size(); j++) conv[comp[j]] = j; for(int p = 0; p < 4; p++) for(int j = 0; j < comp.size(); j++) sum[p][j] = 0; for(int j = 0; j < d.size(); j++) sum[d[j].second.first][conv[d[j].second.second]] += d[j].first; for(int j = 0; j < comp.size() - 1; j++) { bool flag = true; for(int k = 0; k < 4; k++) { now[k] += sum[k][j]; if(now[k] <= 0) flag = false; } if(flag) ans += comp[j + 1] - comp[j]; } i = pos[0]; } cout << ans << endl; return (0); }
a.cc: In function 'int main()': a.cc:46:21: error: cannot convert 'Pi*' {aka 'std::pair<long long int, long long int>*'} to 'll*' {aka 'long long int*'} in initialization 46 | ll *a = route, *b = route + N + 1; | ^~~~~ | | | Pi* {aka std::pair<long long int, long long int>*} a.cc:46:43: error: cannot convert 'Pi*' {aka 'std::pair<long long int, long long int>*'} to 'll*' {aka 'long long int*'} in initialization 46 | ll *a = route, *b = route + N + 1; | ~~~~~~~~~~^~~ | | | Pi* {aka std::pair<long long int, long long int>*} a.cc:55:9: error: reference to 'data' is ambiguous 55 | data.push_back(PPi(Pi(y - x / vecx * vecy, x % vecx), Pi(x / vecx, x / vecx + K))); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:57:10: error: reference to 'data' is ambiguous 57 | sort(data.begin(), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:57:24: error: reference to 'data' is ambiguous 57 | sort(data.begin(), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:58:5: error: reference to 'data' is ambiguous 58 | data.erase(unique(data.begin(), data.end()), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:58:23: error: reference to 'data' is ambiguous 58 | data.erase(unique(data.begin(), data.end()), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:58:37: error: reference to 'data' is ambiguous 58 | data.erase(unique(data.begin(), data.end()), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:58:50: error: reference to 'data' is ambiguous 58 | data.erase(unique(data.begin(), data.end()), data.end()); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:21:16: note: 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > > data' 21 | vector < PPi > data; | ^~~~ a.cc:59:24: error: reference to 'data' is ambiguous 59 | for(int i = 0; i < data.size();) { | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class
s462093284
p00551
C++
k=int(input().split()[1]) x=y=0 a={(0,0)} for s in input(): if'E'==s:x+=1 if'N'==s:y+=1 if'W'==s:x-=1 if'S'==s:y-=1 a|={(x,y)} b=set(a) b|={(u+x*i,v+y*i)for u,v in a for i in range(1,k)} print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b))
a.cc:1:1: error: 'k' does not name a type 1 | k=int(input().split()[1]) | ^ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for s in input(): | ^~~ a.cc:10:1: error: 'b' does not name a type 10 | b=set(a) | ^ a.cc:12:6: error: expected constructor, destructor, or type conversion before '(' token 12 | print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b)) | ^ a.cc:12:61: error: expected unqualified-id before '<' token 12 | print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b)) | ^
s133515501
p00553
C
#include <stdio.h> int main(void) { int a[5]; int time; int i; for (i = 0; i <= 4; i++) { scanf_s("%d", &a[i]); } if (a[0] <= 0) { time = a[2] * (0 - a[0]) + a[3] + a[4] * a[1]; } else { time = a[4] * (a[1] - a[0]); } printf("%d", time); return 0; }
main.c: In function 'main': main.c:10:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 10 | scanf_s("%d", &a[i]); | ^~~~~~~ | scanf
s336676651
p00553
C
#include<stdio.h> #include<iostream> using namespace std; int main(void) { int a, b, c, d, e, ans; scanf("%d%d%d%d%d", &a, &b, &c, &d, &e); ans = b*e; if (a < 0) ans += -1 * a*c + d; else if (a == 0) ans += d; printf("%d\n", ans); return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s270794278
p00553
C
#include<stdio.h> #include<iostream> using namespace std; int main(void) { int a, b, c, d, e, ans; scanf("%d%d%d%d%d", &a, &b, &c, &d, &e); if (a < 0) ans = b*e + -1 * a*c + d; else if (a == 0) ans = b*e + d; else ans = (b - a)*e; printf("%d\n", ans); return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s193167066
p00553
C
#include<stdio.h> #include<iostream> using namespace std; int main(void) { int a, b, c, d, e,ondo,f; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); if (a > 0) { f = b - a; ondo=f*e; } else if (a < 0) { ondo = -a*c + d + b*e; } else if (a == 0) { ondo = d + b*e; } printf("%d\n", ondo); return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s290561562
p00553
C++
square1001?¨±?????????
a.cc:1:12: error: extended character ± is not valid in an identifier 1 | square1001?¨±????????? | ^ a.cc:1:1: error: 'square1001' does not name a type 1 | square1001?¨±????????? | ^~~~~~~~~~
s836132454
p00553
C++
#include <iostream> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <vector> using namespace std; int a; int b; int c; int d; int e; int f; int time; int main(){ cin >> a; cin >> b; cin >> c; cin >> d; cin >> e; if (a < 0){ time += (0 - a)*c; a = 0; } if (a == 0){ time += d; f = 1; } if (a >= 0){ time += (b - a)*e; } cout << time << endl; return 0; }
a.cc:16:5: error: 'int time' redeclared as different kind of entity 16 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, from /usr/include/c++/14/ext/atomicity.h:35, from /usr/include/c++/14/bits/ios_base.h:39, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)' 76 | extern time_t time (time_t *__timer) __THROW; | ^~~~ a.cc: In function 'int main()': a.cc:24:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 24 | time += (0 - a)*c; | ~~~~~^~~~~~~~~~~~ a.cc:24:22: error: assignment of read-only location 'time' a.cc:28:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 28 | time += d; | ~~~~~^~~~ a.cc:28:22: error: assignment of read-only location 'time' a.cc:34:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 34 | time += (b - a)*e; | ~~~~~^~~~~~~~~~~~ a.cc:34:22: error: assignment of read-only location 'time'
s574223324
p00553
C++
#include <iostream> using namespace std; int a; int b; int c; int d; int e; int f; int time; int main(){ cin >> a; cin >> b; cin >> c; cin >> d; cin >> e; if (a < 0){ time += (0 - a)*c; a = 0; } if (a == 0){ time += d; f = 1; } if (a >= 0){ time += (b - a)*e; } cout << time << endl; return 0; }
a.cc:10:5: error: 'int time' redeclared as different kind of entity 10 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, from /usr/include/c++/14/ext/atomicity.h:35, from /usr/include/c++/14/bits/ios_base.h:39, 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)' 76 | extern time_t time (time_t *__timer) __THROW; | ^~~~ a.cc: In function 'int main()': a.cc:18:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 18 | time += (0 - a)*c; | ~~~~~^~~~~~~~~~~~ a.cc:18:22: error: assignment of read-only location 'time' a.cc:22:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | time += d; | ~~~~~^~~~ a.cc:22:22: error: assignment of read-only location 'time' a.cc:28:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 28 | time += (b - a)*e; | ~~~~~^~~~~~~~~~~~ a.cc:28:22: error: assignment of read-only location 'time'
s929453401
p00553
C++
#include <iostream> using namespace std; int a; int b; int c; int d; int e; int f; int time; int main(){ cin >> a; cin >> b; cin >> c; cin >> d; cin >> e; if (a < 0){ time += (0 - a)*c; a = 0; } if (a == 0){ time += d; f = 1; } if (a >= 0){ time += (b - a)*e; } cout << time << endl; return 0; }
a.cc:10:5: error: 'int time' redeclared as different kind of entity 10 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, from /usr/include/c++/14/ext/atomicity.h:35, from /usr/include/c++/14/bits/ios_base.h:39, 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)' 76 | extern time_t time (time_t *__timer) __THROW; | ^~~~ a.cc: In function 'int main()': a.cc:18:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 18 | time += (0 - a)*c; | ~~~~~^~~~~~~~~~~~ a.cc:18:22: error: assignment of read-only location 'time' a.cc:22:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | time += d; | ~~~~~^~~~ a.cc:22:22: error: assignment of read-only location 'time' a.cc:28:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] 28 | time += (b - a)*e; | ~~~~~^~~~~~~~~~~~ a.cc:28:22: error: assignment of read-only location 'time'
s264064308
p00553
C++
#include<bits/stdc++.h> using namespace std; int a[100000000}; int main(){ memset(a,-1,sizeof(-1)); }
a.cc:4:16: error: expected ']' before '}' token 4 | int a[100000000}; | ^ | ] a.cc:4:16: error: expected declaration before '}' token a.cc: In function 'int main()': a.cc:6:12: error: 'a' was not declared in this scope 6 | memset(a,-1,sizeof(-1)); | ^
s009943908
p00553
C++
GNU nano 2.5.3 ????????????: JOI20161.c #include<iostream> using namespace std; int main() { int a,b,c,d,e,w,m,v; cin>>a>>b>>c>>d>>e; if(a<0) { w=-a*c; m=d; v=b*e; } else if(a==0) { w=0; m=d; v=d*e; } else { w=0; m=0; v=d*e; } cout<<w+m+v<<endl; return 0; }
a.cc:1:12: error: too many decimal points in number 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~~~ a.cc:1:3: error: 'GNU' does not name a type 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT |
s093816734
p00553
C++
GNU nano 2.5.3 ????????????: JOI20161.c #include<iostream> using namespace std; int main() { int a,b,c,d,e,w,m,v; cin>>a>>b>>c>>d>>e; if(a<0) { w=-a*c; m=d; v=b*e; } else if(a==0) { w=0; m=d; v=b*e; } else { w=0; m=0; v=(b-a)*e; } cout<<w+m+v<<endl; return 0; }
a.cc:1:12: error: too many decimal points in number 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~~~ a.cc:1:3: error: 'GNU' does not name a type 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* _
s976351641
p00553
C++
GNU nano 2.5.3 ????????????: JOI20161.c #include<iostream> using namespace std; int main() { int a,b,c,d,e,w,m,v; cin>>a>>b>>c>>d>>e; if(a<=0) { w=-a*c; m=d; v=b*e; } else if(a==0) { w=0; m=d; v=b*e; } else { w=0; m=0; v=(b-a)*e; } cout<<w+m+v<<endl; return 0; }
a.cc:1:12: error: too many decimal points in number 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~~~ a.cc:1:3: error: 'GNU' does not name a type 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* _
s493748640
p00553
C++
GNU nano 2.5.3 ????????????: JOI20161.c #include<iostream> using namespace std; int main() { int a,b,c,d,e,w,m,v; cin>>a>>b>>c>>d>>e; if(a<=0) { w=-a*c; m=d; v=b*e; } else if(a==0) { w=0; m=d;#include<iostream> using namespace std; int main() { int a,b,c,d,e,w,m,v; cin>>a>>b>>c>>d>>e; if(a<0) { w=-a*c; m=d; v=b*e; } else if(a==0) { w=0; m=d; v=b*e; } else { w=0; m=0; v=(b-a)*e; } cout<<w+m+v<<endl; return 0; } v=b*e; } else { w=0; m=0; v=(b-a)*e; } cout<<w+m+v<<endl; return 0; }
a.cc:1:12: error: too many decimal points in number 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~~~ a.cc:18:21: error: stray '#' in program 18 | m=d;#include<iostream> | ^ a.cc:1:3: error: 'GNU' does not name a type 1 | GNU nano 2.5.3 ????????????: JOI20161.c | ^~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:3: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: de
s784996390
p00553
C++
#include <iostream> using namespace std; int msin(void) { int a,b,c,d,e,f,g,h,i; cin>>a>>b>>c>>d>>e; f=0; if (a<0) { for (;;) { a++; f=f+c; if (a==b) { cout<<f<<endl; return 0; } if (a<=0) { break; } } } if (a==0) { f=f+c; } if (a>0) { a++; f=f+d; if (a==b) { cout<<f<<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
s810041614
p00553
C++
#include <iostream> using namespace std; int msin(void) { int a,b,c,d,e,f,g,h,i; cin>>a>>b>>c>>d>>e; f=0; if (a<0) { for (;;) { a++; f=f+c; if (a==0) { f=f+d; } if (a==b) { cout<<f<<endl; return 0; } if (a==0) { break; } } } if (a>0) { a++; f=f+d; if (a==b) { cout<<f<<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
s255476334
p00553
C++
#include <iostream> #include <stdio.h> #include <string> #include <string.h> using namespace std; int main (void) { long n,a,b,x,y,z,p,q,r; cin >> n >> a >> x >> y >> z; if (n < 0) { p = 0; p = x * (0 - n); q = 0; q = y; r = 0; r = z * a; cout << p + q + r << endl; } else if (n == 0) { p = 0; q = 0; q = y; r = 0; r = z * a; cout << p + q + r << endl; } else if (n > 0) {p =0 ; q = 0; r = z * a; cout << p + q + r << endl; } } }
a.cc:44:1: error: expected declaration before '}' token 44 | } | ^
s933993251
p00554
C
#include<stdio.h> int main(void) { int i,j,temp,m,n,c,a[1001],h=0; scanf("%d %d",&n,&m); for(i=1;i<m+1;i++){ scanf("%d %d",&a[i],&m); } for(i=0;i<m;i++){ for(j=m-1;j>i;j--){ if(a[i]>a[j]){ temp=a[i]; a[i]=a[j]; a[j]=temp; } } } j=0; for(i=0;i<m;i++){ if(m-1<=j){ break; } if(a[j]>=m-1){ j++; } } else if(a[i]<=m-1){ h=(m-1)-a[i]; c+=h; } printf("%d\n",c); return 0; }
main.c: In function 'main': main.c:28:17: error: 'else' without a previous 'if' 28 | else if(a[i]<=m-1){ | ^~~~
s594113592
p00554
C
#include<stdio.h> int main(void){ int n=0,m=0,a=0,b=0,c=0,sum=0,max=0; scanf("%d %d"&n,&m); for(int i=0;i<m;i++){ scanf("%d %d"&a,&b); c=n-a; if(c>0){ sum+=c; } if(c>max){ max=c; } } printf("%d\n",sum-max); return 0; }
main.c: In function 'main': main.c:4:22: error: invalid operands to binary & (have 'char *' and 'int') 4 | scanf("%d %d"&n,&m); | ~~~~~~~^ | | | char * main.c:6:30: error: invalid operands to binary & (have 'char *' and 'int') 6 | scanf("%d %d"&a,&b); | ~~~~~~~^ | | | char *
s979607843
p00554
C
#include<stdio.h> int n, m; //????????? int a, b, c; //???????????????????????????????????? int i; int sum, max; int main() { scanf_s("%d %d", &n, &m); for (i = 0; i < M; i++) { scanf_s("%d %d", &a, &b); c = N - a; if (c>0) { sum += c; } else if(c>=max){ max = c; } } printf("%d\n", sum - max); return 0; }
main.c: In function 'main': main.c:11:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 11 | scanf_s("%d %d", &n, &m); | ^~~~~~~ | scanf main.c:13:25: error: 'M' undeclared (first use in this function) 13 | for (i = 0; i < M; i++) { | ^ main.c:13:25: note: each undeclared identifier is reported only once for each function it appears in main.c:15:21: error: 'N' undeclared (first use in this function) 15 | c = N - a; | ^
s031362039
p00554
C
#include<stdio.h> int n, m; //????????? int a, b, c; //???????????????????????????????????? int i; int sum, max; int main() { scanf("%d %d", &n, &m); for (i = 0; i < M; i++) { scanf("%d %d", &a, &b); c = N - a; if (c>0) { sum += c; } else if(c>=max){ max = c; } } printf("%d\n", sum - max); return 0; }
main.c: In function 'main': main.c:13:25: error: 'M' undeclared (first use in this function) 13 | for (i = 0; i < M; i++) { | ^ main.c:13:25: note: each undeclared identifier is reported only once for each function it appears in main.c:15:21: error: 'N' undeclared (first use in this function) 15 | c = N - a; | ^
s161976678
p00554
C++
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cstdlib> using namespace std; int main() { int n, m, now = 0, g = 0, mo = 0, p[1005][2], s[1005] = {0}; cin >> n >> m; for (int i = 0; i < m; i++ ) { int a, b; cin >> a >> b; p[i][0] = a; p[i][1] = b; if (a >= b) { g++; } else { int c = n - a; for (int j = now; j >= 0; j--) { if (s[j-1] > c ) { s[j] = s[j-1]; } else { s[j] = c; now++; break; } } } } } for (int i = 0; i < m; i++) { if (g < m - 1) { mo += s[i]; cout << mo << endl; g++; } } cout << mo << endl; return 0; }
a.cc:39:9: error: expected unqualified-id before 'for' 39 | for (int i = 0; i < m; i++) { | ^~~ a.cc:39:25: error: 'i' does not name a type 39 | for (int i = 0; i < m; i++) { | ^ a.cc:39:32: error: 'i' does not name a type 39 | for (int i = 0; i < m; i++) { | ^ a.cc:48:9: error: 'cout' does not name a type 48 | cout << mo << endl; | ^~~~ a.cc:49:9: error: expected unqualified-id before 'return' 49 | return 0; | ^~~~~~ a.cc:50:1: error: expected declaration before '}' token 50 | } | ^
s466984128
p00554
C++
#include<stdio.h> int main(void){ int n=0,m=0,a=0,b=0,c=0,sum=0,max=0; scanf("%d %d"&n,&m); for(int i=0;i<m;i++){ scanf("%d %d"&a,&b); c=n-a; if(c>0){ sum+=c; } if(c>max){ max=c; } } printf("%d\n",sum-max); return 0; }
a.cc: In function 'int main()': a.cc:4:22: error: invalid operands of types 'const char [6]' and 'int' to binary 'operator&' 4 | scanf("%d %d"&n,&m); | ~~~~~~~^~ | | | | | int | const char [6] a.cc:6:30: error: invalid operands of types 'const char [6]' and 'int' to binary 'operator&' 6 | scanf("%d %d"&a,&b); | ~~~~~~~^~ | | | | | int | const char [6]
s733575605
p00554
C++
#include <iostream> using namespace std; int main(void) { int N,M,a,b,c[1000]={0},d,e,f,g; cin>>N>>M; for (a=0;a<M;a++) { cin>>b>>d; c[a]=b; } sort(c,c+1000); for (a=999;a>=0;a--) { if (c[a]>=N/2) { e++; if (e>=M-1) { break; } } } cout<<e<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(c,c+1000); | ^~~~ | short
s954748857
p00554
C++
#include <iostream> #include <stdio.h> #include <string> #include <string.h> using namespace std; int main (void) { int n,m,a[100],b[100],cou,x; cin >> n >> m; cou = 0; x = 200; for (int i = 0; i < m; i++) { cin >> a[i] >> b[i]; if (a[i] >= b[i]) { cou++; } } if (cou >= m - 1) { cout << '0' << endl; } else { for (int i = 0; i < m; i++) { if (a[i] < b[i] && x > (b[i] - a[i])) { x = 0; x = b[i] - a[i]; } } }???
a.cc: In function 'int main()': a.cc:38:10: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:11: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:12: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:13: error: expected primary-expression at end of input 38 | }??? | ^ a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected '}' at end of input a.cc:9:1: note: to match this '{' 9 | { | ^
s931854642
p00554
C++
#include <iostream> #include <stdio.h> #include <string> #include <string.h> using namespace std; int main (void) { int n,m,a[100],b[100],cou,x; cin >> n >> m; cou = 0; x = 200; for (int i = 0; i < m; i++) { cin >> a[i] >> b[i]; if (a[i] >= b[i]) { cou++; } } if (cou >= m - 1) { cout << '0' << endl; } else { for (int i = 0; i < m; i++) { if (a[i] < b[i] && x > (b[i] - a[i])) { x = 0; x = b[i] - a[i]; } }???
a.cc: In function 'int main()': a.cc:38:10: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:11: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:12: error: expected primary-expression before '?' token 38 | }??? | ^ a.cc:38:13: error: expected primary-expression at end of input 38 | }??? | ^ a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected ':' at end of input 38 | }??? | ^ | : a.cc:38:13: error: expected primary-expression at end of input a.cc:38:13: error: expected '}' at end of input a.cc:29:9: note: to match this '{' 29 | { | ^ a.cc:38:13: error: expected '}' at end of input 38 | }??? | ^ a.cc:9:1: note: to match this '{' 9 | { | ^
s499956233
p00554
C++
#include <iostream> using namespace std; int main(){ int n,m,x,y,z; cin >> n >> m; x = 0; y = 0; z = 0; for(int i=0;i<m;i++){ int a,b; cin >> a >> b; if( a < n ){ y = n-a; x = x+y z = max( z , y ); } } cout << x-z << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:32: error: expected ';' before 'z' 16 | x = x+y | ^ | ; 17 | z = max( z , y ); | ~
s026678824
p00554
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; int A[1000],B[1000]; for(int i = 0; i < M; i++){ cin >> A[i] >> B[i]; } list<int> l; int count = 0; for(int i = 0; i < M; i++){ if(A[i] >= B[i]) count++; if(A[i] < B[i]) l.push_back(B[i] - A[i]); } } l.sort(); int ans = 0; while(count < M - 1){ count++; ans += l.front() / 2; l.pop_front(); } cout << ans << endl; return 0; }
a.cc:20:3: error: 'l' does not name a type 20 | l.sort(); | ^ a.cc:23:3: error: expected unqualified-id before 'while' 23 | while(count < M - 1){ | ^~~~~ a.cc:28:3: error: 'cout' does not name a type 28 | cout << ans << endl; | ^~~~ a.cc:30:3: error: expected unqualified-id before 'return' 30 | return 0; | ^~~~~~ a.cc:31:1: error: expected declaration before '}' token 31 | } | ^
s709350553
p00554
C++
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; int main() { //合計時間 int N, M; cin >> N >> M; int a; vector<int> A; int b=0; for (int i = 0; i < 2*M; i+=2) { cin >> a; if (a < N) { A.push_back(a); break; } b++; } int sum = 0; if (b < M - 1) { sort(A.begin, A.end); reverse(A.begin, A.end); for (int i = 0; i < M - 1 - b; i++) { sum += N - A[i]; } } cout << sum << endl; /* int sum=0, n; for (int i = 0; i < 4; i++) { cin >> n; sum += n; } cout << sum / 60 << endl; cout << sum % 60 << endl; //平均点 /* int P[5]; int sum=0; for (int i = 0; i < 5; i++) { cin >> P[i]; if (P[i] < 40) P[i] = 40; sum += P[i]; } cout << sum / 5 << endl; */ //投票 /* int N, M; cin >> N >> M; int A[1000], vote[1000]; for (int i = 0; i < N; i++) { cin >> A[i]; vote[i] = 0; } int b; for (int i = 0; i < M; i++) { cin >> b; for (int j = 0; j < N; j++) { if (A[j] <= b) { vote[j]++; break; } } } int temps = 0, ans; for (int i = 0; i < N; i++) { if (vote[i] > temps) { temps = vote[i]; ans = i; } } cout << ans + 1 << endl; */ //2.すごろく /* int n; cin >> n; int A, _A = 1; int k = 0; int A_count[100]; A_count[0] = 1; for (int i = 0; i < n; i++) { cin >> A; if (A == 1) { if (A == _A) { A_count[k]++; } else { k++; A_count[k] = 2; } } _A = A; } sort(A_count, A_count + k + 1); cout << A_count[k] << endl; */ //タイムカード /* int t[2][3]; int x[3][3]; for (int n=0; n < 3; n++) { for (int i=0; i < 2; i++) for (int k=0; k < 3; k++) cin >> t[i][k]; for (int m = 2; m >= 0; m--) { x[n][m] = t[1][m] - t[0][m]; if (t[0][m] > t[1][m]) { x[n][m] += 60; t[1][m - 1]--; } } } for (int n= 0; n < 3; n++) { cout << x[n][0] << ' ' << x[n][1] <<' '<< x[n][2] << endl; } */ return 0; }
a.cc: In function 'int main()': a.cc:26:21: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 26 | sort(A.begin, A.end); | ~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:26:21: note: couldn't deduce template parameter '_RAIter' 26 | sort(A.begin, A.end); | ~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided a.cc:27:24: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 27 | reverse(A.begin, A.end); | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:27:24: note: couldn't deduce template parameter '_BIter' 27 | reverse(A.begin, A.end); | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s536452620
p00554
C++
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; int main() { //合計時間 int N, M; cin >> N >> M; int a; vector<int> A; int b=0; for (int i = 0; i < 2*M; i+=2) { cin >> a; if (a < N) { A.push_back(a); break; } b++; } int sum = 0; if (b < M - 1) { sort(A.begin, A.end); reverse(A.begin, A.end); for (int i = 0; i < M - 1 - b; i++) { sum += N - A[i]; } } cout << sum << endl; /* int sum=0, n; for (int i = 0; i < 4; i++) { cin >> n; sum += n; } cout << sum / 60 << endl; cout << sum % 60 << endl; //平均点 /* int P[5]; int sum=0; for (int i = 0; i < 5; i++) { cin >> P[i]; if (P[i] < 40) P[i] = 40; sum += P[i]; } cout << sum / 5 << endl; */ //投票 /* int N, M; cin >> N >> M; int A[1000], vote[1000]; for (int i = 0; i < N; i++) { cin >> A[i]; vote[i] = 0; } int b; for (int i = 0; i < M; i++) { cin >> b; for (int j = 0; j < N; j++) { if (A[j] <= b) { vote[j]++; break; } } } int temps = 0, ans; for (int i = 0; i < N; i++) { if (vote[i] > temps) { temps = vote[i]; ans = i; } } cout << ans + 1 << endl; */ //2.すごろく /* int n; cin >> n; int A, _A = 1; int k = 0; int A_count[100]; A_count[0] = 1; for (int i = 0; i < n; i++) { cin >> A; if (A == 1) { if (A == _A) { A_count[k]++; } else { k++; A_count[k] = 2; } } _A = A; } sort(A_count, A_count + k + 1); cout << A_count[k] << endl; */ //タイムカード /* int t[2][3]; int x[3][3]; for (int n=0; n < 3; n++) { for (int i=0; i < 2; i++) for (int k=0; k < 3; k++) cin >> t[i][k]; for (int m = 2; m >= 0; m--) { x[n][m] = t[1][m] - t[0][m]; if (t[0][m] > t[1][m]) { x[n][m] += 60; t[1][m - 1]--; } } } for (int n= 0; n < 3; n++) { cout << x[n][0] << ' ' << x[n][1] <<' '<< x[n][2] << endl; } */ return 0; }
a.cc: In function 'int main()': a.cc:26:21: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 26 | sort(A.begin, A.end); | ~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:26:21: note: couldn't deduce template parameter '_RAIter' 26 | sort(A.begin, A.end); | ~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided a.cc:27:24: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)' 27 | reverse(A.begin, A.end); | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:27:24: note: couldn't deduce template parameter '_BIter' 27 | reverse(A.begin, A.end); | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s944689077
p00554
C++
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; int main() { //合計時間 int N, M; cin >> N >> M; int a; int A[5000]; int b = 0; int x = 0; for (int i = 0; i < 2 * M; i++) { cin >> a; if (a < N) { A[x]=a; x++; break; } b++; cin >> a; } int sum = 0; if (b < M - 1) { sort(A.begin(), A.end()); reverse(A.begin(), A.end()); for (int i = 0; i < M - 1 - b; i++) { sum += N - A[i]; } } cout << sum << endl; /* int sum=0, n; for (int i = 0; i < 4; i++) { cin >> n; sum += n; } cout << sum / 60 << endl; cout << sum % 60 << endl; //平均点 /* int P[5]; int sum=0; for (int i = 0; i < 5; i++) { cin >> P[i]; if (P[i] < 40) P[i] = 40; sum += P[i]; } cout << sum / 5 << endl; */ //投票 /* int N, M; cin >> N >> M; int A[1000], vote[1000]; for (int i = 0; i < N; i++) { cin >> A[i]; vote[i] = 0; } int b; for (int i = 0; i < M; i++) { cin >> b; for (int j = 0; j < N; j++) { if (A[j] <= b) { vote[j]++; break; } } } int temps = 0, ans; for (int i = 0; i < N; i++) { if (vote[i] > temps) { temps = vote[i]; ans = i; } } cout << ans + 1 << endl; */ //2.すごろく /* int n; cin >> n; int A, _A = 1; int k = 0; int A_count[100]; A_count[0] = 1; for (int i = 0; i < n; i++) { cin >> A; if (A == 1) { if (A == _A) { A_count[k]++; } else { k++; A_count[k] = 2; } } _A = A; } sort(A_count, A_count + k + 1); cout << A_count[k] << endl; */ //タイムカード /* int t[2][3]; int x[3][3]; for (int n=0; n < 3; n++) { for (int i=0; i < 2; i++) for (int k=0; k < 3; k++) cin >> t[i][k]; for (int m = 2; m >= 0; m--) { x[n][m] = t[1][m] - t[0][m]; if (t[0][m] > t[1][m]) { x[n][m] += 60; t[1][m - 1]--; } } } for (int n= 0; n < 3; n++) { cout << x[n][0] << ' ' << x[n][1] <<' '<< x[n][2] << endl; } */ return 0; }
a.cc: In function 'int main()': a.cc:29:24: error: request for member 'begin' in 'A', which is of non-class type 'int [5000]' 29 | sort(A.begin(), A.end()); | ^~~~~ a.cc:29:35: error: request for member 'end' in 'A', which is of non-class type 'int [5000]' 29 | sort(A.begin(), A.end()); | ^~~ a.cc:30:27: error: request for member 'begin' in 'A', which is of non-class type 'int [5000]' 30 | reverse(A.begin(), A.end()); | ^~~~~ a.cc:30:38: error: request for member 'end' in 'A', which is of non-class type 'int [5000]' 30 | reverse(A.begin(), A.end()); | ^~~
s333632191
p00554
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> #include <cstring> #include <deque> #include <iomanip> #include <limits> #include <fstream> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) #define CLR(mat) memset(mat, 0, sizeof(mat)) typedef long long ll; typedef pair<int, int> P; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<int> v(m); FOR(i,0,m){ int a, b; cin >> a >> b; v[i] = P(a, b); } int ans = 0; sort(v.begin(), v.end()); FOR(i,1,m){ if(v[i].first < n){ ans += n - v[i].first; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:35:14: error: cannot convert 'P' {aka 'std::pair<int, int>'} to '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} in assignment 35 | v[i] = P(a, b); | ^~~~~~~ | | | P {aka std::pair<int, int>} a.cc:40:15: error: request for member 'first' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 40 | if(v[i].first < n){ | ^~~~~ a.cc:41:27: error: request for member 'first' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 41 | ans += n - v[i].first; | ^~~~~
s030686153
p00555
C++
/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
s885099322
p00555
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> using namespace std; int board[1234][1234]; //#=-1 .=0 int main(void) { int n, m, d; scanf("%d %d %d", &n, &m, &d); memset(board, 0xff, sizeof(board)); for (int i = 0; i < n; ++i) { char str[123]; scanf("%s", str); for (int j = 0; j < m; ++j) { board[i][j] = (str[j] == '#') ? -1 : 0; } } int ans = 0; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { bool flag = true; for (int dd = 0; dd < d; ++dd) { if (board[i][j + dd] == -1) { flag = false; break; } } if (flag) { ++ans; } flag = true; for (int dd = 0; dd < d; ++dd) { if (board[i + dd][j] == -1) { flag = false; break; } } if (flag) { ++ans; } } } printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(board, 0xff, sizeof(board)); | ^~~~~~ a.cc:20:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 19 | #include <queue> +++ |+#include <cstring> 20 | using namespace std;
s190304119
p00555
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; void main() { int i, j, m, n, d, c, cnt = 0; int b[100][100]; char a[100][101] = { -1 }; cin >> n >> m >> d; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { cin >> a[i][j]; if (a[i][j] == '#') { b[i][j] = 1; } else { b[i][j] = 0; } } } //???????????? /*for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { printf("%d", b[i][j]); } printf("\n"); }*/ //????????? for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (b[i][j] == 0) { for (c = 1; c <= d + 1; c++) { if (b[i][j + c] == 1) { break; } if (c == d) { cnt++; break; } } } } } for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (b[i][j] == 0) { for (c = 1; c <= d + 1; c++) { if (b[i +c][j] == 1) { break; } if (c == d) { cnt++; break; } } } } } //?????? cout << cnt << endl; }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~
s629576786
p00555
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; void main() { int i, j, m, n, d, c, cnt = 0; int b[100][100]; char a[100][101] = { -1 }; cin >> n >> m >> d; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { cin >> a[i][j]; if (a[i][j] == '#') { b[i][j] = 1; } else { b[i][j] = 0; } } } //???????????? /*for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { printf("%d", b[i][j]); } printf("\n"); }*/ //????????? for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (i+d<=n) { for (c = 0; c < d+1 ; c++) { if (b[i][j + c] == 1) { break; } if (c == d) { cnt++; break; } } } } } for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { if (b[i][j] == 0) { for (c =0; c < d+1; c++) { if (b[i +c][j] == 1) { break; } if (c == d) { cnt++; break; } } } } } //?????? cout << cnt << endl; }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~
s011292877
p00555
C++
int main() { int n, m, d; cin >> n >> m >> d; vector<string> map; string s; for (int i = 0; i < n; i++) { cin >> s; map.emplace_back(s); } int ans = 0; for (int i = 0; i < n; i++) { for (int j = 0; j <= m - d + 1; j++) { int count = 0; for (int o = 0; o < d; o++) { if (map[i][j + o] == '.')count++; } if (count == d)ans++; } } for (int j = 0; j < m; j++) { for (int i = 0; i < n - d + 1; i++) { int count = 0; for (int o = 0; o < d; o++) { if (map[i + o][j] == '.')count++; } if (count == d)ans++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> n >> m >> d; | ^~~ a.cc:5:9: error: 'vector' was not declared in this scope 5 | vector<string> map; | ^~~~~~ a.cc:5:16: error: 'string' was not declared in this scope 5 | vector<string> map; | ^~~~~~ a.cc:5:24: error: 'map' was not declared in this scope 5 | vector<string> map; | ^~~ a.cc:6:15: error: expected ';' before 's' 6 | string s; | ^~ | ; a.cc:8:24: error: 's' was not declared in this scope 8 | cin >> s; | ^ a.cc:30:9: error: 'cout' was not declared in this scope 30 | cout << ans << endl; | ^~~~ a.cc:30:24: error: 'endl' was not declared in this scope 30 | cout << ans << endl; | ^~~~
s077933984
p00555
C++
#include <iostream> using namespace std; int main(){ int n,m,d; cin >> n >> m >> d; int kaijou[100][100]; char c; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin >> c; if(c=='.'){ kaijou[i][j]=1; }else if(c=='#'){ kaijou[i][j]=0; } } } int ans=0; int nagasa; for(int i=0;i<n;i++){ nagasa=0; for(int j=0;j<m;j++){ if(kaijou[i][j]){ nagasa++; }else{ ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 nagasa=0; } } ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 } for(int i=0;i<m;i++){ nagasa=0; for(int j=0;j<n;j++){ if(kaijou[j][i]){ nagasa++; }else{ ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 nagasa=0; } } ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:28:45: error: expected ';' before 'nagasa' 28 | ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 | ^ | ; 29 | nagasa=0; | ~~~~~~ a.cc:32:41: error: expected ';' before '}' token 32 | ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 | ^ | ; 33 | } | ~ a.cc:40:45: error: expected ';' before 'nagasa' 40 | ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 | ^ | ; 41 | nagasa=0; | ~~~~~~ a.cc:44:41: error: expected ';' before '}' token 44 | ans+=(nagasa-d+1>0)?(nagasa-d+1>0):0 | ^ | ; 45 | } | ~
s119994753
p00556
C++
//Plush Toys #include <iostream> #include <algorithm> #include <vector> #include <numeric> using namespace std; int A[100000], B[21] = {}; int N, M; int getCost(vector<int> v) { int cnt = 0; int i = 0; for(auto j : v) { int k = B[j]; while(k > 0) { if(A[i++] != j) cnt++; k--; } } return cnt; } int main() { cin >> N >> M; for(int i = 0; i < N; i++) { cin >> A[i]; B[A[i]]++; } vector<int> v(M); iota(v.begin(), v.end(), 1); int cost = INT_MAX; do { cost = min(cost, getCost(v)); } while( next_permutation(v.begin(), v.end()) ); cout << cost << endl; }
a.cc: In function 'int main()': a.cc:37:16: error: 'INT_MAX' was not declared in this scope 37 | int cost = INT_MAX; | ^~~~~~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 | #include <numeric> +++ |+#include <climits> 6 |
s451480728
p00556
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<functional> #include<unordered_map> using namespace std; int ruisekiwa[100001][20]; int main() { memset(ruisekiwa, 0, sizeof(ruisekiwa)); int a, b; cin >> a >> b; int c[20]{}; for (int d = 0; d < a; d++) { int e; scanf("%d", &e); e--; c[e]++; for (int f = 0; f < b; f++) { ruisekiwa[d + 1][f] = c[f]; } } unordered_map<int, int>MINCOST;//20 19.......2 1 for (int i = 1; i <= b; i++) { for (int bit = 0; bit < (1 << b); bit++) { int sum = 0, r = 0;; for (int g = 0; g < 22; g++) { if (bit >> g & 1) { sum++; r += ruisekiwa[a][g]; } } if (sum == i) { int MIN = 1 << 29; for (int g = 0; g < 22; g++) { if (bit >> g & 1) { int copy = 1 << g; bit -= copy; MIN = min(MIN, MINCOST[bit] + ruisekiwa[a][g] - (ruisekiwa[r][g] - ruisekiwa[r - ruisekiwa[a][g]][g])); bit += copy; } MINCOST[bit] = MIN; } } } } for (int i = 0; i < (1 << b); i++) { cout << i << " " << MINCOST[i] << endl; } }
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(ruisekiwa, 0, sizeof(ruisekiwa)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<functional> +++ |+#include <cstring> 6 | #include<unordered_map>
s293641602
p00556
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> using namespace std; int n, m; int dist[1 << 20]; int cost[20][123456]; int nui[123456]; int ncount[20]; int memo[1 << 20]; int dp(int bit) { if (bit == 0)return 0; if (memo[bit] >= 0)return memo[bit]; int ans = 123456789; for (int i = 0; i < 20; ++i) { if (bit & (1 << i)) { int lastbit = bit - (1 << i); ans = min(ans, dp(lastbit) + cost[i][dist[lastbit]]); } } return memo[bit] = ans; } int main(void) { scanf("%d %d", &n, &m); memset(memo, 0xff, sizeof(memo)); fill(ncount, ncount + 20, 0); for (int i = 0; i < n; ++i) { scanf("%d", nui + i); --nui[i]; ++ncount[nui[i]]; } dist[0] = 0; for (int bit = 1; bit < (1 << m); ++bit) { int bigb = 0; for (int i = 0; i < 20; ++i) { if (bit & (1 << i)) { bigb = i; break; } } dist[bit] = dist[bit - (1 << bigb)] + ncount[bigb]; } for (int j = 0; j < m; ++j) { //cost int price = 0; for (int first = 0; first < ncount[j]; ++first) { if (nui[first] == j) { ++price; } } for (int shack = 0; shack <= n - ncount[j]; ++shack) { cost[j][shack] = ncount[j] - price; if (nui[shack] == j) { --price; } if (shack != n - ncount[j] && nui[shack + ncount[j]] == j) { ++price; } } } int ans = dp((1 << m) - 1); printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:49:9: error: 'memset' was not declared in this scope 49 | memset(memo, 0xff, sizeof(memo)); | ^~~~~~ a.cc:20:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 19 | #include <queue> +++ |+#include <cstring> 20 | using namespace std;
s701484813
p00556
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,int> plli; typedef pair<int,pii> pipii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef vector<pii> vpii; #define int long long #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n);i>=0;i--) #define rrep2(i,a,b) for (int i=(a);i>b;i--) #define pb push_back #define fi first #define se second #define all(a) (a).begin(),(a).end() const ll mod = 1e9 + 7; const ll INF = 1<<30; const int dx4[4] = {1, 0, -1, 0}; const int dy4[4] = {0, 1, 0, -1}; const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1}; const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1}; const double pi = 3.141592653589793; int n, m; int p[100000 + 5]; int s[100000 + 5][25]; int cnt[25]; int dp[1<<21]; signed main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n >> m; rep(i, n) cin >> p[i]; rep(i, n) cnt[p[i] - 1] += 1; rep(i, n) s[i + 1][p[i] - 1] += 1; rep(i, n)rep(j, m) s[i + 1][j] += s[i][j]; fill(dp, dp + (1<<m) + 1, 1e9); dp[0] = 0; rep(i, 1<<m) { rep(j, m) { if (i>>j & 1) { int l = 0; int r = 0; rep(k, m) { if (k == j) r = cnt[k]; else if (i>>k & 1) l += cnt[k]; } r += l int change = (r - l) - (s[r][j] - s[l][j]); dp[i] = min(dp[i], dp[i ^ (1<<j)] + change); } } } cout << dp[(1<<m) - 1] << endl; }
a.cc: In function 'int main()': a.cc:57:23: error: expected ';' before 'long' 57 | r += l | ^ | ; a.cc:59:53: error: 'change' was not declared in this scope 59 | dp[i] = min(dp[i], dp[i ^ (1<<j)] + change); | ^~~~~~
s048422959
p00556
C++
7 2 1 2 2 2 1 2 1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 7 2 | ^
s672589024
p00557
C++
#include<iostream> #include<string> #include<cstdio> #include<algorithm> #include<functional> #include<queue> #include<unordered_map> #include<unordered_set> #define p pair<int,int> #define P pair<int,p> using namespace std; int hyoukou[1002][1002]; int x[4] = { -1,0,0,1 }, y[4] = { 0,-1,1,0 }; int main() { unordered_map<int, unordered_set<int>>U; memset(hyoukou, 1, sizeof(hyoukou)); priority_queue<P, vector<P>, greater<P>>Q; int c, d; cin >> c >> d; for (int e = 0; e < c; e++) { for (int f = 0; f < d; f++) { int g; scanf("%d", &g); g--; hyoukou[e + 1][f + 1] = g; Q.push(P(g, p(e + 1, f + 1))); } } while (Q.size()) { P h = Q.top(); Q.pop(); for (int i = 0; i < 4; i++) { if (h.first> hyoukou[h.second.first + x[i]][h.second.second + y[i]]) { for (auto k = U[hyoukou[h.second.first + x[i]][h.second.second + y[i]]].begin(); k != U[hyoukou[h.second.first + x[i]][h.second.second + y[i]]].end(); k++) { U[h.first].insert(*k); } } } if (U[h.first].size() == 0)U[h.first].insert(h.first); } int S = 0; for (int i = 1; i <= c; i++) { for (int h = 1; h <= d; h++) { if (U[hyoukou[i][h]].size() != 1)S++; } } cout << S << endl; }
a.cc: In function 'int main()': a.cc:17:17: error: 'memset' was not declared in this scope 17 | memset(hyoukou, 1, sizeof(hyoukou)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include<unordered_set> +++ |+#include <cstring> 9 | #define p pair<int,int>
s725916237
p00557
C++
#include<iostream> #include<map> #include<string> #include<vector> #include<algorithm> #include<queue> #include<unordered_set> #define P pair<int,int> using namespace std; int h[1000000]; int ANS = 0; int a, b, c[1002][1002], x[4] = { -1,0,0,1 }, y[4] = { 0,-1,1,0 }; P d[1000000]; int main() { memset(h, -1, sizeof(h)); for (int i = 0; i < 1002; i++) { for (int j = 0; j < 1002; j++) { c[i][j] = 1 << 29; } } cin >> a >> b; for (int e = 0; e < a; e++) { for (int f = 0; f < b; f++) { int g; scanf("%d", &g); g--; c[e + 1][f + 1] = g; d[g] = P(e + 1, f + 1); } } for (int i = 0; i < a*b; i++) { int dx = d[i].first, dy = d[i].second; bool k = false; int sum = 0; for (int j = 0; j < 4; j++) { if (c[dx + x[j]][dy + y[j]]<i) { sum++; if (h[c[dx + x[j]][dy + y[j]]] ==-1) { k = true; } else { if (h[i] == -1) { h[i] = h[c[dx + x[j]][dy + y[j]]]; } else if (h[i] != h[c[dx + x[j]][dy + y[j]]])k = true; } } } if (sum!=0) { if (k)h[i] = -1; else { ANS++; } } else { h[i] = i; ANS++; } } cout << a*b-ANS << endl; }
a.cc: In function 'int main()': a.cc:16:9: error: 'memset' was not declared in this scope 16 | memset(h, -1, sizeof(h)); | ^~~~~~ a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include<unordered_set> +++ |+#include <cstring> 8 | #define P pair<int,int>
s365194313
p00557
C++
#include <iostream> #define rep(i,n) for(int i=0;i<n;i++) int m[1020][1020],ma[1001][1001],qw,a,b,e,f; int v[4]={-1,0,1,0},t[4]={0,-1,0,1}; using namespace std; int dfs(int x,int y){ if(qw>=2)goto L; if(m1[y][x]>0)return 0; int s=0,c=0; rep(i,4){ if(0>x+v[i]||b<=x+v[i]||0>y+t[i]||a<=y+t[i])continue; if(m[y][x+v[i]]<m[y][x]||m[y+t[i]][x]<m[y][x]){ s+=dfs(x+v[i],y+t[i]); c++; } } if(0>m1[y][x]){ if(s>1)return 1; return 0; } if(!c&&!m1[y][x]){ m1[y][x]++; qw++; return 1; } m1[y][x]++; return s; } int main(){ int sum=0; cin>>a>>b; rep(i,a)rep(j,b)cin>>m[i][j]; rep(i,a)rep(j,b){ qw=0; sum+=dfs(j,i); L:if(wq){ wq=0; sum++; }; rep(z,a)rep(h,b)m1[z][h]=0; } cout<<sum<<endl; }
a.cc: In function 'int dfs(int, int)': a.cc:8:6: error: 'm1' was not declared in this scope; did you mean 'ma'? 8 | if(m1[y][x]>0)return 0; | ^~ | ma a.cc:17:8: error: 'm1' was not declared in this scope; did you mean 'ma'? 17 | if(0>m1[y][x]){ | ^~ | ma a.cc:21:11: error: 'm1' was not declared in this scope; did you mean 'ma'? 21 | if(!c&&!m1[y][x]){ | ^~ | ma a.cc:26:3: error: 'm1' was not declared in this scope; did you mean 'ma'? 26 | m1[y][x]++; | ^~ | ma a.cc:7:17: error: label 'L' used but not defined 7 | if(qw>=2)goto L; | ^ a.cc: In function 'int main()': a.cc:36:10: error: 'wq' was not declared in this scope; did you mean 'qw'? 36 | L:if(wq){ | ^~ | qw a.cc:40:21: error: 'm1' was not declared in this scope; did you mean 'ma'? 40 | rep(z,a)rep(h,b)m1[z][h]=0; | ^~ | ma
s265551547
p00557
C++
#include <iostream> #define rep(i,n) for(int i=0;i<n;i++) int m[1020][1020],m1[1001][1001],qw,a,b,e,f; int v[4]={-1,0,1,0},t[4]={0,-1,0,1}; using namespace std; int dfs(int x,int y){ if(qw>=2)goto L; if(m1[y][x]>0)return 0; int s=0,c=0; rep(i,4){ if(0>x+v[i]||b<=x+v[i]||0>y+t[i]||a<=y+t[i])continue; if(m[y][x+v[i]]<m[y][x]||m[y+t[i]][x]<m[y][x]){ s+=dfs(x+v[i],y+t[i]); c++; } } if(0>m1[y][x]){ if(s>1)return 1; return 0; } if(!c&&!m1[y][x]){ m1[y][x]++; qw++; return 1; } m1[y][x]++; return s; } int main(){ int sum=0; cin>>a>>b; rep(i,a)rep(j,b)cin>>m[i][j]; rep(i,a)rep(j,b){ qw=0; sum+=dfs(j,i); L:if(wq){ wq=0; sum++; }; rep(z,a)rep(h,b)m1[z][h]=0; } cout<<sum<<endl; }
a.cc: In function 'int dfs(int, int)': a.cc:7:17: error: label 'L' used but not defined 7 | if(qw>=2)goto L; | ^ a.cc: In function 'int main()': a.cc:36:10: error: 'wq' was not declared in this scope; did you mean 'qw'? 36 | L:if(wq){ | ^~ | qw
s168727654
p00557
C++
#include <iostream> #define rep(i,n) for(int i=0;i<n;i++) int m[1020][1020],qw,a,b,e,f; int v[4]={-1,0,1,0},t[4]={0,-1,0,1}; using namespace std; int dfs(int x,int y){ if(qw>=2)return 1; if(m1[y][x]>0)return 0; int s=0,c=0; rep(i,4){ if(0>x+v[i]||b<=x+v[i]||0>y+t[i]||a<=y+t[i])continue; if(m[y][x+v[i]]<m[y][x]||m[y+t[i]][x]<m[y][x]){ s+=dfs(x+v[i],y+t[i]); c++; } if(qw>=2)return 1; } if(e==y&&f==x){ if(s>1)return 1; return 0; } if(!c){ qw++; return 1; } return s; } int main(){ int sum=0; cin>>a>>b; rep(i,a)rep(j,b)cin>>m[i][j]; rep(i,a)rep(j,b){ qw=0;e=i;f=j; sum+=dfs(j,i);qw=0; } cout<<sum<<endl; }
a.cc: In function 'int dfs(int, int)': a.cc:8:6: error: 'm1' was not declared in this scope; did you mean 'm'? 8 | if(m1[y][x]>0)return 0; | ^~ | m
s691329543
p00557
C++
#include <iostream> #include <stack> #define UNDEF -1 #define IS_RD -2 #define INF 1073741824 using namespace std; int M[1001][1001],H,W; int dp[1001][1001]; stack<int> callX; stack<int> callY; int getM(int x,int y) { if(x >= 0 && y >= 0 && x < W && y < H) { return M[x][y]; } else { return INF; } } void calc(int _x,int _y) { int x,y; callX.push(_x); callY.push(_y); while(!callX.empty()) { endfn: x = callX.top(); y = callY.top(); if(dp[x][y] == UNDEF) { int a[4] = {INF,INF,INF,INF}; if(getM(x+1,y) < getM(x,y)) { if(dp[x+1][y] == UNDEF) { callX.push(x+1); callY.push(y); goto endfn; } else { a[0] = dp[x+1][y]; } } if(getM(x-1,y) < getM(x,y)) { if(dp[x-1][y] == UNDEF) { callX.push(x-1); callY.push(y); goto endfn; } else { a[1] = dp[x-1][y]; } } if(getM(x,y+1) < getM(x,y)) { if(dp[x][y+1] == UNDEF) { callX.push(x); callY.push(y+1); goto endfn; } else { a[2] = dp[x][y+1]; } } if(getM(x,y-1) < getM(x,y)) { if(dp[x][y-1] == UNDEF) { callX.push(x); callY.push(y-1); goto endfn; } else { a[3] = dp[x][y-1]; } } if(a[0] == INF && a[1] == INF && a[2] == INF && a[3] == INF) { dp[x][y] = (x*1000)+y; goto endok; } else { for(int i = 0;i < 3;i++) { for(int ii = i+1;ii < 4;ii++) { if(a[i] != INF && a[ii] != INF && a[i] != a[ii]) { dp[x][y] = IS_RD; goto endok; } } } for(int i = 0;i < 4;i++) { if(a[i] != INF) { dp[x][y] = a[i]; goto endok; } } } } endok: callX.pop(); callY.pop(); } } int main(void) { cin >> H >> W; for(int i = 0;i < H;i++) { for(int ii = 0;ii < W;ii++) { cin >> M[ii][i]; } } for(int x = 0;x < 1001;x++) { for(int y = 0;y < 1001;y++) { dp[x][y] = UNDEF; } } int res = 0; for(int x = 0;x < W;x++) { for(int y = 0;y < H;y++) { calc(x,y); } } for(int x = 0;x < W;x++) { for(int y = 0;y < H;y++) { if(dfs(x,y) == IS_RD) res++; } } cout << res << endl; }
a.cc: In function 'int main()': a.cc:155:28: error: 'dfs' was not declared in this scope 155 | if(dfs(x,y) == IS_RD) | ^~~
s979364334
p00558
C++
#include<cstdio> #include<iostream> #include<string> #include<vector> #include<algorithm> #include<set> #include<list> #include<map> #include<unordered_map> #include<unordered_set> #include<functional> #include<queue> #define P pair<int,int>//cost to using namespace std; int d[10000]; vector<P>rinsetu[10000]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10000][3][201];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%d", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%d%d%d", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } memset(mincost, 0x3f, sizeof(mincost)); mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = 1 << 29; for (int i = 0; i < b; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
a.cc: In function 'int main()': a.cc:36:9: error: 'memset' was not declared in this scope 36 | memset(mincost, 0x3f, sizeof(mincost)); | ^~~~~~ a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include<queue> +++ |+#include <cstring> 13 | #define P pair<int,int>//cost to
s245379171
p00558
C++
#include<cstdio> #include<iostream> #include<string> #include<vector> #include<algorithm> #include<set> #include<list> #include<map> #include<unordered_map> #include<unordered_set> #include<functional> #include<queue> #define int long long #define P pair<int,int>//cost to using namespace std; int d[10000]; vector<P>rinsetu[10000]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10000][3][201];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%lld", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%lld%lld%lld", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } for (int x = 0; x < a; x++) { for (int y = 0; y < c; y++) { mincost[x][0][y] = mincost[x][1][y] = mincost[x][2][y] = LLONG_MAX / 3; } } mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = LLONG_MAX / 3; for (int i = 0; i < b; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
cc1plus: error: '::main' must return 'int' a.cc: In function 'int main()': a.cc:39:82: error: 'LLONG_MAX' was not declared in this scope 39 | mincost[x][0][y] = mincost[x][1][y] = mincost[x][2][y] = LLONG_MAX / 3; | ^~~~~~~~~ a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 12 | #include<queue> +++ |+#include <climits> 13 | #define int long long a.cc:63:19: error: 'LLONG_MAX' was not declared in this scope 63 | int MIN = LLONG_MAX / 3; | ^~~~~~~~~ a.cc:63:19: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
s219646345
p00558
C++
#include<bits/stdc++.h> #define int long long #define P pair<int,int>//cost to using namespace std; int d[10000]; vector<P>rinsetu[10000]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10000][3][201];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%lld", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%lld%lld%lld", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } for (int x = 0; x < a; x++) { for (int y = 0; y < c; y++) { mincost[x][0][y] = mincost[x][1][y] = mincost[x][2][y] = LLONG_MAX / 3; } } mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = LLONG_MAX / 3; for (int i = 0; i < b; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
cc1plus: error: '::main' must return 'int'
s260073038
p00558
C++
#include<cstdio> #include<iostream> #include<string> #include<vector> #include<algorithm> #include<set> #include<list> #include<map> #include<unordered_map> #include<unordered_set> #include<functional> #include<queue> #define P pair<int,int>//cost to using namespace std; int d[10000]; vector<P>rinsetu[10000]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10000][3][201];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%d", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%d%d%d", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } memset(mincost, 0x3f, sizeof(mincost)); mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = 1 << 29; for (int i = 0; i < b; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
a.cc: In function 'int main()': a.cc:36:9: error: 'memset' was not declared in this scope 36 | memset(mincost, 0x3f, sizeof(mincost)); | ^~~~~~ a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include<queue> +++ |+#include <cstring> 13 | #define P pair<int,int>//cost to
s104339213
p00558
C++
#include<cstdio> #include<iostream> #include<string> #include<vector> #include<algorithm> #include<set> #include<list> #include<map> #include<unordered_map> #include<unordered_set> #include<functional> #include<queue> #define P pair<int,int>//cost to using namespace std; int d[10010]; vector<P>rinsetu[10010]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10010][4][301];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%d", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%d%d%d", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } memset(mincost, 0x3f, sizeof(mincost)); mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = 1 << 29; for (int i = 0; i < b; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
a.cc: In function 'int main()': a.cc:36:9: error: 'memset' was not declared in this scope 36 | memset(mincost, 0x3f, sizeof(mincost)); | ^~~~~~ a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 12 | #include<queue> +++ |+#include <cstring> 13 | #define P pair<int,int>//cost to
s031979105
p00558
C++
#include<cstdio> #include<iostream> #include<string> #include<vector> #include<algorithm> #include<set> #include<list> #include<map> #include<unordered_map> #include<unordered_set> #include<functional> #include<queue> #include<stdlib.h> #pragma warning(disable:4996) #define P pair<int,int>//cost to using namespace std; int d[10010]; vector<P>rinsetu[10010]; struct room { int now, cost, state, keika; }; bool operator <(room a, room b) { return a.cost > b.cost; } int mincost[10010][4][301];//??¨?±????????????????????????? int main() { int a, b, c; cin >> a >> b >> c; for (int e = 0; e < a; e++) { scanf("%d", &d[e]); } for (int e = 0; e < b; e++) { int f, g, h; scanf("%d%d%d", &f, &g, &h); f--; g--; rinsetu[f].push_back(P(h, g)); rinsetu[g].push_back(P(h, f)); } memset(mincost,0x3f, sizeof(mincost)); mincost[0][0][0] = 0; priority_queue<room>Q; Q.push({0,0,0,0}); while (Q.size()) { room e = Q.top(); Q.pop(); if (mincost[e.now][e.state][e.keika] < e.cost)continue; for (P f : rinsetu[e.now]) { int x = min(c, f.first + e.keika), y = d[f.second]; if (abs(e.state - y) == 2 && x < c)continue; if (y == 1) { y = e.state; } else { x = 0; } if (mincost[f.second][y][x] > e.cost + f.first) { mincost[f.second][y][x] = e.cost + f.first; Q.push({f.second,mincost[f.second][y][x],y,x}); } } } int MIN = 1 << 29; for (int i = 0; i < c; i++) { MIN = min({MIN,mincost[a-1][0][i],mincost[a-1][1][i],mincost[a-1][2][i]}); } cout << MIN << endl; }
a.cc: In function 'int main()': a.cc:38:9: error: 'memset' was not declared in this scope 38 | memset(mincost,0x3f, sizeof(mincost)); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include<stdlib.h> +++ |+#include <cstring> 14 | #pragma warning(disable:4996)
s210305130
p00559
C++
int n, q, s, t; LL a[200100]; LL ans; LL calc(LL lll) { if (lll > 0) { return -lll * s; } else { return -lll * t; } } int main() { cin >> n >> q >> s >> t; LL prev = 0; LL in; for (int i = 0; i <= n; i++) { cin >> in; a[i] = in - prev; ans += calc(a[i]); prev = in; } LL l, r, x; for (int i = 0; i < q; i++) { cin >> l >> r >> x; r++; ans -= calc(a[l]); a[l] += x; ans += calc(a[l]); if (r <= n) { ans -= calc(a[r]); a[r] -= x; ans += calc(a[r]); } cout << ans << endl; } }
a.cc:2:1: error: 'LL' does not name a type 2 | LL a[200100]; | ^~ a.cc:3:1: error: 'LL' does not name a type 3 | LL ans; | ^~ a.cc:5:1: error: 'LL' does not name a type 5 | LL calc(LL lll) { | ^~ a.cc: In function 'int main()': a.cc:14:9: error: 'cin' was not declared in this scope 14 | cin >> n >> q >> s >> t; | ^~~ a.cc:15:9: error: 'LL' was not declared in this scope 15 | LL prev = 0; | ^~ a.cc:16:11: error: expected ';' before 'in' 16 | LL in; | ^~~ | ; a.cc:18:24: error: 'in' was not declared in this scope; did you mean 'i'? 18 | cin >> in; | ^~ | i a.cc:19:17: error: 'a' was not declared in this scope 19 | a[i] = in - prev; | ^ a.cc:19:29: error: 'prev' was not declared in this scope 19 | a[i] = in - prev; | ^~~~ a.cc:20:17: error: 'ans' was not declared in this scope 20 | ans += calc(a[i]); | ^~~ a.cc:20:24: error: 'calc' was not declared in this scope 20 | ans += calc(a[i]); | ^~~~ a.cc:23:11: error: expected ';' before 'l' 23 | LL l, r, x; | ^~ | ; a.cc:25:24: error: 'l' was not declared in this scope 25 | cin >> l >> r >> x; | ^ a.cc:25:29: error: 'r' was not declared in this scope 25 | cin >> l >> r >> x; | ^ a.cc:25:34: error: 'x' was not declared in this scope 25 | cin >> l >> r >> x; | ^ a.cc:27:17: error: 'ans' was not declared in this scope 27 | ans -= calc(a[l]); | ^~~ a.cc:27:29: error: 'a' was not declared in this scope 27 | ans -= calc(a[l]); | ^ a.cc:27:24: error: 'calc' was not declared in this scope 27 | ans -= calc(a[l]); | ^~~~ a.cc:35:17: error: 'cout' was not declared in this scope 35 | cout << ans << endl; | ^~~~ a.cc:35:32: error: 'endl' was not declared in this scope 35 | cout << ans << endl; | ^~~~
s801285961
p00560
C++
#include <cstdio> #include <vector> #include <functional> using namespace std; long long int n, m, k, a, b, c, t; vector<long long int> s; long long int ans; typedef pair<long long int, long long int> P; vector<P> v; vector<long long int> w; long long int func(long long int x, long long int y, long long int z){ if(y == s[x+1]) return 0; long long int tmp = t - z; if(tmp < 0) return 0; tmp /= a; if(y - 1 + tmp >= s[x+1]) tmp = s[x+1] - y; return tmp; } int main(){ scanf("%lld %lld %lld %lld %lld %lld %lld", &n, &m, &k, &a, &b, &c, &t); for(int i=0; i<m; ++i){ long long int tmp; scanf("%lld", &tmp); s.push_back(tmp); if((tmp-1) * b <= t) ++ans; } s.push_back(n+1); for(int i=0; i<m; ++i){ long long int tmp = func(i, s[i]+1, (s[i]-1)*b); ans += tmp; v.push_back(P(i, s[i]+tmp+1)); } printf("%lld\n", ans); // for(int i=0; i<v.size(); ++i) printf("%lld %lld\n", v[i].first, v[i].second); for(int i=0; i<v.size(); ++i){ if(i == k) break; long long int tmp = 0; if((s[v[i].first]-1)*b + (v[i].second-s[v[i].first])*c <= t) ++tmp; tmp += func(v[i].first, v[i].second+1, (s[v[i].first]-1)*b+(v[i].second-s[v[i].first])*c); w.push_back(tmp); if(tmp != 0) v.push_back(P(v[i].first, v[i].second+tmp)); } sort(w.begin(), w.end(), greater<long long int>()); // for(int i=0; i<w.size(); ++i) printf("w%lld\n", w[i]); for(int i=0; i<k-m; ++i) ans += w[i]; printf("%lld\n", ans-1); }
a.cc: In function 'int main()': a.cc:50:9: error: 'sort' was not declared in this scope; did you mean 'short'? 50 | sort(w.begin(), w.end(), greater<long long int>()); | ^~~~ | short
s467875014
p00564
Java
import java.io.IOException; import java.util.Scanner; public class test { public static void main(String[] args)throws IOException{ Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int A = scanner.nextInt(); int B = scanner.nextInt(); int C = scanner.nextInt(); int D = scanner.nextInt(); int x,y; x = N%A; y = N%C; if(x != 0){ x = (N/A+1) * B; }else{ x = (N/A) * B; } if(y != 0){ y = (N/C + 1) * D; }else{ y = (N/C) * D; } if(x <= y){ System.out.print(x); }else{ System.out.print(y); } } }
Main.java:3: error: class test is public, should be declared in a file named test.java public class test { ^ 1 error
s457393614
p00564
Java
public class Pencils{ public static void main(String[] args){ if(args.length == 5){ int N = Integer.valueOf(args[0]); int A = Integer.valueOf(args[1]); int B = Integer.valueOf(args[2]); int C = Integer.valueOf(args[3]); int D = Integer.valueOf(args[4]); int num1 = N % A == 0 ? Math.floorDiv(N, A) : Math.floorDiv(N, A) + 1; int num2 = N % C == 0 ? Math.floorDiv(N, C) : Math.floorDiv(N, C) + 1; int min1 = B * num1; int min2 = D * num2; System.out.println((min1 < min2 ? min1 : min2)); } } }
Main.java:1: error: class Pencils is public, should be declared in a file named Pencils.java public class Pencils{ ^ 1 error
s285509120
p00564
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; class Main{ public static void main(String[] args) { BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in)); String str=""; StringTokenizer stk; int[] k1=new int[5]; int i; while(true) { try{ i=0; str=bfr.readLine(); stk=new StringTokenizer(str," "); while(stk.hasMoreTokens()) { k1[i]=Integer.parseInt(stk.nextToken()); i++; } int set1_nomi; if(k1[0]%k1[1]!=0) { set1_nomi=k1[0]/k1[1]+1; } else {set1_nomi=k1[0]/k1[1];} /* int set2_nomi; if(k1[0]%k1[3]!=0) { set1_nomi=k1[0]/k1[3]+1; } else {set1_nomi=k1[0]/k1[3];}*/ int[] sougaku=new int[set1_nomi+1]; //set1 no kosuu int set2_kosu; int saiyasune=1999999999; for(int jj=0; jj<set1_nomi+1; jj++) { set2_kosu=(k1[0]-jj*k1[1])%k1[3]; if(set2_kosu!=0) { set2_kosu=(k1[0]-jj*k1[1])/k1[3]+1; } else { set2_kosu=(k1[0]-jj*k1[1])/k1[3]; } sougaku[jj]=jj*k1[2]+set2_kosu*k1[4]; if(saiyasune>sougaku[jj]) { saiyasune=sougaku[jj]; } } System.out.println(saiyasune); } }catch(IOException e) { System.exit(0); } catch(NumberFormatException ee) { System.exit(0); } catch(NullPointerException eee) { System.exit(0); } } }
Main.java:15: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:56: error: 'catch' without 'try' }catch(IOException e) { ^ Main.java:59: error: 'catch' without 'try' catch(NumberFormatException ee) { ^ Main.java:63: error: 'catch' without 'try' catch(NullPointerException eee) { ^ 4 errors
s663786670
p00564
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; class Main{ public static void main(String[] args) { BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in)); String str=""; StringTokenizer stk; int[] k1=new int[5]; int i; try{ i=0; str=bfr.readLine(); stk=new StringTokenizer(str," "); while(stk.hasMoreTokens()) { k1[i]=Integer.parseInt(stk.nextToken()); i++; } int set1_nomi; if(k1[0]%k1[1]!=0) { set1_nomi=k1[0]/k1[1]+1; } else {set1_nomi=k1[0]/k1[1];} int set2_nomi; if(k1[0]%k1[3]!=0) { set2_nomi=k1[0]/k1[3]+1; } else {set2_nomi=k1[0]/k1[3];} int[] sougaku=new int[set1_nomi+1]; //set1 no kosuu int set2_kosu; int saiyasune=1999999999; for(int jj=0; jj<set1_nomi+1; jj++) { set2_kosu=(k1[0]-jj*k1[1])%k1[3]; if(set2_kosu!=0) { set2_kosu=(k1[0]-jj*k1[1])/k1[3]+1; } else { set2_kosu=(k1[0]-jj*k1[1])/k1[3]; } sougaku[jj]=jj*k1[2]+set2_kosu*k1[4]; if(saiyasune>sougaku[jj]) { saiyasune=sougaku[jj]; } } int[] sougaku2=new int[set2_nomi+1]; //set1 no kosuu int set1_kosu; int saiyasune_2=1999999999; for(int jj=0; jj<set2_nomi+1; jj++) { set1_kosu=(k1[0]-jj*k1[3])%k1[1]; if(set1_kosu!=0) { set1_kosu=(k1[0]-jj*k1[3])/k1[1]+1; } else { set1_kosu=(k1[0]-jj*k1[3])/k1[1]; } sougaku_2[jj]=jj*k1[4]+set1_kosu*k1[2]; if(saiyasune_2>sougaku_2[jj]) { saiyasune_2=sougaku_2[jj]; } } System.out.println(Math.min(saiyasune, saiyasune_2)); }catch(IOException e) { System.exit(0); } catch(NumberFormatException ee) { System.exit(0); } catch(NullPointerException eee) { System.exit(0); } } }
Main.java:65: error: cannot find symbol sougaku_2[jj]=jj*k1[4]+set1_kosu*k1[2]; ^ symbol: variable sougaku_2 location: class Main Main.java:66: error: cannot find symbol if(saiyasune_2>sougaku_2[jj]) { ^ symbol: variable sougaku_2 location: class Main Main.java:67: error: cannot find symbol saiyasune_2=sougaku_2[jj]; ^ symbol: variable sougaku_2 location: class Main 3 errors
s236324670
p00564
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; class Main{ public static void main(String[] args) { BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in)); String str=""; StringTokenizer stk; int[] k1=new int[5]; int i; while(true) { try{ i=0; str=bfr.readLine(); stk=new StringTokenizer(str," "); while(stk.hasMoreTokens()) { k1[i]=Integer.parseInt(stk.nextToken()); i++; } int set1_nomi; if(k1[0]%k1[1]!=0) { set1_nomi=k1[0]/k1[1]+1; } else {set1_nomi=k1[0]/k1[1];} int set2_nomi; if(k1[0]%k1[3]!=0) { set2_nomi=k1[0]/k1[3]+1; } else {set2_nomi=k1[0]/k1[3];} int[] sougaku=new int[set1_nomi+1]; //set1 no kosuu int set2_kosu; int saiyasune=1999999999; for(int jj=0; jj<set1_nomi+1; jj++) { set2_kosu=(k1[0]-jj*k1[1])%k1[3]; if(set2_kosu!=0) { set2_kosu=(k1[0]-jj*k1[1])/k1[3]+1; } else { set2_kosu=(k1[0]-jj*k1[1])/k1[3]; } sougaku[jj]=jj*k1[2]+set2_kosu*k1[4]; if(saiyasune>sougaku[jj]) { saiyasune=sougaku[jj]; } } int[] sougaku2=new int[set2_nomi+1]; //set1 no kosuu int set1_kosu; int saiyasune_2=1999999999; for(int jj=0; jj<set2_nomi+1; jj++) { set1_kosu=(k1[0]-jj*k1[3])%k1[1]; if(set1_kosu!=0) { set1_kosu=(k1[0]-jj*k1[3])/k1[1]+1; } else { set1_kosu=(k1[0]-jj*k1[3])/k1[1]; } sougaku2[jj]=jj*k1[4]+set1_kosu*k1[2]; if(saiyasune_2>sougaku2[jj]) { saiyasune_2=sougaku2[jj]; } } System.out.println(Math.min(saiyasune, saiyasune_2)); } } catch(IOException e) { System.exit(0); } catch(NumberFormatException ee) { System.exit(0); } catch(NullPointerException eee) { System.exit(0); } } }
Main.java:15: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:74: error: 'catch' without 'try' catch(IOException e) { ^ Main.java:77: error: 'catch' without 'try' catch(NumberFormatException ee) { ^ Main.java:81: error: 'catch' without 'try' catch(NullPointerException eee) { ^ 4 errors
s073060864
p00564
Java
import java.util.Scanner; class PenSet{ int number; int value; PenSet(int x,int y){ number = x; value = y; } } public class Pencils{ public static void main(String[] args){ int val,num,setNum,i,j,min=0; Scanner scn = new Scanner(System.in); num = scn.nextInt(); setNum = scn.nextInt(); val = scn.nextInt(); PenSet x = new PenSet(setNum,val); setNum = scn.nextInt(); val = scn.nextInt(); PenSet y = new PenSet(setNum,val); for(i=-1;i*x.number<num;i++){ for(j=0;(i+1)*x.number+j*y.number<num;j++); if(i==-1||((i+1)*x.value + j*y.value)<min) min=((i+1)*x.value + j*y.value); } System.out.println(min); } }
Main.java:13: error: class Pencils is public, should be declared in a file named Pencils.java public class Pencils{ ^ 1 error
s354615092
p00564
Java
import java.util.Scanner; class PenSet{ int number; int value; PenSet(int x,int y){ number = x; value = y; } } public class Pencils{ public static void main(String[] args){ int val,num,setNum,i,j,min=0; Scanner scn = new Scanner(System.in); num = scn.nextInt(); setNum = scn.nextInt(); val = scn.nextInt(); PenSet x = new PenSet(setNum,val); setNum = scn.nextInt(); val = scn.nextInt(); PenSet y = new PenSet(setNum,val); for(i=-1;i*x.number<num;i++){ for(j=0;(i+1)*x.number+j*y.number<num;j++); if(i==-1||((i+1)*x.value + j*y.value)<min) min=((i+1)*x.value + j*y.value); } System.out.println(min); } }
Main.java:13: error: class Pencils is public, should be declared in a file named Pencils.java public class Pencils{ ^ 1 error
s329988727
p00564
Java
steamsass's
Main.java:1: error: unclosed character literal steamsass's ^ 1 error
s697923866
p00564
C
#include <stdio.h> int main(void) { int N,A,B,C,D,price_X,price_Y,mod; scanf( "%d %d %d %d %d" , &N,&A,&B,&C,&D ); mod=( N%A != 0 ) price_X=(N/A+mod)*B; mod=( N%C != 0 ) price_Y=(N/C+mod)*D; if( price_X < price_Y ){ printf("%d\n" , price_X); }else{ printf("%d\n" , price_Y); } return 0; }
main.c: In function 'main': main.c:6:20: error: expected ';' before 'price_X' 6 | mod=( N%A != 0 ) | ^ | ; 7 | price_X=(N/A+mod)*B; | ~~~~~~~ main.c:8:20: error: expected ';' before 'price_Y' 8 | mod=( N%C != 0 ) | ^ | ; 9 | price_Y=(N/C+mod)*D; | ~~~~~~~
s901467302
p00564
C
#include <stdio.h> #defin AB (N/A+( N%A != 0 ))*B #defin CD (N/C+( N%C != 0 ))*D int main(void) { int N,A,B,C,D; scanf( "%d %d %d %d %d" , &N,&A,&B,&C,&D ); printf("%d\n" , ((N/A+( N%A != 0 ))*B<(N/C+( N%C != 0 ))*D)*(N/A+( N%A != 0 ))*B+((N/A+( N%A != 0 ))*B>=(N/C+( N%C != 0 ))*D)*(N/C+( N%C != 0 ))*D); return 0; }
main.c:2:2: error: invalid preprocessing directive #defin; did you mean #define? 2 | #defin AB (N/A+( N%A != 0 ))*B | ^~~~~ | define main.c:3:2: error: invalid preprocessing directive #defin; did you mean #define? 3 | #defin CD (N/C+( N%C != 0 ))*D | ^~~~~ | define
s746566772
p00564
C
#include<iostream> using namespace std; // ?? int main(){ int n, a, b, c, d; cin >> n >> a >> b >> c >> d; int x = (n/a)*b + (n%a>0?1:0)*b; int y = (n/c)*d + (n%c>0?1:0)*d; if ( x > y ) cout << x << endl; else cout << y << endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s035232950
p00564
C++
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0641 #include<iostream> using namespace std; //標準名前空間を使用 int main(){ /変数を読み込む int N , A , B ,C ,D ; int Xset , Yset , Xprice , Yprice; // セットXで揃えた場合のの必要セット数(Xset)を求める Xset = N / A + 1 ; // セットXで揃えた場合の合計金額を求める Xprice = Xset * B ; // セットYで揃えた場合のの必要セット数(Yset)を求める Yset = N / C + 1 ; // セットXで揃えた場合の合計金額を求める Yprice = Yset * D ; //XpriceとYpriceを比較する if(Xprice < Yprice){ cout << Xprice ; //XpriceがYpriceより小さい場合、Xpriceを出力 }else{ out << Yprice ; //そうでない場合、Ypriceを出力 } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: expected primary-expression before '/' token 9 | /変数を読み込む | ^ a.cc:9:6: error: '\U00005909\U00006570\U00003092\U00008aad\U0000307f\U00008fbc\U00003080' was not declared in this scope 9 | /変数を読み込む | ^~~~~~~~~~~~~~ a.cc:14:12: error: 'N' was not declared in this scope 14 | Xset = N / A + 1 ; | ^ a.cc:14:16: error: 'A' was not declared in this scope 14 | Xset = N / A + 1 ; | ^ a.cc:16:21: error: 'B' was not declared in this scope 16 | Xprice = Xset * B ; | ^ a.cc:20:16: error: 'C' was not declared in this scope 20 | Yset = N / C + 1 ; | ^ a.cc:22:21: error: 'D' was not declared in this scope 22 | Yprice = Yset * D ; | ^ a.cc:28:5: error: 'out' was not declared in this scope 28 | out << Yprice ; //そうでない場合、Ypriceを出力 | ^~~
s312357916
p00564
C++
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0641 #include<iostream> using namespace std; //標準名前空間を使用 int main(){ //変数を読み込む int N , A , B ,C ,D ; int Xset , Yset , Xprice , Yprice; // セットXで揃えた場合の必要セット数(Xset)を求める Xset = N / A + 1 ; // セットXで揃えた場合の合計金額を求める Xprice = Xset * B ; // セットYで揃えた場合のの必要セット数(Yset)を求める Yset = N / C + 1 ; // セットXで揃えた場合の合計金額を求める Yprice = Yset * D ; //XpriceとYpriceを比較する if(Xprice < Yprice){ cout << Xprice ; //XpriceがYpriceより小さい場合、Xpriceを出力 }else{ out << Yprice ; //そうでない場合、Ypriceを出力 } return 0; }
a.cc: In function 'int main()': a.cc:28:5: error: 'out' was not declared in this scope 28 | out << Yprice ; //そうでない場合、Ypriceを出力 | ^~~
s032387837
p00564
C++
#include<string.h> int main(void) { int n,x,y,a,b,c,d; scanf("%d",&n); scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); scanf("%d",&d); x=n/a*b; y=n/c*d; if(n%a>0){ x=x+b; } if(n%c>0){ y=y+d; } if(x<y){ printf("%d\n",x); } else{ printf("%d\n",y); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d",&n); | ^~~~~ a.cc:19:17: error: 'printf' was not declared in this scope 19 | printf("%d\n",x); | ^~~~~~ a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 1 | #include<string.h> +++ |+#include <cstdio> 2 | int main(void) a.cc:22:17: error: 'printf' was not declared in this scope 22 | printf("%d\n",y); | ^~~~~~ a.cc:22:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s007687287
p00564
C++
#include <iostream> using namespace std; int N,A,B,C,D int X_SET,Y_SET,X_SUM,Y_SUM; int main(){ cin>>N>>A>>B>>C>>D; X_SET = N/A; if(N%A>0)X_SET=X_SET+1; Y_SET=N/C; if(N%C>0)Y_SET+1; X_SUM=B*X_SET; Y_SUM=D*Y_SET; if(X_SUM<Y_SUM)cout<<X_SUM<<endl; else cout<<Y_SUM<<endl; return0; }
a.cc:6:1: error: expected initializer before 'int' 6 | int X_SET,Y_SET,X_SUM,Y_SUM; | ^~~ a.cc: In function 'int main()': a.cc:8:18: error: 'D' was not declared in this scope 8 | cin>>N>>A>>B>>C>>D; | ^ a.cc:9:1: error: 'X_SET' was not declared in this scope; did you mean 'FD_SET'? 9 | X_SET = N/A; | ^~~~~ | FD_SET a.cc:11:1: error: 'Y_SET' was not declared in this scope; did you mean 'FD_SET'? 11 | Y_SET=N/C; | ^~~~~ | FD_SET a.cc:13:1: error: 'X_SUM' was not declared in this scope 13 | X_SUM=B*X_SET; | ^~~~~ a.cc:14:1: error: 'Y_SUM' was not declared in this scope 14 | Y_SUM=D*Y_SET; | ^~~~~ a.cc:18:1: error: 'return0' was not declared in this scope 18 | return0; | ^~~~~~~
s056490944
p00564
C++
#include <iostream> using namespace std; int main(void){ int n,a,b,c,d; int x,y; cin >> n,a,b,c,d; x=n/a; if(x!=1) x++; x=x*c; y=n/b; if(y!=1) y++; y=y*d; if(x<y){ count << x; }else{ count << y; } return 0; }
a.cc: In function 'int main()': a.cc:17:6: error: 'count' was not declared in this scope 17 | count << x; | ^~~~~ a.cc:19:6: error: 'count' was not declared in this scope 19 | count << y; | ^~~~~
s756361718
p00564
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int kai(int n) { if (n == 0) { return 1; } else { return n * kai(n - 1); } } int he(int a, int b) { return a * 3 + b; } int main() { int n = 9; vector<vector<int>> hyo(n,vector<int> (n)); vector<vector<int>> qhyo; int uni = -1; vector<int> mju0((n - 1) / 2); vector<int> mju1((n - 1) / 2); int ans = 15; for (int i = 1; 2 * i < n; i++) { mju0[i - 1] = i; mju1[i - 1] = i + ((n - 1) / 2); } vector<int> ju0((n - 1) / 2); vector<int> ju1((n - 1) / 2); ju0 = mju0; ju1 = mju1; vector<int> jan = {253164479,253189607,252163902,252964761,227495855,253083033,227006135,227403253,227801299,228187986,228482510,227004074,227273433,165328076,164579227}; int type; cout << "type" << "はいくつ"; cin >> type; vector<vector<int>> cy(11,vector<int> (11)); for (int i = 0; i < 11; i++) { cy[i][i] = 0; for (int j = (i + 1) % 11; j != i; j = (j + 1) % 11) { if ((j - i + 11) % 11 <= 5) { cy[i][j] = 1; } else { cy[i][j] = -1; } } } while (type != -1) { uni = -1; if (type == 0) { int c, d; cout << "c,d"<<"はいくつ"; cin >> c >> d;//2 3->2,2 6->13,(7 3,7 6)-> 14 for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { vector<int> v(9); int x = (i - j + 9) % 9; if (x == 1 or x == 4 or x == c or x == d) { hyo[i][j] = -1; } else if (x == 0) { hyo[i][j] = 0; } else { hyo[i][j] = 1; } } } } if (type == 1) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { vector<int> v(9);//14 for (int k = 0; k < 3; k++) { v[he((i + 1) % 3, k)] = 1; v[he((i + 2) % 3, k)] = -1; } v[he(i, j)] = 0; v[he(i, (j+ 1) % 3)] = 1; v[he(i, (j + 2) % 3)] = -1; hyo[he(i, j)] = v; } } } if (type == 2) { int c, d; cout << "c,d" << "はいくつ"; cin >> c >> d; vector<int> ji(11); ji[0] = 0; ji[c] = 0; ji[d] = 0; int th = 1; for (int i = 1; i < 11; i++) { if (i != c and i != d) { ji[i] = th; th++; } } hyo[0][0] = 0; for (int i = 0; i < 11; i++) { if (ji[i] != 0) { int xx = cy[i][0] + cy[i][c] + cy[i][d]; if (abs(xx) == 3) { uni = 100; } else { hyo[ji[i]][0] = xx; hyo[0][ji[i]] = -xx; } for (int j = 0; j < 11; j++) { if (ji[j] != 0) { hyo[ji[i]][ji[j]] = cy[i][j]; } }2 } } } for (int ty = 0; ty < n and uni < 0; ty++) { if (ty == 0) { qhyo = hyo; } vector<int> ti1((n - 1) / 2); vector<int> ti2((n - 1) / 2); int xy = 0; int xz = 0; for (int i = 0; i < n; i++) { if (qhyo[ty][i] == 1) { ti1[xy] = i; xy++; } else if (ty != i) { ti2[xz] = i; xz++; } } vector<int> ti(n, ty); for (int i = 1; i < n; i++) { if (2 * i < n) { ti[i] = ti1[i - 1]; } else { ti[i] = ti2[i - ((n + 1) / 2)]; } } for (int j = 0; j < n and uni<0; j++) { for (int k = 0; k < n; k++) { hyo[j][k] = qhyo[ti[j]][ti[k]]; } for (int j = 0; j < kai((n - 1) / 2) and uni<0; j++) { for (int k = 0; k < kai((n - 1) / 2) and uni<0; k++) { vector<int> jun(n, 0); for (int i = 1; i < n; i++) { if (2 * i < n) { jun[i] = ju0[i - 1]; } else { jun[i] = ju1[i - (n + 1) / 2]; } } long long qkaz = 0; for (int x = 1; x < n; x++) { for (int y = x + 1; y < n; y++) { qkaz = qkaz * 2 + (((hyo[jun[x]][jun[y]]) + 1) / 2); } } for (int l = 0; l < ans; l++) { if (qkaz == jan[l]) { uni = l; } } next_permutation(ju1.begin(), ju1.end()); } next_permutation(ju0.begin(), ju0.end()); } } ju0 = mju0; ju1 = mju1; } cout << uni<<endl<<"typeはいくつ?"; cin >> type; } }
a.cc: In function 'int main()': a.cc:112:43: error: expected ';' before '}' token 112 | }2 | ^ | ; 113 | } | ~
s880207537
p00564
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,A,B,C,D; cin >> N >> A >> B >> C >> D; int AN = N/A+1; if(N%A==0)NA--; int CN = N/C+1; if(N%C==0)NC--; cout << min(AN*B,CN*D) << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: 'NA' was not declared in this scope; did you mean 'AN'? 7 | if(N%A==0)NA--; | ^~ | AN a.cc:9:15: error: 'NC' was not declared in this scope; did you mean 'CN'? 9 | if(N%C==0)NC--; | ^~ | CN
s391739668
p00564
C++
#include<bits/stdc++.h> using namespace std; int main() { int N,A,B,C,D,E,F; cin >> N >> A >> B >> C >> D; E = (N/A)*B; F = (N/C)*D; if(E>0&&F>0){ if(A>C && B>D){ cout<< E <<endl; } if(A>C && B<D){ cout<< E <<endl; } if(A<C && B<D){ cout<< F << endl; } if(A<C && B>D){ cout<< F <<endl; } }
a.cc: In function 'int main()': a.cc:23:3: error: expected '}' at end of input 23 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s681089529
p00564
C++
#included<bits/stdc++.h> int main(){ int N,A,B,C,D; double x,y; scanf("%d%d%d%d%d",&N,&A,&B,&C,&D); x=N/A; y=N/C; x=ceil(x); y=ceil(y); if (B*x <= D*y) {printf(B*x); else{printf(D*y);} return 0; }
a.cc:1:2: error: invalid preprocessing directive #included; did you mean #include? 1 | #included<bits/stdc++.h> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:5:5: error: 'scanf' was not declared in this scope 5 | scanf("%d%d%d%d%d",&N,&A,&B,&C,&D); | ^~~~~ a.cc:8:7: error: 'ceil' was not declared in this scope 8 | x=ceil(x); | ^~~~ a.cc:11:2: error: 'printf' was not declared in this scope 11 | {printf(B*x); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #included<bits/stdc++.h> a.cc:12:1: error: expected '}' before 'else' 12 | else{printf(D*y);} | ^~~~ a.cc:11:1: note: to match this '{' 11 | {printf(B*x); | ^ a.cc:12:6: error: 'printf' was not declared in this scope 12 | else{printf(D*y);} | ^~~~~~ a.cc:12:6: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s117293131
p00564
C++
#include<stdio.h> #include<math.h> int main(void){ int N,A,B,C,D; scanf("%d%d%d%d%d",&N,&A,&B,&C,&D); double x=ceil(N/A); double y=ceil(N/C); if (B*x <= D*y) {printf(B*x); else{printf(D*y);} return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: cannot convert 'double' to 'const char*' 9 | {printf(B*x); | ~^~ | | | double In file included from a.cc:1: /usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:10:1: error: expected '}' before 'else' 10 | else{printf(D*y);} | ^~~~ a.cc:9:1: note: to match this '{' 9 | {printf(B*x); | ^ a.cc:10:14: error: cannot convert 'double' to 'const char*' 10 | else{printf(D*y);} | ~^~ | | | double /usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)' 363 | extern int printf (const char *__restrict __format, ...); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
s662471901
p00564
C++
#include<sbits/stdc++.h> #include<math.h> int main(void){ int N,A,B,C,D; scanf("%d%d%d%d%d",&N,&A,&B,&C,&D); double x=ceil(N/A); double y=ceil(N/C); if (B*x <= D*y) {printf(B*x); else{printf(D*y);} return 0; }
a.cc:1:9: fatal error: sbits/stdc++.h: No such file or directory 1 | #include<sbits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s952271261
p00564
C++
#include<sbits/stdc++.h> #include<math.h> int main(void){ int N,A,B,C,D; scanf("%d%d%d%d%d",&N,&A,&B,&C,&D); double x=ceil(N/A); double y=ceil(N/C); if (B*x <= D*y) {printf("B*x\n");} else{printf("D*y\n");} return 0; }
a.cc:1:9: fatal error: sbits/stdc++.h: No such file or directory 1 | #include<sbits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s218042625
p00564
C++
import java.util.Scanner; class PenSet{ int number; int value; PenSet(int x,int y){ number = x; value = y; } } class Pencils{ public static void main(String[] args){ int val,num,setNum,i,j,min=0; Scanner scn = new Scanner(System.in); num = scn.nextInt(); setNum = scn.nextInt(); val = scn.nextInt(); PenSet x = new PenSet(setNum,val); setNum = scn.nextInt(); val = scn.nextInt(); PenSet y = new PenSet(setNum,val); for(i=-1;i*x.number<num;i++){ for(j=0;(i+1)*x.number+j*y.number<num;j++); if(i==-1||((i+1)*x.value + j*y.value)<min) min=((i+1)*x.value + j*y.value); } System.out.println(min); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:2: error: expected ';' after class definition 11 | } | ^ | ; a.cc:14:15: error: expected ':' before 'static' 14 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:14:33: error: 'String' has not been declared 14 | public static void main(String[] args){ | ^~~~~~ a.cc:14:42: error: expected ',' or '...' before 'args' 14 | public static void main(String[] args){ | ^~~~ a.cc:35:2: error: expected ';' after class definition 35 | } | ^ | ; a.cc: In static member function 'static void Pencils::main(int*)': a.cc:17:17: error: 'Scanner' was not declared in this scope 17 | Scanner scn = new Scanner(System.in); | ^~~~~~~ a.cc:18:23: error: 'scn' was not declared in this scope 18 | num = scn.nextInt(); | ^~~ a.cc:21:49: error: 'PenSet::PenSet(int, int)' is private within this context 21 | PenSet x = new PenSet(setNum,val); | ^ a.cc:7:9: note: declared private here 7 | PenSet(int x,int y){ | ^~~~~~ a.cc:21:28: error: conversion from 'PenSet*' to non-scalar type 'PenSet' requested 21 | PenSet x = new PenSet(setNum,val); | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:24:49: error: 'PenSet::PenSet(int, int)' is private within this context 24 | PenSet y = new PenSet(setNum,val); | ^ a.cc:7:9: note: declared private here 7 | PenSet(int x,int y){ | ^~~~~~ a.cc:24:28: error: conversion from 'PenSet*' to non-scalar type 'PenSet' requested 24 | PenSet y = new PenSet(setNum,val); | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:26:30: error: 'int PenSet::number' is private within this context 26 | for(i=-1;i*x.number<num;i++){ | ^~~~~~ a.cc:4:13: note: declared private here 4 | int number; | ^~~~~~ a.cc:27:41: error: 'int PenSet::number' is private within this context 27 | for(j=0;(i+1)*x.number+j*y.number<num;j++); | ^~~~~~ a.cc:4:13: note: declared private here 4 | int number; | ^~~~~~ a.cc:27:52: error: 'int PenSet::number' is private within this context 27 | for(j=0;(i+1)*x.number+j*y.number<num;j++); | ^~~~~~ a.cc:4:13: note: declared private here 4 | int number; | ^~~~~~ a.cc:28:44: error: 'int PenSet::value' is private within this context 28 | if(i==-1||((i+1)*x.value + j*y.value)<min) | ^~~~~ a.cc:5:13: note: declared private here 5 | int value; | ^~~~~ a.cc:28:56: error: 'int PenSet::value' is private within this context 28 | if(i==-1||((i+1)*x.value + j*y.value)<min) | ^~~~~ a.cc:5:13: note: declared private here 5 | int value; | ^~~~~ a.cc:29:46: error: 'int PenSet::value' is private within this context 29 | min=((i+1)*x.value + j*y.value); | ^~~~~ a.cc:5:13: note: declared private here 5 | int value; | ^~~~~ a.cc:29:58: error: 'int PenSet::value' is private within this context 29 | min=((i+1)*x.value + j*y.value); | ^~~~~ a.cc:5:13: note: declared private here 5 | int value; | ^~~~~ a.cc:32:17: error: 'System' was not declared in this scope 32 | System.out.println(min); | ^~~~~~
s092740686
p00564
C++
#include<iostream> using namespace std; int main() { int n, a, b, c, d,x,y; cin n >> a >> b >> c >> d; if (n%a > 0) { x = (n / a + 1)*b; } else { x = (n / a)*b; } if (n%c > 0) { y = (n / c + 1)*d; } else { y = (n / c)*d; } cout >> min(x, y) >> endl; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: expected ';' before 'n' 6 | cin n >> a >> b >> c >> d; | ^ ~ | ; a.cc:19:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const int') 19 | cout >> min(x, y) >> endl; | ~~~~ ^~ ~~~~~~~~~ | | | | | const int | std::ostream {aka std::basic_ostream<char>} a.cc:19:14: note: candidate: 'operator>>(int, int)' (built-in) 19 | cout >> min(x, y) >> endl; | ~~~~~^~~~~~~~~~~~ a.cc:19:14: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:19:9: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 19 | cout >> min(x, y) >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:19:25: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const int&]': a.cc:19:18: required from here 19 | cout >> min(x, y) >> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s179212884
p00564
C++
#include<iostream> using namespace std; int main() { int n, a, b, c, d,x,y; cin n >> a >> b >> c >> d; if (n%a > 0) { x = (n / a + 1)*b; } else { x = (n / a)*b; } if (n%c > 0) { y = (n / c + 1)*d; } else { y = (n / c)*d; } cout << min(x, y) << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: expected ';' before 'n' 6 | cin n >> a >> b >> c >> d; | ^ ~ | ;