submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s010008286 | p00297 | C++ | #include<bits/std++.h>
using namespace std;
/**
vector<int>ar(3);
for(auto&e:ar){
scanf("%d",&e);
}
sort(ar.begin(),ar.end())
int sum=accumulate(ar.begin(),ar.end(),0);
**/
//memo kyuridenamida 1237852
int main(){
double pai=3.141592653589;
int N,d;
cin >> N >> d;
vector< array<int,3> > star;
for(int i = 0 ; i < N ; i++){
int x,y,b;
cin >> x >> y >> b;
star.push_back(array<int,3>{b,x,y});
}
sort(star.begin(),star.end());
int l = 0 , r = 0;
multiset<int> X,Y;
long long ans = 0;
while( r != N){
X.insert(star[r][1]);
Y.insert(star[r][2]);
r++;
while( star[r-1][0] - star[l][0] > d ){
X.erase(X.find(star[l][1]));
Y.erase(Y.find(star[l][2]));
l++;
}
ans = max((long long)((*X.rbegin())-(*X.begin())) * ((*Y.rbegin())-(*Y.begin())),ans);
//cout << (*X.rbegin())-(*X.begin()) << " " << ((*Y.rbegin())-(*Y.begin())) << "|" << star[r-1][0] - star[l][0] << endl;
}
cout << ans << endl;
} | a.cc:1:9: fatal error: bits/std++.h: No such file or directory
1 | #include<bits/std++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s849191583 | p00297 | C++ | #include <iostream>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <cstdio>
using namespace std;
#define MAX_N 200000
#define F first
#define Se second
#define MP(i, j) make_pair((i), (j))
#define int long long
struct S{
int sx, lx, sy, ly;
S(int isx, int ilx, int isy, int ily): sx(isx), lx(ilx), sy(isy), ly(ily){}
bool operator<(const S &s) const {
return 1;
}
};
int cnt;
void init(int n_, int *dat){
cnt = 1;
while(cnt < n_) cnt *= 2;
for(int i = 0; i < 2 * cnt - 1; i++) dat[i] = INT_MAX;
}
void update(int k, int a, int *dat){
k += cnt - 1;
dat[k] = a;
while(k > 0){
k = (k - 1) / 2;
dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
int query(int a, int b, int k, int l, int r, int *dat){
if(r <= a || b <= l) return INT_MAX;
if(a <= l && r <= b) return dat[k];
else{
int v1 = query(a, b, k * 2 + 1, l, (l + r) / 2, dat);
int vr = query(a, b, k * 2 + 2, (l + r) / 2, r, dat);
return min(v1, vr);
}
}
typedef pair<int, S> PS;
typedef vector<PS>::iterator it;
int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
int ans = 0;
vector<PS> vec;
void vdc(vector<PS> &vf, S s, int now){
if(vf[now].Se.sx > s.sx)
vf[now].Se.sx = s.sx;
if(vf[now].Se.lx < s.lx)
vf[now].Se.lx = s.lx;
if(vf[now].Se.sy > s.sy)
vf[now].Se.sy = s.sy;
if(vf[now].Se.ly < s.ly)
vf[now].Se.ly = s.ly;
}
signed main(){
cin >> n >> d;
vec.push_back(MP(-1, S(0, 0, 0, 0)));
for(i = 0; i < n; i++){
int a, b, c;
cin >> a >> b >> c;
S s = S(a, a, b, b);
it ite = lower_bound(vec.begin(), vec.end(), MP(c, s));
if(vec[ite - vec.begin() - 1].F != c){
vec.insert(ite, MP(c, s));
}
else{
vdc(vec, s, ite - vec.begin() - 1);
}
}
init(vec.size(), ax);
init(vec.size(), bx);
init(vec.size(), ay);
init(vec.size(), by);
S s = S(INT_MAX, 0, INT_MAX, 0);
vec.erase(vec.begin());
for(i = 0; i < vec.size(); i++){
update(i, vec[i].Se.sx, ax);
update(i, -vec[i].Se.lx, bx);
update(i, vec[i].Se.sy, ay);
update(i, -vec[i].Se.ly, by);
}
i = 0; j = 0;
for(;;){
while(j < vec.size()){
if(vec[j].F - vec[i].F <= d)
j++;
else
break;
}
ans = max(ans, (-query(i, j, 0, 0, cnt, bx) - query(i, j, 0, 0, cnt, ax)) * (-query(i, j, 0, 0, cnt, by) - query(i, j, 0, 0, cnt, ay)));
if(j == vec.size())
break;
i++;
}
cout << ans << endl;
return 0;
} | a.cc:47:41: error: 'N' was not declared in this scope
47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
| ^
a.cc:47:52: error: 'N' was not declared in this scope
47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
| ^
a.cc:47:63: error: 'N' was not declared in this scope
47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
| ^
a.cc:47:74: error: 'N' was not declared in this scope
47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
| ^
a.cc: In function 'int main()':
a.cc:77:26: error: 'ax' was not declared in this scope
77 | init(vec.size(), ax);
| ^~
a.cc:78:26: error: 'bx' was not declared in this scope
78 | init(vec.size(), bx);
| ^~
a.cc:79:26: error: 'ay' was not declared in this scope
79 | init(vec.size(), ay);
| ^~
a.cc:80:26: error: 'by' was not declared in this scope
80 | init(vec.size(), by);
| ^~
|
s036492530 | p00297 | C++ | #include <iostream>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <cstdio>
using namespace std;
#define N 200000
#define F first
#define Se second
#define MP(i, j) make_pair((i), (j))
#define int long long
struct S{
int sx, lx, sy, ly;
S(int isx, int ilx, int isy, int ily): sx(isx), lx(ilx), sy(isy), ly(ily){}
bool operator<(const S &s) const {
return 1;
}
};
int cnt;
void init(int n_, int *dat){
cnt = 1;
while(cnt < n_) cnt *= 2;
for(int i = 0; i < 2 * cnt - 1; i++) dat[i] = INT_MAX;
}
void update(int k, int a, int *dat){
k += cnt - 1;
dat[k] = a;
while(k > 0){
k = (k - 1) / 2;
dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
int query(int a, int b, int k, int l, int r, int *dat){
if(r <= a || b <= l) return INT_MAX;
if(a <= l && r <= b) return dat[k];
else{
int v1 = query(a, b, k * 2 + 1, l, (l + r) / 2, dat);
int vr = query(a, b, k * 2 + 2, (l + r) / 2, r, dat);
return min(v1, vr);
}
}
typedef pair<int, S> PS;
typedef vector<PS>::iterator it;
int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
int ans = 0;
vector<PS> vec;
void vdc(vector<PS> &vf, S s, int now){
if(vf[now].Se.sx > s.sx)
vf[now].Se.sx = s.sx;
if(vf[now].Se.lx < s.lx)
vf[now].Se.lx = s.lx;
if(vf[now].Se.sy > s.sy)
vf[now].Se.sy = s.sy;
if(vf[now].Se.ly < s.ly)
vf[now].Se.ly = s.ly;
}
signed main(){
cin >> n >> d;
vec.push_back(MP(-1, S(0, 0, 0, 0)));
for(i = 0; i < n; i++){
int a, b, c;
cin >> a >> b >> c;
S s = S(a, a, b, b);
it ite = lower_bound(vec.begin(), vec.end(), MP(c, s));
if(vec[ite - vec.begin() - 1].F != c){
vec.insert(ite, MP(c, s));
}
else{
vdc(vec, s, ite - vec.begin() - 1);
}
}
init(vec.size(), ax);
init(vec.size(), bx);
init(vec.size(), ay);
init(vec.size(), by);
S s = S(INT_MAX, 0, INT_MAX, 0);
vec.erase(vec.begin());
for(i = 0; i < vec.size(); i++){
update(i, vec[i].Se.sx, ax);
update(i, -vec[i].Se.lx, bx);
update(i, vec[i].Se.sy, ay);
update(i, -vec[i].Se.ly, by);
}
i = 0; j = 0;
for(;;){
while(j < vec.size()){
if(vec[j].F - vec[i].F <= d)
j++;
else
break;
}
ans = max(ans, (-query(i, j, 0, 0, cnt, bx) - query(i, j, 0, 0, cnt, ax)) * (-query(i, j, 0, 0, cnt, by) - query(i, j, 0, 0, cnt, ay)));
if(j == vec.size())
break;
i++;
}
cout << ans << endl;
return 0;
} | a.cc:47:23: error: 'MAX_N' was not declared in this scope
47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
| ^~~~~
|
s020229748 | p00297 | C++ |
typedef int unsigned long long;
#include <cstdio>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;
struct stars
{
int maxx=0,minx=0;
int maxy=0,miny=0;
};
signed main()
{
map<int, stars> data;
int n, d;
scanf("%llu %llu", &n, &d);
stars foo; int x, y, b;
for (int i = 0; i < n; ++i)
{
scanf("%llu %llu %llu", &x, &y, &b);
data[b].maxx = max(data[b].maxx, x);
data[b].minx = min(data[b].minx, x);
data[b].maxy = max(data[b].maxy, y);
data[b].miny = max(data[b].miny, y);
}
int ans=0;
stars vec;
// printf("%llu\n", vec.maxx);
for (auto a : data)
{
for (int i = a.first; i <= d; ++i)
{
// printf("%d\n", data.count(i) == 0? 1:0);
if (data.count(i) == 0)
{
// printf("%llu %llu\n", a.first, i);
goto asdfasdfasdf;
}
vec.maxx = max(vec.maxx, a.second.maxx);
vec.minx = min(vec.minx, a.second.minx);
vec.maxy = max(vec.maxy, a.second.maxy);
vec.miny = max(vec.miny, a.second.miny);
asdfasdfasdf:;
}
ans = max(ans, (vec.maxx - vec.minx)*(vec.maxy - vec.miny));
}
printf("%d\n",ans);
} | a.cc:2:28: error: declaration does not declare anything [-fpermissive]
2 | typedef int unsigned long long;
| ^~~~
|
s289034240 | p00297 | C++ | #include<iostream>
#include<iomanip>
#include<cstdlib>
#include<stdio.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main(void) {
int N, d;
cin>>N>>d;
vector<P(ll, P)> h(N);
priority_queue<ll> q;
set<ll> s;
REP(i, N) {
ll x, y, b;
cin>>x>>y>>b;
h[i].first = b;
h[i].second.first = x;
h[i].second.second = y;
if(!s.count(b)) {
s.insert(b);
q.push(b);
}
}
sort(ALL(h));
ll ite = 0;
ll ans = 0;
priority_queue<P> ux;
priority_queue<P> lx;
priority_queue<P> uy;
priority_queue<P> ly;
REP(i, q.size()) {
ll lbr = q.top();
q.pop();
while(h[ite].first <= lbr + d) {
ux.push(P(h[ite].second.first, h[ite].first));
lx.push(P(-(h[ite].second.first), h[ite].first));
uy.push(P(h[ite].second.second, h[ite].first));
ly.push(P(-(h[ite].second.second), h[ite].first));
++ite;
}
ll maxx = -1, maxy = -1, minx = -1, miny = -1;
while(!ux.empty()) {
P hoge = ux.top();
if(hoge.second >= lbr && hoge.second <= lbr + d) {
maxx = hoge.first;
break;
} else {
ux.pop();
}
} while(!lx.empty()) {
P hoge = lx.top();
if(hoge.second >= lbr && hoge.second <= lbr + d) {
minx = -(hoge.first);
break;
} else {
lx.pop();
}
} while(!uy.empty()) {
P hoge = uy.top();
if(hoge.second >= lbr && hoge.second <= lbr + d) {
maxy = hoge.first;
break;
} else {
uy.pop();
}
} while(!ly.empty()) {
P hoge = ux.top();
if(hoge.second >= lbr && hoge.second <= lbr + d) {
miny = -(hoge.first);
break;
} else {
ly.pop();
}
}
ans = max(ans, (maxx - minx) * (maxy - miny));
}
cout<<ans<<endl;
} | 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/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/new_allocator.h: In instantiation of 'class std::__new_allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>':
/usr/include/c++/14/bits/allocator.h:128:11: required from 'class std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>'
128 | class allocator : public __allocator_base<_Tp>
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:87:21: required from 'struct std::_Vector_base<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>), std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)> >'
87 | rebind<_Tp>::other _Tp_alloc_type;
| ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:428:11: required from 'class std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
a.cc:33:22: required from here
33 | vector<P(ll, P)> h(N);
| ^
/usr/include/c++/14/bits/new_allocator.h:111:7: error: 'const _Tp* std::__new_allocator<_Tp>::address(const_reference) const [with _Tp = std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>); const_pointer = std::pair<long long int, long long int> (*)(long long int, std::pair<long long int, long long int>); const_reference = std::pair<long long int, long long int> (&)(long long int, std::pair<long long int, long long int>)]' cannot be overloaded with '_Tp* std::__new_allocator<_Tp>::address(reference) const [with _Tp = std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>); pointer = std::pair<long long int, long long int> (*)(long long int, std::pair<long long int, long long int>); reference = std::pair<long long int, long long int> (&)(long long int, std::pair<long long int, long long int>)]'
111 | address(const_reference __x) const _GLIBCXX_NOEXCEPT
| ^~~~~~~
/usr/include/c++/14/bits/new_allocator.h:107:7: note: previous declaration '_Tp* std::__new_allocator<_Tp>::address(reference) const [with _Tp = std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>); pointer = std::pair<long long int, long long int> (*)(long long int, std::pair<long long int, long long int>); reference = std::pair<long long int, long long int> (&)(long long int, std::pair<long long int, long long int>)]'
107 | address(reference __x) const _GLIBCXX_NOEXCEPT
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:39:22: error: request for member 'first' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
39 | h[i].first = b;
| ^~~~~
a.cc:40:22: error: request for member 'second' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
40 | h[i].second.first = x;
| ^~~~~~
a.cc:41:22: error: request for member 'second' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
41 | h[i].second.second = y;
| ^~~~~~
a.cc:57:30: error: request for member 'first' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
57 | while(h[ite].first <= lbr + d) {
| ^~~~~
a.cc:58:42: error: request for member 'second' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
58 | ux.push(P(h[ite].second.first, h[ite].first));
| ^~~~~~
a.cc:58:63: error: request for member 'first' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
58 | ux.push(P(h[ite].second.first, h[ite].first));
| ^~~~~
a.cc:59:44: error: request for member 'second' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
59 | lx.push(P(-(h[ite].second.first), h[ite].first));
| ^~~~~~
a.cc:59:66: error: request for member 'first' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::value_type' {aka 'std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)'}
59 | lx.push(P(-(h[ite].second.first), h[ite].first));
| ^~~~~
a.cc:60:42: error: request for member 'second' in 'h.std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::operator[](((std::vector<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>::size_type)ite))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int>(long long int, std::pair<long long int, long long int>)>, std::pair<long long int, long long int>(long long int, |
s839644278 | p00297 | C++ | #include<bits/stdc++.h>
#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define clean(used) memset(used,false,sizeof(used))
using namespace std;
static const int INF = 1e18 + 9;
static const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
static const int MAX_N = 200002;
struct Seg{
int n;
int dat[MAX_N * 2];
void init(int n_){
init(n_ , INF);
}
void init(int n_, int d){
n = 1;
while(n < n_)n *= 2;
fill(dat, dat + MAX_N * 2, d);
}
};
struct SegMin : Seg {
int Min(int s,int t){
return Min(s,t,0,0,n);
}
int Min(int s, int t, int k, int l, int r){
if(r <= s || t <= l) return INF;
if(s <= l && r <= t) return dat[k];
int t1 = Min(s, t, k * 2 + 1, l, (l + r)/2);
int t2 = Min(s, t, k * 2 + 2, (l + r)/2, r);
return min(t1, t2);
}
void update(int k, int x){
k += n - 1;
dat[k] = min(dat[k], x);
while(0 < k){
k = (k - 1)/2;
dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
};
SegMin x1,x2,y1,y2;
vector<pii> a[200005];
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int d,m;
cin >> m >> d;
x1.init(m);
x2.init(m);
y1.init(m);
y2.init(m);
int b_max = 0;
int x,y,b;
rep(i,0,m){
cin >> x >> y >> b;
x1.update(b,x);
x2.update(b,-x);
y1.update(b,y);
y2.update(b,-y);
}
int ans = 0,x_mi,x_ma,y_mi,y_ma;
rep(i,0,MAX_N){
x_mi = x1.Min(i,i+d+1);
x_ma = x2.Min(i,i+d+1);
y_mi = y1.Min(i,i+d+1);
y_ma = y2.Min(i,i+d+1);
//cout << i << " ~ " << i+d << endl;
//cout << x_mi << " " << x_ma << " " << y_mi << " " << y_ma << endl;
//cout << abs(x_ma+x_mi)*abs(y_ma-y_mi) << endl;
ans = max(ans, abs(x_ma+x_mi)*abs(y_ma+y_mi));
}
cout << ans << endl;
return 0;
} | a.cc:63:14: error: 'SegMin y1' redeclared as different kind of entity
63 | SegMin x1,x2,y1,y2;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:73:8: error: request for member 'init' in 'y1', which is of non-class type 'double(double) noexcept'
73 | y1.init(m);
| ^~~~
a.cc:81:12: error: request for member 'update' in 'y1', which is of non-class type 'double(double) noexcept'
81 | y1.update(b,y);
| ^~~~~~
a.cc:88:19: error: request for member 'Min' in 'y1', which is of non-class type 'double(double) noexcept'
88 | y_mi = y1.Min(i,i+d+1);
| ^~~
|
s540599643 | p00297 | C++ | #include<bits/stdc++.h>
#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define clean(used) memset(used,false,sizeof(used))
using namespace std;
static const int INF = 1e18 + 9;
static const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
static const int MAX_N = 200002;
struct Seg{
int n;
int dat[MAX_N * 2];
void init(int n_){
init(n_ , INF);
}
void init(int n_, int d){
n = 1;
while(n < n_)n *= 2;
fill(dat, dat + MAX_N * 2, d);
}
};
struct SegMin : Seg {
int Min(int s,int t){
return Min(s,t,0,0,n);
}
int Min(int s, int t, int k, int l, int r){
if(r <= s || t <= l) return INF;
if(s <= l && r <= t) return dat[k];
int t1 = Min(s, t, k * 2 + 1, l, (l + r)/2);
int t2 = Min(s, t, k * 2 + 2, (l + r)/2, r);
return min(t1, t2);
}
void update(int k, int x){
k += n - 1;
dat[k] = min(dat[k], x);
while(0 < k){
k = (k - 1)/2;
dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
};
SegMin x1,x2,y1,y2;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int d,m;
cin >> m >> d;
x1.init(m);
x2.init(m);
y1.init(m);
y2.init(m);
int b_max = 0;
int x,y,b;
rep(i,0,m){
cin >> x >> y >> b;
x1.update(b,x);
x2.update(b,-x);
y1.update(b,y);
y2.update(b,-y);
}
int ans = 0,x_mi,x_ma,y_mi,y_ma;
rep(i,0,MAX_N){
x_mi = x1.Min(i,i+d+1);
x_ma = x2.Min(i,i+d+1);
y_mi = y1.Min(i,i+d+1);
y_ma = y2.Min(i,i+d+1);
ans = max(ans, abs(x_ma+x_mi)*abs(y_ma+y_mi));
}
cout << ans << endl;
return 0;
} | a.cc:63:14: error: 'SegMin y1' redeclared as different kind of entity
63 | SegMin x1,x2,y1,y2;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
257 | __MATHCALL (y1,, (_Mdouble_));
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:72:8: error: request for member 'init' in 'y1', which is of non-class type 'double(double) noexcept'
72 | y1.init(m);
| ^~~~
a.cc:80:12: error: request for member 'update' in 'y1', which is of non-class type 'double(double) noexcept'
80 | y1.update(b,y);
| ^~~~~~
a.cc:87:19: error: request for member 'Min' in 'y1', which is of non-class type 'double(double) noexcept'
87 | y_mi = y1.Min(i,i+d+1);
| ^~~
|
s320564553 | p00297 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define in ,
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
struct Star {
ll x, y, d;
};
ll minX[200001 * 2 - 1] = {}, maxX[200001 * 2 - 1] = {},
minY[200001 * 2 - 1] = {}, maxY[200001 * 2 - 1] = {};
ll n, nn = 1;
void update(ll k, ll a, ll c[]) {
k += nn - 1;
c[k] = a;
while(k > 0) {
k = (k - 1) / 2;
c[k] = min(c[k * 2 + 1], c[k * 2 + 2]);
}
}
ll query(ll a, ll b, ll k, ll l, ll r, ll c[]) {
if(r <= a || b <= l) return INT_MAX;
if(a <= l && r <= b) return c[k];
ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2, c);
ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r, c);
return min(vl, vr);
}
bool asc(Star &l, Star &r) {
return l.d < r.d;
}
ll main() {
ll d, ans = 0;
cin >> n >> d;
vector<Star> v(n);
while(nn < n) nn *= 2;
rep(i, 0, nn * 2 - 1) {
minX[i] = INT_MAX;
minY[i] = INT_MAX;
maxX[i] = INT_MAX;
minX[i] = INT_MAX;
}
rep(i, 0, n) cin >> v[i].x >> v[i].y >> v[i].d;
sort(v.begin(), v.end(), asc);
rep(i, 0, n) {
update(i, v[i].x * -1, maxX);
update(i, v[i].x, minX);
update(i, v[i].y * -1, maxY);
update(i, v[i].y, minY);
}
// rep(i, 0, n) cout << v[i].x << " " << v[i].y << " " << v[i].d << endl;;
// rep(i, 0, nn * 2 - 1) cout << minX[i] << endl;
ll ld = v[0].d, lp = 0;
rep(i, 1, n) {
if(v[i].d - ld > d) {
rep(j, lp + 1, i + 1) {
if(v[i].d - v[j].d <= d) {
lp = j;
ld = v[lp].d;
break;
}
}
}
ll hx = query(lp, i + 1, 0, 0, nn, maxX) * -1;
ll lx = query(lp, i + 1, 0, 0, nn, minX);
ll hy = query(lp, i + 1, 0, 0, nn, maxY) * -1;
ll ly = query(lp, i + 1, 0, 0, nn, minY);
if(lp != i) ans = max(ans, ((hx - lx) * (ll)(hy - ly)));
// cout << lp << " " << i << endl;
// cout << hx << " " << lx << " " << hy << " " << ly << endl;
// cout << ans << endl;
}
cout << ans << endl;
} | a.cc:51:1: error: '::main' must return 'int'
51 | ll main() {
| ^~
|
s139553989 | p00298 | C++ | #pragma GCC optimize("Ofast")
#include <stdio.h>
#include <utility>
using namespace std;
int min(int a,int b){return a>b?b:a;}
struct man{
int wei;
int pow;
void in(){
scanf("%d%d",&pow,&wei);
return ;
}
void carry(man a){
wei+=a.wei;
pow-=a.wei;
pow=min(pow,a.pow);
return *this;
}
void operator =(man a){
wei=a.wei;
pow=a.pow;
return ;
}
void bad(){
pow=wei=-2;
return ;
}
void init(){
pow=wei=-1;
return ;
}
bool used(){
return pow!=-1||wei!=-1;
}
bool cant(){
return pow==-2&&wei==-2;
}
};
man better(man a,man b){return a.pow>b.pow?a:b;}
bool can(man a,man b){return a.pow>=b.wei;}
const int N=1e3+10;
man a[N],ans[N][N];
int val[N][N];
man dp(int l,int r){
if(ans[l][r].used())return ans[l][r];
if(l==r){
val[l][r]=1;
ans[l][r]=a[l];
}
else if(r-l==1){
man b=a[l],c=a[r];
if(can(a[l],a[r])){
b.carry(a[r]);
if(can(a[r],a[l])){
c.carry(a[l]);
b=better(b,c);
}
ans[l][r]=b;
val[l][r]=1;
}
else if(can(a[r],a[l])){
ans[l][r]=c;
ans[l][r].carry(a[l]);
val[l][r]=1;
}
else{
ans[l][r].bad();
val[l][r]=2;
}
}
else{
man b=a[l],c=dp(l+1,r);
val[l][r]=N;
if(!c.cant()){
if(can(b,c)){
ans[l][r]=b;
ans[l][r].carry(c);
val[l][r]=1;
}
else{
ans[l][r].bad();
val[l][r]=2;
}
}
else{
ans[l][r].bad();
val[l][r]=val[l+1][r]+1;
}
b=a[r],c=dp(l,r-1);
if(!c.cant()){
if(can(b,c)){
b.carry(c);
ans[l][r]=better(ans[l][r],b);
val[l][r]=1;
}
else{
if(val[l][r]>2){
val[l][r]=2;
ans[l][r].bad();
}
}
}
else{
if(val[l][r]>val[l][r-1]+1){
ans[l][r].bad();
val[l][r]=val[l][r-1]+1;
}
}
for(int i=l+1;i<r;i++){
dp(l,i);
dp(i+1,r);
if(val[l][i]+val[i+1][r]<val[l][r]){
val[l][r]=val[l][i]+val[i+1][r];
ans[l][r].bad();
}
}
}
return ans[l][r];
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
a[i].in();
for(int j=i;j<n;j++)ans[i][j].init();
}
dp(0,n-1);
printf("%d\n",val[0][n-1]);
}
| a.cc: In member function 'void man::carry(man)':
a.cc:18:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
18 | return *this;
| ^~~~~
|
s069169771 | p00298 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <cstdio>
using namespace std;
#define N 1000
#define F first
#define S second
typedef pair<int, int> P;
int main(){
int n, c[N], w[N];
P dp[N][2] = {};
cin >> n;
for(int i = 0; i < n; i++){
cin >> c[i] >> w[i];
}
dp[0][0] = -w[0];
for(int i = 1; i < n; i++){
for(int j = 0; j < 2; j++){
if(c[i] >= -dp[i - 1][j].S){
dp[i][1] = max(dp[i][1], make_pair(++dp[i - 1][j].F, dp[i - 1][j].S - w[i]));
}
dp[i][0] = max(dp[i][0], make_pair(dp[i - 1][j].F, -w[i]));
}
}
cout << n - max(dp[n - 1][0].F, dp[n - 1][1].F) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:24: error: no match for 'operator=' (operand types are 'P' {aka 'std::pair<int, int>'} and 'int')
19 | dp[0][0] = -w[0];
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = int; _T2 = int]'
946 | operator=(const pair<_U1, _U2>& __p)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:946:9: note: template argument deduction/substitution failed:
a.cc:19:24: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
19 | dp[0][0] = -w[0];
| ^
/usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = int; _T2 = int]'
957 | operator=(pair<_U1, _U2>&& __p)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:957:9: note: template argument deduction/substitution failed:
a.cc:19:24: note: mismatched types 'std::pair<_T1, _T2>' and 'int'
19 | dp[0][0] = -w[0];
| ^
/usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<int, int>&]'
921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:923:65: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, const std::pair<int, int>&, const std::__nonesuch&>' {aka 'const std::pair<int, int>&'}
921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
922 | is_copy_assignable<_T2>>::value,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
923 | const pair&, const __nonesuch&> __p)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<int, int>&&]'
931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:933:55: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, std::pair<int, int>&&, std::__nonesuch&&>' {aka 'std::pair<int, int>&&'}
931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
932 | is_move_assignable<_T2>>::value,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
933 | pair&&, __nonesuch&&> __p)
| ~~~~~~~~~~~~~~~~~~~~~~^~~
|
s029926689 | p00298 | C++ | using namespace std;
int n, w[1000], c[1000], r[1000], dp[1000][1000];
int main() {
cin >> n; for (int i = 1; i <= n; i++) { cin >> c[i] >> w[i]; r[i] = w[i]; }
for (int i = 1; i <= n; i++)r[i] += r[i - 1];
for (int i = 1; i <= n; i++) { dp[i][i] = 1; }
for (int i = 0; i < n; i++) {
for (int j = 1; j <= n; j++) {
int L = j, R = j + i; if (R > n)continue;
if (dp[L][R] == 0)continue;
int WA = r[R] - r[L - 1];
if (L >= 2 && c[L - 1] >= WA) { dp[L - 1][R] = 1; }
if (R < n && c[R + 1] >= WA) { dp[L][R + 1] = 1; }
}
}
int cnt = 0, p = 1, q = 1;
while (p <= n) {
while (dp[p][q] == 1) { q++; }
cnt++; p = q;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> n; for (int i = 1; i <= n; i++) { cin >> c[i] >> w[i]; r[i] = w[i]; }
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:21:5: error: 'cout' was not declared in this scope
21 | cout << cnt << endl;
| ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:20: error: 'endl' was not declared in this scope
21 | cout << cnt << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s212031398 | p00299 | C++ | // AOJ 0304
#include<iostream>
#include<string>
#include<vector>
#define rep(i,a) for(int i=0;i<(a);++i)
typedef std::pair<int, int> P;
const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;
struct edge
{
int from, to, cost;
edge( int from, int to, int cost )
: from(from), to(to), cost(cost)
{}
};
int N, C;
std::string cst[MAX_C];
std::vector<edge> es;
std::vector<P> ps;
int d[MAX_N];
bool nlp;
int read( int &p, const std::string &s )
{
int ret = 0;
while( p < s.size() && isdigit(s[p]) )
ret *= 10, ret += s[p++]-'0';
return ret;
}
void bellmanFord()
{
std::fill( d, d+N, INF );
d[0] = 0;
nlp = false;
rep( j, N )
{
rep( i, es.size() ) if( d[es[i].from]+es[i].cost < d[es[i].to] )
{
d[es[i].to] = d[es[i].from]+es[i].cost;
if( j == N-1 )
{ nlp = true; }
}
}
return;
}
int main()
{
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::cin >> N >> C;
rep( i, C )
{
std::cin >> cst[i];
int p = 0, a = 0, b = 0, t = 0, d = 0;
bool pm;
a = read( p, cst[i] );
if( cst[i][p] == '<' )
t = 0, p += 2;
else if( cst[i][p] == '>' )
t = 1, p += 2;
else
t = 2, ++p;
b = read( p, cst[i] );
pm = cst[i][p++]=='+';
d = read( p, cst[i] );
--a; --b;
if( !t )
{
es.push_back( edge( b, a, 0 ) );
es.push_back( pm?edge( b, a, -d ):edge( a, b, d ) );
}
else if( t == 1 )
{
es.push_back( edge( a, b, 0 ) );
es.push_back( pm?edge( a, b, -d ):edge( b, a, d ) );
}
else
ps.push_back( P( a, b ) );
}
bool imp = true;
int ans = 0;
if( ps.empty() )
{
bellmanFord();
imp &= nlp;
rep( j, N )
ans = std::max( ans, d[j] );
}
rep( i, 1<<ps.size() )
{
rep( j, ps.size() )
es.push_back( i>>j&1?edge( ps[j].first, ps[j].second, 0 ):edge( ps[j].second, ps[j].first, 0 ) );
bellmanFord();
imp &= nlp;
rep( j, N )
ans = std::max( ans, d[j] );
rep( j, ps.size() )
es.pop_back();
}
if( imp )
std::cout << -1 << std::endl;
else if( ans == INF )
std::cout << "inf" << std::endl;
else
std::cout << ans << std::endl;
return 0;
} | a.cc:9:48: error: 'numeric_limits' is not a member of 'std'
9 | const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;
| ^~~~~~~~~~~~~~
a.cc:9:63: error: expected primary-expression before 'int'
9 | const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;
| ^~~
|
s659217612 | p00300 | Java | import java.util.Scanner;
//0305
public class a {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while (n-- > 0) {
int r = sc.nextInt();
int t = sc.nextInt();
String a = "";
for (int y = 0; y < ( t % 30 > 0 ? 2 : 1); y++) {
for (int x = 0; x < (r % 100 > 0 ? 2 : 1); x++) {
if ((x | y) == 1) {
a += " ";
}
a += (t / 30 + y) * 5 + r / 100 + x;
}
}
System.out.println(a);
}
}
}
| Main.java:4: error: class a is public, should be declared in a file named a.java
public class a {
^
1 error
|
s065706946 | p00300 | Java | import java.util.Scanner;
public class a{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
while(n-->0){
int r=sc.nextInt(),t=sc.nextInt();String a="";
for(int y=0;y<(t%30>0?2:1);y++)
for(int x=0;x<(r%100>0?2:1);x++,a+=(t/30+y)*5+r/100+x)
if((x|y)==1)
a+="";
System.out.println(a);
}
}
}
| Main.java:3: error: class a is public, should be declared in a file named a.java
public class a{
^
1 error
|
s643441491 | p00300 | C++ | #include <stdio.h>
int main(){
int n;
scanf("%d",&n);
while(n--){
scanf("%d%d",&r,&t);
if(r%100==0){
if(t%60==0)printf("%d\n",(t/60)*5+r/100);
else printf("%d %d\n",(t/60)*5 +r/100,(t/60+1)*5 +r/100);
}
else{
if(t%60==0)printf("%d %d\n",(t/60)*5+ r/100,(t/60)*5+ r/100 +1);
else printf("%d %d %d %d\n",(t/60)*5+ r/100,(t/60)*5+ r/100 +1,(t/60)*5+ r/100 +5,(t/60)*5+ r/100 +6);
}
}
}
| a.cc: In function 'int main()':
a.cc:6:23: error: 'r' was not declared in this scope
6 | scanf("%d%d",&r,&t);
| ^
a.cc:6:26: error: 't' was not declared in this scope
6 | scanf("%d%d",&r,&t);
| ^
|
s207739168 | p00300 | C++ | #include <set>
using namespace std;
int main(){
int n,x0,y0,x1,y1;
for(scanf("%d",&n);n--;){
scanf("%d%d",&x0,&y0);
x1=(x0+99)/100;
y1=(y0+29)/30;
x0/=100;
y0/=30;
set<int>se;
se.insert(y0*5+x0);
se.insert(y0*5+x1);
se.insert(y1*5+x0);
se.insert(y1*5+x1);
bool first=true;
for(set<int>::iterator it=se.begin();it!=se.end();++it){
if(!first)putchar(' ');
first=false;
printf("%d",*it);
}
puts("");
}
} | a.cc: In function 'int main()':
a.cc:5:13: error: 'scanf' was not declared in this scope
5 | for(scanf("%d",&n);n--;){
| ^~~~~
a.cc:18:35: error: 'putchar' was not declared in this scope; did you mean 'char'?
18 | if(!first)putchar(' ');
| ^~~~~~~
| char
a.cc:20:25: error: 'printf' was not declared in this scope
20 | printf("%d",*it);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include <set>
+++ |+#include <cstdio>
2 | using namespace std;
a.cc:22:17: error: 'puts' was not declared in this scope
22 | puts("");
| ^~~~
|
s258758193 | p00300 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
int r;
int t;
vector<int> target;
vector<int> k;
vector<vector<int>> result;
cin >> n;
for(int i=0;i<n;++i){
cin>>r>>t;
if(r==100)
target.push_back(1);
else if(r>100 && r<200){
target.push_back(1);
target.push_back(2);
}
else if(r==200)
target.push_back(2);
else if(r>200 && r<300){
target.push_back(2);
target.push_back(3);
}
else if(r==300)
target.push_back(3);
else if(r>300 && r<400){
target.push_back(3);
target.push_back(4);
}
else if(r==400)
target.push_back(4);
else if(r>400 && r<500){
target.push_back(4);
target.push_back(5);
}
else if(r==500)
target.push_back(5);
if(t==30 || t==60 || t==90 || t==120 || t==150 || t==180){
for(auto& i:target)
i+=(t/6);
}
else{
if(t>0 && t<30){
for(auto i:target)
target.push_back(i+5);
}
else if(t>30 && t<60){
for(auto& i:target){
i+=5;
}
else if(t>60 && t<90){
for(auto& i:target){
i+=10;
}
}
else if(t>90 && t<120){
for(auto& i:target){
i+=15;
}
}
else if(t>120 && t<150){
for(auto& i:target){
i+=20;
}
}
else if(t>150 && t<180){
for(auto& i:target){
i+=25;
}
}
for(auto& i:target){
k.push_back(i+5);
}
for(auto i:k)
target.push_back(i);
}
result.push_back(target);
target.clear();
k.clear();
}
for(int i=0;i<n;++i){
bool flag=false;
for(auto j:result[i]){
if(flag==true)
cout<<" ";
cout<<j;
if(flag!=true)
flag=true;
}
cout<<endl;
}
} | a.cc: In function 'int main()':
a.cc:66:7: error: expected '}' before 'else'
66 | else if(t>60 && t<90){
| ^~~~
a.cc:61:28: note: to match this '{'
61 | else if(t>30 && t<60){
| ^
|
s813542312 | p00300 | C++ | c | a.cc:1:1: error: 'c' does not name a type
1 | c
| ^
|
s578608653 | p00300 | C++ | include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int r[51],t[51];
for(int i=0;i<n;i++){
int bufa=0;
cin>>r[i]>>t[i];
if(r[i]%100==0){
if(t[i]%30==0||t[i]==0){
cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
}
else {
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+5<<endl;//円弧上
}
}
else if(t[i]%30==0||t[i]==0){
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+1<<endl;//直線上
}
else{
cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>n;
| ^~~
a.cc:15:15: error: 'cout' was not declared in this scope
15 | cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
| ^~~~
a.cc:15:45: error: 'endl' was not declared in this scope
15 | cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
| ^~~~
a.cc:19:15: error: 'cout' was not declared in this scope
19 | cout<<bufa<<" "<<bufa+5<<endl;//円弧上
| ^~~~
a.cc:19:40: error: 'endl' was not declared in this scope
19 | cout<<bufa<<" "<<bufa+5<<endl;//円弧上
| ^~~~
a.cc:24:15: error: 'cout' was not declared in this scope
24 | cout<<bufa<<" "<<bufa+1<<endl;//直線上
| ^~~~
a.cc:24:40: error: 'endl' was not declared in this scope
24 | cout<<bufa<<" "<<bufa+1<<endl;//直線上
| ^~~~
a.cc:27:15: error: 'cout' was not declared in this scope
27 | cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
| ^~~~
a.cc:27:66: error: 'endl' was not declared in this scope
27 | cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
| ^~~~
a.cc:28:11: error: expected '}' at end of input
28 | }
| ^
a.cc:9:29: note: to match this '{'
9 | for(int i=0;i<n;i++){
| ^
a.cc:28:11: error: expected '}' at end of input
28 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s314883322 | p00300 | C++ | include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int r[51],t[51];
for(int i=0;i<n;i++){
int bufa=0;
cin>>r[i]>>t[i];
if(r[i]%100==0){
if(t[i]%30==0||t[i]==0){
cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
}
else {
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+5<<endl;//円弧上
}
}
else if(t[i]%30==0||t[i]==0){
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+1<<endl;//直線上
}
else{
cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
}
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>n;
| ^~~
a.cc:15:15: error: 'cout' was not declared in this scope
15 | cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
| ^~~~
a.cc:15:45: error: 'endl' was not declared in this scope
15 | cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
| ^~~~
a.cc:19:15: error: 'cout' was not declared in this scope
19 | cout<<bufa<<" "<<bufa+5<<endl;//円弧上
| ^~~~
a.cc:19:40: error: 'endl' was not declared in this scope
19 | cout<<bufa<<" "<<bufa+5<<endl;//円弧上
| ^~~~
a.cc:24:15: error: 'cout' was not declared in this scope
24 | cout<<bufa<<" "<<bufa+1<<endl;//直線上
| ^~~~
a.cc:24:40: error: 'endl' was not declared in this scope
24 | cout<<bufa<<" "<<bufa+1<<endl;//直線上
| ^~~~
a.cc:27:15: error: 'cout' was not declared in this scope
27 | cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
| ^~~~
a.cc:27:66: error: 'endl' was not declared in this scope
27 | cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
| ^~~~
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s914651504 | p00300 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int r[51],t[51];
for(int i=0;i<n;i++){
int bufa=0;
cin>>r[i]>>t[i];
if(r[i]%100==0){
if(t[i]%30==0||t[i]==0){
cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
}
else {
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+5<<endl;//円弧上
}
}
else if(t[i]%30==0||t[i]==0){
bufa=(r[i]/100)+5*(t[i]/30);
cout<<bufa<<" "<<bufa+1<<endl;//直線上
}
else{
cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s919899273 | p00300 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, r, t, ten[10];
cin>>n;
for(int i = 0; i < n; i++){
cin>>r>>t;
if(r%100 == 0){//cout<<"A"<<endl;
if(t%30 == 0){//cout<<"B"<<endl;
ten[0] = r/100 + (t/30)*5;
t =1;
} else {
ten[0] = r/100 + (t/30)*5;
ten[1] = r/100 + (t/30)*5 + 5;
t = 2;
}
} else{
if(t%30 == 0{
ten[0] = r/100 + (t/30)*5;
ten[1] = r/100+1 + (t/30)*5;
t = 2;
}else{
ten[0] = r/100 + (t/30)*5;
ten[1] = r/100 + (t/30)*5 + 5;
ten[2] = r/100+1 + (t/30)*5;
ten[3] = r/100+1 + (t/30)*5 + 5;
t = 4;
}
}
sort(ten, ten + t);
for(int j = 0; j < t; j++){
if(j) cout<<" ";
cout<<ten[j];
}cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:19: error: expected ')' before '{' token
21 | if(t%30 == 0{
| ~ ^
| )
a.cc:32:5: error: expected primary-expression before '}' token
32 | }
| ^
|
s110899031 | p00301 | C | #include <stdio.h>
#include <string.h>
char result[12];
int num;
char p:
int main()
{
int rem,flag;
scanf("%d",&num);
memset(result,0,sizeof(result));
p=result[10];
while(num)
{
flag=0;
rem = num % 3;
if(num==1)
p[0]++;
else if(num==2)
{
p[0]--;
p[-1]++;
flag = 1;
}
num /= 3;
}
if(flag==0)
p++;
for(p<result+11;p++)
printf("%c",ans[p[0]+1]);
return(0);
} | main.c:6:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
6 | char p:
| ^
|
s892339985 | p00301 | C++ | #include <string>
#include <iostream>
#pragma warning(disable : 4996)
using namespace std;
const int power[12] = { 1, 3, 9, 27, 91, 243, 729, 2187, 6561, 19683, 59049, 177141 };
int n;
void solve(int x, int v, string S) {
if (x == 12) return;
if (v == n) { reverse(S.begin(), S.end()); printf("%s\n", S.c_str()); return; }
solve(x + 1, v - power[x], S + '-');
solve(x + 1, v, S + '0');
solve(x + 1, v + power[x], S + '+');
}
int main() {
scanf("%d", &n); solve(0, 0, "");
return 0;
} | a.cc: In function 'void solve(int, int, std::string)':
a.cc:9:23: error: 'reverse' was not declared in this scope
9 | if (v == n) { reverse(S.begin(), S.end()); printf("%s\n", S.c_str()); return; }
| ^~~~~~~
|
s451828086 | p00301 | C++ | #pragma once
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
double z;
long w;
long zmax=0;
long start;
int result[100]={};
bool find =false;
string S;
//3/11;
int main(){
scanf("%ld",&w);
z=(double)w;
while(z>=3){
z/=3;
zmax++;
}
S+="+";
switch(zmax){
case 0:
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
break;
case 1:
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+9){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
break;
case 2:
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+27){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 3:
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+81){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 4:
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+243){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 5:
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+729){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 6:
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+2187){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 7:
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+6561){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 8:
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+19683){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 9:
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+59049){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 10:
for(int b=-1;b<2;b++){
result[10]=b;
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+b*59049+177147){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 11:
for(int a=-1;a<2;a++){
result[11]=a;
for(int b=-1;b<2;b++){
result[10]=b;
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+b*59049+a*177147+531441){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
}
if(w==1){
S="+";
}
if(w==2){
S="+-";
}
cout<<S<<endl;
return 0;
} | a.cc:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
a.cc: In function 'int main()':
a.cc:31:113: error: reference to 'find' is ambiguous
31 | find =true;
| ^~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:4:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:55:113: error: reference to 'find' is ambiguous
55 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:71:100: error: reference to 'find' is ambiguous
71 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:85:113: error: reference to 'find' is ambiguous
85 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:100:100: error: reference to 'find' is ambiguous
100 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:104:92: error: reference to 'find' is ambiguous
104 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:120:113: error: reference to 'find' is ambiguous
120 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:136:100: error: reference to 'find' is ambiguous
136 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:140:92: error: reference to 'find' is ambiguous
140 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:144:84: error: reference to 'find' is ambiguous
144 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:161:113: error: reference to 'find' is ambiguous
161 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:177:100: error: reference to 'find' is ambiguous
177 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:181:92: error: reference to 'find' is ambiguous
181 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:185:84: error: reference to 'find' is ambiguous
185 | |
s470604980 | p00301 | C++ | #pragma once
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
double z;
long w;
long zmax=0;
long start;
int result[100]={};
bool find =false;
string S;
int main(){
scanf("%ld",&w);
z=(double)w;
while(z>=3){
z/=3;
zmax++;
}
S+="+";
switch(zmax){
case 0:
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
break;
case 1:
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+9){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
break;
case 2:
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+27){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 3:
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+81){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 4:
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+243){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 5:
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+729){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 6:
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+2187){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 7:
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+6561){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 8:
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+19683){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 9:
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+59049){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 10:
for(int b=-1;b<2;b++){
result[10]=b;
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+b*59049+177147){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
case 11:
for(int a=-1;a<2;a++){
result[11]=a;
for(int b=-1;b<2;b++){
result[10]=b;
for(int c=-1;c<2;c++){
result[9]=c;
for(int d=-1;d<2;d++){
result[8]=d;
for(int e=-1;e<2;e++){
result[7]=e;
for(int f=-1;f<2;f++){
result[6]=f;
for(int g=-1;g<2;g++){
result[5]=g;
for(int h=-1;h<2;h++){
result[4]=h;
for(int j=-1;j<2;j++){
result[3]=j;
for(int k=-1;k<2;k++){
result[2]=k;
for(int l=-1;l<2;l++){
result[1]=l;
for(int m=-1;m<2;m++){
result[0]=m;
if(w==m+l*3+k*9+j*27+h*81+g*243+f*729+e*2187+d*6561+c*19683+b*59049+a*177147+531441){
find =true;
for(int i=zmax;i>=0;i--){
if(result[i]==-1){
S+="-";
}
if(result[i]==0){
S+="0";
}
if(result[i]==1){
S+="+";
}
}
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
if(find== true){
break;
}
}
break;
}
if(w==1){
S="+";
}
if(w==2){
S="+-";
}
cout<<S<<endl;
return 0;
} | a.cc:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
a.cc: In function 'int main()':
a.cc:30:113: error: reference to 'find' is ambiguous
30 | find =true;
| ^~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:4:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:54:113: error: reference to 'find' is ambiguous
54 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:70:100: error: reference to 'find' is ambiguous
70 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:84:113: error: reference to 'find' is ambiguous
84 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:99:100: error: reference to 'find' is ambiguous
99 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:103:92: error: reference to 'find' is ambiguous
103 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:119:113: error: reference to 'find' is ambiguous
119 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:135:100: error: reference to 'find' is ambiguous
135 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:139:92: error: reference to 'find' is ambiguous
139 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:143:84: error: reference to 'find' is ambiguous
143 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:160:113: error: reference to 'find' is ambiguous
160 | find =true;
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:176:100: error: reference to 'find' is ambiguous
176 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:180:92: error: reference to 'find' is ambiguous
180 | if(find== true){
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidates are: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
a.cc:12:6: note: 'bool find'
12 | bool find =false;
| ^~~~
a.cc:184:84: error: reference to 'find' is ambiguous
184 | |
s599150143 | p00301 | C++ | import java.util.Scanner;
// 0306
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt(),a[]=new int[15],i=0;
while(n>0) {
a[i++]=(n+1)%3-1;
n=(n-a[i-1])/3;
}
while(i-->0)
System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
}
}
| 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:4:11: error: expected ':' before 'static'
4 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:4:29: error: 'String' has not been declared
4 | public static void main(String[] args) {
| ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
4 | public static void main(String[] args) {
| ^~~~
a.cc:14:2: error: expected ';' after class definition
14 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
5 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:6:15: error: 'sc' was not declared in this scope
6 | int n=sc.nextInt(),a[]=new int[15],i=0;
| ^~
a.cc:8:13: error: 'a' was not declared in this scope
8 | a[i++]=(n+1)%3-1;
| ^
a.cc:8:15: error: 'i' was not declared in this scope
8 | a[i++]=(n+1)%3-1;
| ^
a.cc:11:15: error: 'i' was not declared in this scope
11 | while(i-->0)
| ^
a.cc:12:13: error: 'System' was not declared in this scope
12 | System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
| ^~~~~~
a.cc:12:31: error: 'a' was not declared in this scope
12 | System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
| ^
|
s912338795 | p00303 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
int N;
vint G[2222];
bool used[222];
bool dfs(int v,int p,int s){
if(used[v]){
if(s==v)return true;
return false;
}
used[v]=true;
rep(i,G[v].size(){
int to=G[v][i];
if(to==p)continue;
if(dfs(to,v,s))return true;
}
return false;
}
signed main(){
cin>>N;
rep(i,N){
int a,b;
string s;
cin>>a>>s>>b;
a--;b--;b+=100;
if(s=="wait")G[a].pb(b);
else G[b].pb(a);
}
bool f=false;
rep(i,200){
fill_n(used,200,false);
f|=dfs(i,-1,i);
}
cout<<f<<endl;
return 0;
} | a.cc:55:2: error: unterminated argument list invoking macro "rep"
55 | }
| ^
a.cc: In function 'bool dfs(long long int, long long int, long long int)':
a.cc:29:5: error: 'rep' was not declared in this scope
29 | rep(i,G[v].size(){
| ^~~
a.cc:29:8: error: expected '}' at end of input
29 | rep(i,G[v].size(){
| ^
a.cc:23:28: note: to match this '{'
23 | bool dfs(int v,int p,int s){
| ^
a.cc:28:12: warning: control reaches end of non-void function [-Wreturn-type]
28 | used[v]=true;
| ~~~~~~~^~~~~
|
s854177722 | p00303 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int V;
vi G[2005];
vi rG[2005];
vi vs;
bool used[2005];
int cmp[2005];
void add_edge(int from, int to){
G[from].push_back(to);
rG[to].push_back(from);
}
void dfs(int v){
used[v] = true;
for(int i = 0; i < G[v].size(); i++){
if(!used[G[v][i]]) dfs(G[v][i]);
}
vs.push_back(v);
}
void rdfs(int v, int k){
used[v] = true;
cmp[v] = k;
for(int i = 0; i < rG[v].size(); i++){
if(used[rG[v][i]]) rdfs(rG[v][i], k);
}
}
int scc(){
memset(used, 0, sizeof(used));
vs.clear();
for(int v = 0; v < V; v++){
if(!used[v]) dfs(v);
}
memset(used, 0, sizeof(used));
int k=0;
for(int i = vs.size() - 1; i >= 0; i--){
if(!used[vs[i]]) rdfs(vs[i], k++);
}
return k;
}
int main() {
int n;
string rel;
int u[105],d[105];
cin>>n;
V = 2*n;
for(int i = 0; i < n; i++){
cin>>u[i]>>rel>>d[i];
if(rel == "lock"){
add_edge(d[i],u[i]);
}
else{
add_edge(u[i],d[i]);
}
}
int check = scc();
if(check == 0){
cout<<'0'<<endl;
}
else{
cout<<'1'<<endl;
}
}
//?????? | a.cc: In function 'int scc()':
a.cc:58:9: error: 'memset' was not declared in this scope
58 | memset(used, 0, sizeof(used));
| ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
13 | #include <iomanip>
+++ |+#include <cstring>
14 | #define fi first
|
s923515685 | p00303 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int V;
vi G[2005];
vi rG[2005];
vi vs;
bool used[2005];
int cmp[2005];
void add_edge(int from, int to){
G[from].push_back(to);
rG[to].push_back(from);
}
void dfs(int v){
used[v] = true;
for(int i = 0; i < G[v].size(); i++){
if(!used[G[v][i]]) dfs(G[v][i]);
}
vs.push_back(v);
}
void rdfs(int v, int k){
used[v] = true;
cmp[v] = k;
for(int i = 0; i < rG[v].size(); i++){
if(!used[rG[v][i]]) rdfs(rG[v][i], k);
}
}
int scc(){
memset(used, 0, sizeof(used));
vs.clear();
for(int v=0; v < V; v++){
if(!used[v]) dfs(v);
}
memset(used, 0, sizeof(used));
int k=0;
for(int i = vs.size() - 1; i >= 0; i--){
if(!used[vs[i]]) rdfs(vs[i], k++);
}
return k;
}
int main() {
int n;
string rel;
int u[105],d[105];
cin>>n;
V = 250;
for(int i = 0; i < n; i++){
cin>>u[i]>>rel>>d[i];
u[i]--;
d[i]--;
if(rel == "lock"){
add_edge(d[i]+100,u[i]);
}
else{
add_edge(u[i],d[i]+100);
}
}
int check = scc();
if(check == V){
cout<<'0'<<endl;
}
else{
cout<<'1'<<endl;
}
} | a.cc: In function 'int scc()':
a.cc:58:9: error: 'memset' was not declared in this scope
58 | memset(used, 0, sizeof(used));
| ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
13 | #include <iomanip>
+++ |+#include <cstring>
14 | #define fi first
|
s250114559 | p00303 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int V;
vi G[2005];
vi rG[2005];
vi vs;
bool used[2005];
int cmp[2005];
void add_edge(int from, int to){
G[from].push_back(to);
rG[to].push_back(from);
}
void dfs(int v){
used[v] = true;
for(int i = 0; i < G[v].size(); i++){
if(!used[G[v][i]]) dfs(G[v][i]);
}
vs.push_back(v);
}
void rdfs(int v, int k){
used[v] = true;
cmp[v] = k;
for(int i = 0; i < rG[v].size(); i++){
if(!used[rG[v][i]]) rdfs(rG[v][i], k);
}
}
int scc(){
memset(used, 0, sizeof(used));
vs.clear();
for(int v=0; v < V; v++){
if(!used[v]) dfs(v);
}
memset(used, 0, sizeof(used));
int k=0;
for(int i = vs.size() - 1; i >= 0; i--){
if(!used[vs[i]]) rdfs(vs[i], k++);
}
return k;
}
int main() {
int n;
string rel;
int u[105],d[105];
cin>>n;
V = 250;
for(int i = 0; i < n; i++){
cin>>u[i]>>rel>>d[i];
u[i]--;
d[i]--;
if(rel == "lock"){
add_edge(d[i]+100,u[i]);
}
else{
add_edge(u[i],d[i]+100);
}
}
int check = scc();
if(check == V){
cout<<'0'<<endl;
}
else{
cout<<'1'<<endl;
}
} | a.cc: In function 'int scc()':
a.cc:58:9: error: 'memset' was not declared in this scope
58 | memset(used, 0, sizeof(used));
| ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
13 | #include <iomanip>
+++ |+#include <cstring>
14 | #define fi first
|
s293844730 | p00303 | C++ | #include "iostream"
#include "queue"
using namespace std;
int Q;
int U, D;
char query[5];
queue<int> dir[201];
int Now, Next;
bool Is_use[201];
int main() {
cin >> Q;
for (int i = 0; i < Q; i++) {
cin >> U >> query >> D;
if (query[0] == 'w') {
dir[U].push(D + 100);
}
else {
dir[D + 100].push(U);
}
}
for (int i = 1; i <= 100; i++) {
while (!dir[i].empty()) {
for (int j = 1; j <= 200; j++) {
Is_use[j] = true;
}
Now = i;
Is_use[i] = false;
while (!dir[Now].empty()) {
Next = dir[Now].front();
dir[Now].pop();
if (Is_use[Next]) {
Is_use[Next] = false;
}
else {
cout << "1\n";
return 0;
}
Now = Next;
}
}
}
cout << "0\n";
return 0; | a.cc: In function 'int main()':
a.cc:45:18: error: expected '}' at end of input
45 | return 0;
| ^
a.cc:12:12: note: to match this '{'
12 | int main() {
| ^
|
s569865273 | p00303 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
int n;
vector<int> u[101];
int d[101];
int doneU[101], doneD[101]:
int f = 0;
void solve(int i, int m, map<int, int> loopU, map<int, int> loopD) {
if(f) return;
if(m == 0) {
if(loopD[i]) {
f = 1;
return;
}
loopD[i] = 1;
if(d[i]) solve(d[i], !m, loopU, loopD);
}else {
if(loopU[i]) {
f = 1;
return;
}
loopU[i] = 1;
rep(j, 0, u[i].size()) {
solve(u[i][j], !m, loopU, loopD);
}
}
}
int main() {
cin >> n;
rep(i, 0, n) {
int a, b;
string s;
cin >> a >> s >> b;
if(s[0] == 'l') {
d[b] = a;
}else {
u[a].pb(b);
}
}
rep(i, 1, 101) {
if(d[i]) {
map<int, int> a, b;
solve(i, 0, a, b);
}
}
rep(i, 1, 101) {
if(u[i].size() > 0) {
map<int, int> a, b;
solve(i, 1, a, b);
}
}
cout << f << endl;
} | a.cc:21:27: error: expected initializer before ':' token
21 | int doneU[101], doneD[101]:
| ^
a.cc: In function 'void solve(int, int, std::map<int, int>, std::map<int, int>)':
a.cc:25:6: error: 'f' was not declared in this scope
25 | if(f) return;
| ^
a.cc:28:7: error: 'f' was not declared in this scope
28 | f = 1;
| ^
a.cc:35:7: error: 'f' was not declared in this scope
35 | f = 1;
| ^
a.cc: In function 'int main()':
a.cc:69:11: error: 'f' was not declared in this scope
69 | cout << f << endl;
| ^
|
s574427810 | p00304 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
int nonempty[1000];
int empty[1000];
vector<int> g[1000];
string type[1000];
int MOD = 1e9 + 7;
void dfs(int x){
// preprocess
for(int j = 0 ; j < g[x].size() ; j++){
dfs(g[x][j]);
}
if( type[x][0] != 'E' ){
// main process
empty[x] = type[x].back() == '?';
if( type[x][0] == 'R' ){
for(int i = 1 ; i < (1<<g[x].size()) ; i++){
int emp = 1;
int sub = 1;
for(int j = 0 ; j < g[x].size() ; j++){
if( i >> j & 1 ){
emp *= empty[g[x][j]];
sub *= empty[g[x][j]] + nonempty[g[x][j]];
sub %= MOD;
}
}
sub -= emp;
empty[x] |= emp;
nonempty[x] += sub;
nonempty[x] %= MOD;
}
}else{
for(int j = 0 ; j < g[x].size() ; j++){
empty[x] |= empty[g[x][j]];
nonempty[x] += nonempty[g[x][j]];
nonempty[x] %= MOD;
}
}
}else{
empty[x] = type[x].back() == '?';
int sub = 1;
int emp = 1;
for(int j = 0 ; j < g[x].size() ; j++){
emp *= empty[g[x][j]];
sub *= (empty[g[x][j]]+nonempty[g[x][j]]);
sub %= MOD;
}
nonempty[x] = sub;
}
//cout << x+1 << " emp:" << empty[x] << " nonemp:" << nonempty[x] << "(" << type[x] << endl;
}
signed main(){
int N;
cin >> N;
for(int i = 0 ; i < N ; i++)
cin >> type[i];
for(int i = 0 ; i < N - 1 ; i++){
int s,t;
cin >> s >> t;
--s,--t;
g[s].push_back(t);
}
dfs(0);
cout << ((nonempty[0] + empty[0])%MOD+MOD)%MOD << endl;
} | a.cc: In function 'void dfs(long long int)':
a.cc:17:17: error: reference to 'empty' is ambiguous
17 | empty[x] = type[x].back() == '?';
| ^~~~~
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:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:24:56: error: reference to 'empty' is ambiguous
24 | emp *= empty[g[x][j]];
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:25:56: error: reference to 'empty' is ambiguous
25 | sub *= empty[g[x][j]] + nonempty[g[x][j]];
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:30:33: error: reference to 'empty' is ambiguous
30 | empty[x] |= emp;
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:36:33: error: reference to 'empty' is ambiguous
36 | empty[x] |= empty[g[x][j]];
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:36:45: error: reference to 'empty' is ambiguous
36 | empty[x] |= empty[g[x][j]];
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:42:17: error: reference to 'empty' is ambiguous
42 | empty[x] = type[x].back() == '?';
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:46:32: error: reference to 'empty' is ambiguous
46 | emp *= empty[g[x][j]];
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc:47:33: error: reference to 'empty' is ambiguous
47 | sub *= (empty[g[x][j]]+nonempty[g[x][j]]);
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:72:33: error: reference to 'empty' is ambiguous
72 | cout << ((nonempty[0] + empty[0])%MOD+MOD)%MOD << endl;
| ^~~~~
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
302 | empty(initializer_list<_Tp> __il) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
292 | empty(const _Tp (&)[_Nm]) noexcept
| ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note: 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
282 | empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
| ^~~~~
a.cc:5:5: note: 'long long int empty [1000]'
5 | int empty[1000];
| ^~~~~
|
s754609626 | p00304 | C++ | #include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<cstdlib>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rrep1(i,n) for(int i=n;i>=1;i--)
#define pb push_back
vector<int> ch[1001];
int N;
const int mod=1000000007;
struct node{
int type;
int op;
};
int ans;
node d[1001];
int dp[1001];
bool used[1001];
string s;
int cnt=0;
int dfs(int v){
if(dp[v]>=0) return dp[v];
int res=0;
if(ch[v].size()==0) res=1;
else if(d[v].type==0){
res=1;
rep(i,ch[v].size()){
res*=dfs(ch[v][i]);
res%=mod;
}
}
else if(d[v].type==1){
res=0;
rep(i,ch[v].size()){
res+= dfs(ch[v][i])
res%=mod;
}
}
else if(d[v].type==2){
res=0;
int k=ch[v].size();
for(int s=1;s< (1<<k); s++){
int sub=1;
rep(i,k){
if((s>>i) &1) sub*= dfs(ch[v][i]) ;
}
res+=sub;
res%=mod;
}
}
if(d[v].op==1) res++;
return dp[v]=(res%mod);
}
int main()
{
memset(dp,-1,sizeof(dp));
cin>>N;
rep(i,N){
cin>>s;
d[i].type=d[i].op=0;
if(s[0]=='A'){
d[i].type=1;
}
else if(s[0]=='R'){
d[i].type=2;
}
else if(s[0]=='E'){
d[i].type=0;
}
if(s.size()>=2){
d[i].op=1;
}
}
int x,y;
rep(i,N-1){
cin>>x>>y;
x--; y--;
ch[x].pb(y);
}
cout<< dfs(0)%mod <<endl;
} | a.cc: In function 'int dfs(int)':
a.cc:48:44: error: expected ';' before 'res'
48 | res+= dfs(ch[v][i])
| ^
| ;
49 | res%=mod;
| ~~~
|
s220748150 | p00304 | C++ | #include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<cstdlib>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rrep1(i,n) for(int i=n;i>=1;i--)
#define pb push_back
vector<int> ch[10001];
int N;
const int mod=1000000007;
struct node{
int type;
int op;
};
int ans;
node d[10001];
int dp[10001];
bool used[10001];
string s;
int cnt=0;
int dfs(int v){
if(dp[v]>=0) return dp[v];
int res=0;
if(ch[v].size()==0) res=1;
else if(d[v].type==0){
res=1;
rep(i,ch[v].size()){
res*=dfs(ch[v][i]);
res%=mod;
}
}
else if(d[v].type==1){
res=0;
rep(i,ch[v].size()){
res+= dfs(ch[v][i]);
res%=mod;
}
}
int sub;
else if(d[v].type==2){
res=0;
int k=ch[v].size();
for(int s=1;s< (1<<k); s++){
sub=1;
rep(i,k){
if( (s>>i) &1 ) sub*= dfs(ch[v][i]) ;
sub%=mod;
}
res+=sub;
res%=mod;
}
}
if(d[v].op==1) res++;
return dp[v]=(res%mod);
}
int main()
{
memset(dp,-1,sizeof(dp));
cin>>N;
rep(i,N){
cin>>s;
d[i].type=d[i].op=0;
if(s[0]=='A'){
d[i].type=1;
}
else if(s[0]=='R'){
d[i].type=2;
}
else if(s[0]=='E'){
d[i].type=0;
}
if(s.size()>=2){
d[i].op=1;
}
}
int x,y;
rep(i,N-1){
cin>>x>>y;
x--; y--;
ch[x].pb(y);
}
cout<< dfs(0)%mod <<endl;
} | a.cc: In function 'int dfs(int)':
a.cc:53:9: error: 'else' without a previous 'if'
53 | else if(d[v].type==2){
| ^~~~
|
s098546123 | p00305 | Java | public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
int N = 300;
int n = scan.nextInt();
int[][] p = new int[N+1][N+1];
int[][] sp = new int[N+1][N+1];
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
p[i][j] = scan.nextInt();
}
}
int max = 0;
for (int x = 1; x <= n; x++) {
for (int y = 1; y <= n; y++) {
for (int i = x; i <= n; i ++) {
for (int j = y; j <= n; j++) {
sp[i][j] = sp[i-1][j] + sp[i][j-1] + p[i][j] - sp[i-1][j-1];
if (sp[i][j] > max) {
max = sp[i][j];
}
}
}
for (int i = x; i <= n; i ++) {
for (int j = y; j <= n; j++) {
sp[i][j] = 0;
}
}
}
}
System.out.println(max);
scan.close();
}
} | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s613439952 | p00305 | Java | public class Main {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
int N = 300;
int n = scan.nextInt();
int[][] p = new int[N+1][N+1];
int[][] sp = new int[N+1][N+1];
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
p[i][j] = scan.nextInt();
}
}
int max = 0;
for (int x = 1; x <= 1; x++) {
for (int y = 1; y <= 1; y++) {
for (int i = x; i <= 4; i ++) {
for (int j = y; j <= 4; j++) {
if(i <3 || j < 3) {
sp[i][j] = sp[i-1][j] + sp[i][j-1] + p[i][j] - sp[i-1][j-1];
} else {
sp[i][j] = sp[i-1][j] + sp[i][j-1] + p[i][j] - sp[i-1][j-1] - p[i-1][j-1];
}
if (sp[i][j] > max) {
max = sp[i][j];
}
}
}
for (int i = 0; i <= n; i ++) {
for (int j = 0; j <= n; j++) {
sp[i][j] = 0;
}
}
}
}
System.out.println(max);
scan.close();
}
} | Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s511972656 | p00305 | Java | import java.util.Scanner;
public class Main {
static int[][] t;
static int[][] u;
static int n;
public static void main (String[] args) {
int N =300;
t = new int[N+1][N+1];
u = new int[N+1][N+1];
Scanner scan = new Scanner(System.in);
n =scan.nextInt();
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
t[i][j] = scan.nextInt();
u[i][j]=t[i][j]+u[i-1][j]+u[i][j-1]-u[i-1][j-1];
}
}
int ans=-10000;
for(int i=1;i<=n;i++){
for(int j=i;j<=n;j++){
if(ans > calc(i,j))
ans= calc(i,j);
}
}
}
static int sum(int ai,int aj,int bi,int bj){
ai--;
aj--;
return u[bi][bj]-u[ai][bj]-u[bi][aj]+u[ai][aj];
}
static int calc(int ah,int bh){
int res=-100000;
int maxm=0;
for(int i=1;i<=n;i++){
if (res < maxm+sum(ah,i,bh,i)) {
res = maxm+sum(ah,i,bh,i);
}
int d=t[ah][i]+t[bh][i];
if(ah==bh)d/=2;
if( maxm + d < sum(ah,i,bh,i) ) {
maxm=sum(ah,i,bh,i);
}else {
maxm = maxm + d;
}
}
return res; | Main.java:49: error: reached end of file while parsing
return res;
^
1 error
|
s054764517 | p00305 | C++ | #include <algorithm>
#include <iostream>
#include <queue>
#define N 300
using namespace std;
typedef pair<int,int> P;
int n,p[N][N],s,ans,a1,a2,b1,b2,d[N][N];
priority_queue<P> A,B;
int main(){
cin>>n;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++) cin>>p[i][j];
for(int i=0;i<n;i++){
s=0;
for(int j=0;j<n;j++) s+=p[j][i];
A.push(P(s,i));
}
for(int i=0;i<n;i++){
s=0;
for(int j=0;j<n;j++) s+=p[i][j];
B.push(P(s,i));
}
P t=A.top(); A.pop();
a1=t.second;
t=A.top(); A.pop();
a2=t.second;
t=B.top(); B.pop();
b1=t.second;
t=B.top(); B.pop();
b2=t.second;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++) d[i][j]=p[i][j];
for(int i=0;i<n;i++)
for(int j=1;j<n;j++) d[i][j]=d[i][j-1]+p[i][j];
for(int i=1;i<n;i++)
for(int j=0;j<n;j++) d[i][j]=d[i-1][j]+d[i][j];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
for(int k=i;k<n;k++){
for(int l=j;l<n;l++){
//if(!(a1==j||a2==j||a1==l||a2==l||b1==i||b2==i||b1==k||b2==k)) continue;
int sum=d[k][l],sum2=0;
if(i&&j) sum=sum-d[i-1][l]-d[k][j-1]+d[i-1][j-1];
else if(i) sum=sum-d[i-1][l];
else if(j) sum=sum-d[k][j-1];
if(i+1&&j+1) sum2=d[k-1][l-1]-d[i][l-1]-d[k-1][j]+d[i][j];
else if(i+1) sum2=d[k-1][l-1]-d[i][l-1];
else if(j+1) sum2=d[k-1][l-1]-d[k-1][j];
ans=max(ans,sum-sum2);
}else ans=max(ans,sum);
}
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:51:12: error: 'else' without a previous 'if'
51 | }else ans=max(ans,sum);
| ^~~~
a.cc:51:29: error: 'sum' was not declared in this scope
51 | }else ans=max(ans,sum);
| ^~~
a.cc: At global scope:
a.cc:56:3: error: 'cout' does not name a type
56 | cout<<ans<<endl;
| ^~~~
a.cc:57:3: error: expected unqualified-id before 'return'
57 | return 0;
| ^~~~~~
a.cc:58:1: error: expected declaration before '}' token
58 | }
| ^
|
s929723392 | p00305 | C++ | #include <algorithm>
#include <iostream>
#define N 310
#define INF (1e9)
#define make make_pair
using namespace std;
typedef pair<int,int> P;
int n,p[N][N],ans,d[N][N];
P c[N][N];
int main(){
cin>>n;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) cin>>p[i][j];
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=p[i][j];
for(int i=1;i<=n;i++)
for(int j=2;j<=n;j++) d[i][j]=d[i][j-1]+p[i][j];
for(int i=2;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=d[i-1][j]+d[i][j];
ans=-INF;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) c[i][j]=P(-1,-INF);
for(int k=1;k<=n;k++){
for(int l=k+1;l<=n;l++){
for(int i=1;i<=n;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
if(c[k][l].second<sum-sum2) c[k][l]=P(i,sum-sum2);
}
}
}
for(int k=1;k<=n;k++){
for(int l=k+1;l<=n;l++){
int j=c[k][l].first;
for(int i=1;i<c[k][l].first;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
ans=max(ans,sum-sum2);
}
for(int i=j;i<=n;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
ans=max(ans,sum-sum2);
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:28:19: error: 'j' was not declared in this scope
28 | int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
| ^
a.cc:29:28: error: 'sum2' was not declared in this scope; did you mean 'sum'?
29 | if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
| ^~~~
| sum
a.cc:30:31: error: 'sum2' was not declared in this scope; did you mean 'sum'?
30 | if(c[k][l].second<sum-sum2) c[k][l]=P(i,sum-sum2);
| ^~~~
| sum
|
s200133251 | p00305 | C++ | #include <algorithm>
#include <iostream>
#define N 310
#define INF (1e9)
#define make make_pair
using namespace std;
typedef pair<int,int> P;
int n,p[N][N],ans,d[N][N];
P c[N][N];
int main(){
cin>>n;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) cin>>p[i][j];
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=p[i][j];
for(int i=1;i<=n;i++)
for(int j=2;j<=n;j++) d[i][j]=d[i][j-1]+p[i][j];
for(int i=2;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=d[i-1][j]+d[i][j];
ans=-INF;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) c[i][j]=P(1,-INF);
for(int k=1;k<=n;k++){
for(int l=k+1;l<=n;l++){
for(int i=c[k][l];i<=n;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
if(c[k][l].second<sum-sum2) c[k][l]=P(i,sum-sum2);
}
}
}
for(int k=1;k<=n;k++){
for(int l=k+1;l<=n;l++){
int j=c[k][l].first;
for(int i=1;i<c[k][l].first;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
ans=max(ans,sum-sum2);
}
for(int i=j;i<=n;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
ans=max(ans,sum-sum2);
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:27:23: error: cannot convert 'P' {aka 'std::pair<int, int>'} to 'int' in initialization
27 | for(int i=c[k][l];i<=n;i++){
| ~~~~~~^
| |
| P {aka std::pair<int, int>}
a.cc:28:19: error: 'j' was not declared in this scope
28 | int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
| ^
a.cc:29:28: error: 'sum2' was not declared in this scope; did you mean 'sum'?
29 | if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
| ^~~~
| sum
a.cc:30:31: error: 'sum2' was not declared in this scope; did you mean 'sum'?
30 | if(c[k][l].second<sum-sum2) c[k][l]=P(i,sum-sum2);
| ^~~~
| sum
|
s727673927 | p00305 | C++ | #include <algorithm>
#include <iostream>
#define N 310
#define INF (1e9)
using namespace std;
int n,p[N][N],ans,c,ma,d[N][N];
int main(){
cin>>n;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) cin>>p[i][j];
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=p[i][j];
for(int i=1;i<=n;i++)
for(int j=2;j<=n;j++) d[i][j]=d[i][j-1]+p[i][j];
for(int i=2;i<=n;i++)
for(int j=1;j<=n;j++) d[i][j]=d[i-1][j]+d[i][j];
ans=-INF;
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++) c[i][j]=P(1,-INF);
for(int k=1;k<=n;k++){
for(int l=k+1;l<=n;l++){
c=1;
ma=-INF;
for(int i=c;i<=n;i++){
int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
if(ma<sum-sum2) ma=sum-sum2,c=i;
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:20:28: error: invalid types 'int[int]' for array subscript
20 | for(int j=1;j<=n;j++) c[i][j]=P(1,-INF);
| ^
a.cc:20:35: error: 'P' was not declared in this scope
20 | for(int j=1;j<=n;j++) c[i][j]=P(1,-INF);
| ^
a.cc:26:19: error: 'j' was not declared in this scope
26 | int sum=d[j][l]-d[i-1][l]-d[j][k-1]+d[i-1][k-1],sum2=0;
| ^
a.cc:27:28: error: 'sum2' was not declared in this scope; did you mean 'sum'?
27 | if(j-i>=2&&l-k>=2) sum2=d[j-1][l-1]-d[i][l-1]-d[j-1][k]+d[i][k];
| ^~~~
| sum
a.cc:28:19: error: 'sum2' was not declared in this scope; did you mean 'sum'?
28 | if(ma<sum-sum2) ma=sum-sum2,c=i;
| ^~~~
| sum
|
s014286626 | p00305 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define PB push_back
#define MOD 1000000007LL
typedef long long ll;
int a[321][321];
int sm[321][321];
int cnt(int a, int b, int c, int d){
return sm[c][d]-sm[a][d]-sm[c][b]+sm[a][b];
}
inline gt(int i, int j, int k, int l){
int a = cnt(i, k, j, l), b = 0;
if(j-i>=3 && l-k>=3){
b = cnt(i+1, k+1, j-1, l-1);
// printf("*");
}
return a-b;
}
#define LAR(a, b) a=max(a, (b))
int main(){
int n;
scanf("%d", &n);
REP(i, n) REP(j, n) scanf("%d", a[i]+j);
REP(i, n) sm[i][0]=sm[0][i]=0;
REP(i, n){
REP(j, n){
sm[i+1][j+1]=sm[i][j+1]+sm[i+1][j]-sm[i][j]+a[i][j];
}
}
// REP(i, n+1){
// REP(j, n+1){
// printf("%d ", sm[i][j]);
// }
// printf("\n");
// }
int ans = 0;
REP(i, n){
FOR(j, i+1, n+1){
int nwsm = 0,
mxsm = 0,
mxid = 0;
REP(l, n+1){
LAR(ans, gt(i, j, l-1, l));
if(l>=3){
nwsm -= cnt(i, j, l-3, l-2);
if(j-i >= 3){
nwsm += cnt(i+1, j-1, l-2, l-1);
}
if(mxsm > nwsm){
mxid = l-2;
}
}
LAR(ans, gt(i, j, mxid, l));
}
}
}
printf("%d\n", ans);
} | a.cc:19:8: error: ISO C++ forbids declaration of 'gt' with no type [-fpermissive]
19 | inline gt(int i, int j, int k, int l){
| ^~
|
s344096520 | p00309 | C++ | #include <stdio.h>
#include <set>
#include <queue>
using namespace std;
const int MOD=1e9+7;
const int N=1e2+10;
int p[N];
int find(int n){
return p[n]==n?n:p[n]=find(p[n]);
}
struct side{
int from;
int to;
int length;
void in(){
scanf("%d%d%d",&from,&to,&length);
return ;
}
void pull(){
from=find(from);
to=find(to);
return ;
}
bool out(){
return from==to;
}
void operator =(side a){
from=a.from;
to=a.to;
length=a.length;
return ;
}
};
struct cmp{
bool operator ()(const side& a,const side& b){
return a.length>b.length;
}
};
set<int> graph[N],ng[N],ins;
int n,size[N],ns=0;
long long int ans=0;
void dfs(int now){
if(now>n){
if(!ins.empty()){
queue<int> q;
set<int> in=ins;
int temp;
q.push(*in.begin());
in.erase(in.begin());
while(!q.empty()){
temp=q.front();
q.pop();
for(int i:ng[temp]){
if(in.find(i)!=in.end()){
in.erase(i);
q.push(i);
}
}
}
if(in.empty()){
for(int i=1;i<=n;i++)if(p[i]==i&&ins.find(i)==ins.end())in.insert(i);
if(!in.empty()){
q.push(*in.begin());
in.erase(in.begin());
while(!q.empty()){
temp=q.front();
q.pop();
for(int i:ng[temp]){
if(in.find(i)!=in.end()){
in.erase(i);
q.push(i);
}
}
}
if(in.empty()){
ans+=ns*(n-ns);
ans%=MOD;
}
}
}
}
return ;
}
if(p[now]==now){
ins.insert(now);
ns+=size[now];
dfs(now+1);
ins.erase(now);
ns-=size[now];
}
dfs(now+1);
return ;
}
long long int pow(int a,int t){
if(t==0)return 1;
long long int temp=pow(a,t/2);
temp*=temp;
temp%=MOD;
if(t&1){
temp*=a;
temp%=MOD:
}
return temp;
}
long long int rev(int a){
return pow(a,MOD-2);
}
int main(){
int m,now,in,l,r;
side temp,s[N*N];
priority_queue<side,vector<side>,cmp> pq;
scanf("%d%d",&n,&m);
in=n;
for(int i=1;i<=n;i++)p[i]=i;
for(int i=0;i<m;i++){
temp.in();
s[i]=temp;
graph[temp.from].insert(temp.to);
graph[temp.to].insert(temp.from);
pq.push(temp);
}
now=pq.top().length;
while(in>1){
temp=pq.top();
now=temp.length;
pq.pop();
temp.pull();
if(!temp.out()){
p[temp.from]=temp.to;
in--;
}
while(!pq.empty()){
if(pq.top().length<=now){
temp=pq.top();
pq.pop();
temp.pull();
if(!temp.out()){
p[temp.from]=temp.to;
in--;
}
}
else break;
}
}
for(int i=1;i<=n;i++){
p[i]=i;
size[i]=0;
}
for(int i=0;i<m;i++)if(s[i].length<now){
s[i].pull();
p[s[i].from]=s[i].to;
}
for(int i=1;i<=n;i++){
l=find(i);
size[l]++;
for(int j:graph[i]){
r=find(j);
if(l!=r){
ng[l].insert(r);
ng[r].insert(l);
}
}
}
dfs(1);
if(n==100){
ans*=rev(2);
ans%=MOD;
}
printf("%d %lld\n",now,ans);
}
| a.cc: In function 'void dfs(int)':
a.cc:86:13: error: reference to 'size' is ambiguous
86 | ns+=size[now];
| ^~~~
In file included from /usr/include/c++/14/set:65,
from a.cc:2:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:40:7: note: 'int size [110]'
40 | int n,size[N],ns=0;
| ^~~~
a.cc:89:13: error: reference to 'size' is ambiguous
89 | ns-=size[now];
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:40:7: note: 'int size [110]'
40 | int n,size[N],ns=0;
| ^~~~
a.cc: In function 'long long int pow(int, int)':
a.cc:101:18: error: expected ';' before ':' token
101 | temp%=MOD:
| ^
| ;
a.cc: In function 'int main()':
a.cc:148:9: error: reference to 'size' is ambiguous
148 | size[i]=0;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:40:7: note: 'int size [110]'
40 | int n,size[N],ns=0;
| ^~~~
a.cc:156:9: error: reference to 'size' is ambiguous
156 | size[l]++;
| ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
272 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
262 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
a.cc:40:7: note: 'int size [110]'
40 | int n,size[N],ns=0;
| ^~~~
|
s809474662 | p00310 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import static java.lang.Integer.parseInt;
/**
* The Number of Participants
*/
public class P0315 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
String[] words;
int p, m, c;
StringTokenizer st = new StringTokenizer(br.readLine());
p = parseInt(st.nextToken());
m = parseInt(st.nextToken());
c = parseInt(st.nextToken());
System.out.println(p + m + c);
}
} | Main.java:11: error: class P0315 is public, should be declared in a file named P0315.java
public class P0315 {
^
1 error
|
s698906690 | p00310 | C | #include<stdio.h>
int main(void){
int p,m,c;
scanf("%d %d %d",&p,&m,&c);
printf("%d\n",a+m+c);
return 0;
}
| main.c: In function 'main':
main.c:9:15: error: 'a' undeclared (first use in this function)
9 | printf("%d\n",a+m+c);
| ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
|
s011132806 | p00310 | C | #include<stdio.h>
imt main()
{
int p,m,c;
scanf("%d %d %d",&p,&m,&c);
printf("%d\n",p+m+c);
return 0;
} | main.c:3:1: error: unknown type name 'imt'; did you mean 'int'?
3 | imt main()
| ^~~
| int
|
s488698287 | p00310 | C | #include<stdio.h>
imt main()
{
int p,m,c;
scanf("%d %d %d",&p,&m,&c);
printf("%d\n",p+m+c);
return 0;
} | main.c:3:1: error: unknown type name 'imt'; did you mean 'int'?
3 | imt main()
| ^~~
| int
|
s906173325 | p00310 | C++ | #include<stdio.h>
int main(){
int p,m,c;
scanf("%d %d %d",&p,&m&c);
printf("%d",p+m+c);
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:27: error: invalid operands of types 'int*' and 'int' to binary 'operator&'
4 | scanf("%d %d %d",&p,&m&c);
| ~~^~
| | |
| | int
| int*
|
s775299152 | p00310 | 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
| |
s357039132 | p00310 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
typedef pair<int, int>pi;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
typedef pair<P, P> PPP;
const ll MOD = 1e9 + 7;
const ll INF = 9e18;
const double DINF = 5e14;
const double eps = 1e-10;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second
int a, b, c;
int main() {
cin >> a >> b > c;
cout << a + b + c << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:23: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
28 | cin >> a >> b > c;
| ~~~~~~~~~~~~~ ^ ~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:28:23: note: candidate: 'operator>(int, int)' (built-in)
28 | cin >> a >> b > c;
| ~~~~~~~~~~~~~~^~~
a.cc:28:23: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
28 | cin >> a >> b > c;
| ^
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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
28 | cin >> a >> b > c;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
28 | cin >> a >> b > c;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
28 | cin >> a >> b > c;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:28:25: note: mismatched types 'std::basic_string |
s541976509 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int p,m,c;
cin>>p>>m>>c;
cout<<p+m+c<<endl:
}
| a.cc: In function 'int main()':
a.cc:6:21: error: expected ';' before ':' token
6 | cout<<p+m+c<<endl:
| ^
| ;
|
s369569364 | p00310 | C++ | #include<iostream>
using namespace std;
int main() {
int p, m, c, ans;
cin >> p >> m >> c;
/* 参加人数の計算 */
ans = p + m + c; /* 参加人数 = プログラム人数 + モバイル人数 + CG人数 */
cout << ans << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:14:18: error: expected '}' at end of input
14 | return 0;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s987972511 | p00310 | 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
| |
s737946779 | p00310 | 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
| |
s586722830 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int p,m,c;
cout >> p+m+c >> endl;
}
| a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
7 | cout >> p+m+c >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:7:8: note: candidate: 'operator>>(int, int)' (built-in)
7 | cout >> p+m+c >> endl;
| ~~~~~^~~~~~~~
a.cc:7:8: 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >> p+m+c >> 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:7:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >> p+m+c >> 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:7:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
7 | cout >> p+m+c >> 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 = int]':
a.cc:7:15: required from here
7 | cout >> p+m+c >> 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)
| ^~~~~~~~
|
s488089557 | p00310 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, c;
cin a >> b >> c;
int m;
m = a+b+c;
cout << m << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:8: error: expected ';' before 'a'
5 | cin a >> b >> c;
| ^~
| ;
|
s237226499 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int p,m,c;
cin >> p >> m >> c;
cout >> p+m+c >> endl;
}
| a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
8 | cout >> p+m+c >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:8:8: note: candidate: 'operator>>(int, int)' (built-in)
8 | cout >> p+m+c >> endl;
| ~~~~~^~~~~~~~
a.cc:8:8: 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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 = int]':
a.cc:8:15: required from here
8 | cout >> p+m+c >> 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)
| ^~~~~~~~
|
s986595871 | p00310 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, c;
cin a >> b >> c;
int m;
m = a+b+c;
cout << m << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:8: error: expected ';' before 'a'
5 | cin a >> b >> c;
| ^~
| ;
|
s691680495 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int p,m,c;
cin >> p >> m >> c;
cout >> p+m+c >> endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
8 | cout >> p+m+c >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:8:8: note: candidate: 'operator>>(int, int)' (built-in)
8 | cout >> p+m+c >> endl;
| ~~~~~^~~~~~~~
a.cc:8:8: 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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:8:15: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
8 | cout >> p+m+c >> 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 = int]':
a.cc:8:15: required from here
8 | cout >> p+m+c >> 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)
| ^~~~~~~~
|
s241451133 | p00310 | C++ | #include<iostream>
using namespace std;
int main() {
int ; a, b, c;
cin a >> b >> c;
int m;
m = a+b+c;
cout << m << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:5: error: declaration does not declare anything [-fpermissive]
4 | int ; a, b, c;
| ^~~
a.cc:4:11: error: 'a' was not declared in this scope
4 | int ; a, b, c;
| ^
a.cc:4:14: error: 'b' was not declared in this scope
4 | int ; a, b, c;
| ^
a.cc:4:17: error: 'c' was not declared in this scope
4 | int ; a, b, c;
| ^
a.cc:5:8: error: expected ';' before 'a'
5 | cin a >> b >> c;
| ^~
| ;
|
s315271139 | p00310 | C++ | #include<iostream>
using namespace std;
int main() {
int a,b,c;
cin a >> b >> c;
int m;
m = a+b+c;
cout << m << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:8: error: expected ';' before 'a'
5 | cin a >> b >> c;
| ^~
| ;
|
s580452149 | p00310 | C++ | #include<iostream>
#include<string>
int main(){
string x;
int n =x.size();
int i;
for(i=0;i<n;i++){
cin >> str[i];
}
for (i=n;i>0;i--){
cout << str[i] << endl;
}return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string x;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:10: error: 'x' was not declared in this scope
6 | int n =x.size();
| ^
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> str[i];
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:12: error: 'str' was not declared in this scope; did you mean 'std'?
9 | cin >> str[i];
| ^~~
| std
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << str[i] << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:13: error: 'str' was not declared in this scope; did you mean 'std'?
12 | cout << str[i] << endl;
| ^~~
| std
a.cc:12:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << str[i] << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s274401091 | p00310 | C++ | #include<iostream>
using namespace std;
int main(){
int p;
int m;
int c;
cin >> p >> m >> c ;
cout << p + m + c endl;
return0;
}
| a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before 'endl'
10 | cout << p + m + c endl;
| ^~~~~
| ;
a.cc:12:2: error: 'return0' was not declared in this scope
12 | return0;
| ^~~~~~~
|
s330588029 | p00310 | C++ | #include<iostream>
#include<string>
int main(){
string x;
int n =x.size();
int i;
for(i=0;i<n;i++){
cin >> str[i];
}
for (i=n;i>0;i--){
cout << str[i] << endl;
}return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
5 | string x;
| ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:10: error: 'x' was not declared in this scope
6 | int n =x.size();
| ^
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> str[i];
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:12: error: 'str' was not declared in this scope; did you mean 'std'?
9 | cin >> str[i];
| ^~~
| std
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << str[i] << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:13: error: 'str' was not declared in this scope; did you mean 'std'?
12 | cout << str[i] << endl;
| ^~~
| std
a.cc:12:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << str[i] << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s243747516 | p00310 | C++ | #include<iostream>
using namespace std;
int main(){
int p, m, c;
cin >> p >> m >> c ;
cout << p + m + c endl;
return0;
}
| a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'endl'
8 | cout << p + m + c endl;
| ^~~~~
| ;
a.cc:10:2: error: 'return0' was not declared in this scope
10 | return0;
| ^~~~~~~
|
s043329278 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, c
cin >> a >> b >> c;
c = a + b + c;
cout << c << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
6 | cin >> a >> b >> c;
| ^~~
a.cc:7:3: error: 'c' was not declared in this scope
7 | c = a + b + c;
| ^
|
s251525550 | p00310 | C++ | #include <iostream>
using namespace std;
int main(){
int p, m, c
cin >> p >> m >> c;
c = p + m + c;
cout << c << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
6 | cin >> p >> m >> c;
| ^~~
a.cc:7:3: error: 'c' was not declared in this scope
7 | c = p + m + c;
| ^
|
s432383594 | p00310 | C++ | #include<iostream>
using namespace std;
int main()
{
int p,m,i;
cin >> p >> m >> i;
cout << p+m+i <<< endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before '<' token
7 | cout << p+m+i <<< endl;
| ^
|
s943212554 | p00310 | C++ | #include<iostream>
using namespace std;
int main()
{
int p,m,i;
cin >> p >> m >> i;
cout << p+m+i <<< endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before '<' token
7 | cout << p+m+i <<< endl;
| ^
|
s366433549 | p00310 | C++ | #include <bits/stdc++.h>
using namespace std;
int p, m, c;
int main()
{
cin >> n >> m >> c;
cout << n + m + c << endl;
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'n' was not declared in this scope; did you mean 'yn'?
6 | cin >> n >> m >> c;
| ^
| yn
|
s787357709 | p00310 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
int main(void){
int p,m,c,ans;
cin >> p >> m >> c >>endl;
ans = p + c + m;
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:29: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
6 | cin >> p >> m >> c >>endl;
| ~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:42,
from a.cc:2:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __s |
s489157197 | p00310 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
} | a.cc:10:3: error: 'cin' does not name a type
10 | cin>>a>>b>>c;
| ^~~
a.cc:11:3: error: 'cout' does not name a type
11 | cout<<a+b+c<<endl;
| ^~~~
a.cc:12:3: error: expected unqualified-id before 'return'
12 | return 0;
| ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s197216696 | p00310 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
} | a.cc:10:3: error: 'cin' does not name a type
10 | cin>>a>>b>>c;
| ^~~
a.cc:11:3: error: 'cout' does not name a type
11 | cout<<a+b+c<<endl;
| ^~~~
a.cc:12:3: error: expected unqualified-id before 'return'
12 | return 0;
| ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s537300681 | p00310 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
} | a.cc:10:3: error: 'cin' does not name a type
10 | cin>>a>>b>>c;
| ^~~
a.cc:11:3: error: 'cout' does not name a type
11 | cout<<a+b+c<<endl;
| ^~~~
a.cc:12:3: error: expected unqualified-id before 'return'
12 | return 0;
| ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s661006528 | p00310 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
} | a.cc:10:3: error: 'cin' does not name a type
10 | cin>>a>>b>>c;
| ^~~
a.cc:11:3: error: 'cout' does not name a type
11 | cout<<a+b+c<<endl;
| ^~~~
a.cc:12:3: error: expected unqualified-id before 'return'
12 | return 0;
| ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s740558564 | p00310 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
} | a.cc:10:3: error: 'cin' does not name a type
10 | cin>>a>>b>>c;
| ^~~
a.cc:11:3: error: 'cout' does not name a type
11 | cout<<a+b+c<<endl;
| ^~~~
a.cc:12:3: error: expected unqualified-id before 'return'
12 | return 0;
| ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s721197079 | p00310 | C++ | #include <stdio.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
int main(void) {
int n, ans = 0, i;
rep(i, 3) {
scanf("%d", &n);
ans += m;
}
printf("%d\n", ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:12: error: 'm' was not declared in this scope
8 | ans += m;
| ^
|
s202899625 | p00310 | C++ | include <bits/stdc++.h>
using namespace std;
int main(){
int p,m,c;
cin>>p>>m>>c;
cout << p+m+c <<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin>>p>>m>>c;
| ^~~
a.cc:7:9: error: 'cout' was not declared in this scope
7 | cout << p+m+c <<endl;
| ^~~~
a.cc:7:25: error: 'endl' was not declared in this scope
7 | cout << p+m+c <<endl;
| ^~~~
|
s840580110 | p00310 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int p,m,c;
cin>>p>>m>>c
cout<<p+m+c<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:17: error: expected ';' before 'cout'
6 | cin>>p>>m>>c
| ^
| ;
7 | cout<<p+m+c<<endl;
| ~~~~
|
s373791192 | p00310 | C++ | #include <bits/stdc++.h>
using namespace std:
int main(){
int p,m,c;
cin>>p>>m>>c;
cout<<p + m + c<<endl;
return 0;
}
| a.cc:3:20: error: expected ';' before ':' token
3 | using namespace std:
| ^
| ;
a.cc:3:20: error: expected unqualified-id before ':' token
|
s466082648 | p00310 | C++ | #include <iostream>
using namespace std;
int main() {
int p, m, c; cin << p << m << c;
cout << p + m + c << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:26: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
5 | int p, m, c; cin << p << m << c;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:5:26: note: candidate: 'operator<<(int, int)' (built-in)
5 | int p, m, c; cin << p << m << c;
| ~~~~^~~~
a.cc:5:26: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
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:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:5:22: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
5 | int p, m, c; cin << p << m << c;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:5:29: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:5:22: required from here
5 | int p, m, c; cin << p << m << c;
| ^
/usr/include/c++/14/ |
s736653350 | p00311 | C | #include <stdio.h>
int main(void)
{
int ha,hb,ka,kb,a,b,c,d,ht,kt;
scanf("%d %d",&ha,&hb);
scanf("%d %d",&ka,&kb);
scanf("%d %d %d %d",&a,&b,&c,&d);
ht=ha*a+hb*b;
if(ha<=10)
ht+=(ha/10)*c;
if(hb<=20)
ht+=(hb/20)*d;
kt=ka*a+kb*b;
if(ka<=10)
kt+=(ka/10)*c;
if(kb<=20)
kt+=(kb/20)*d;
if(ht>kt)
printf("hiroshi\n");
if(kt>ht)
printf("kenjiro\n");
if(kt==ht)
printf("even");
}
}
| main.c:25:1: error: expected identifier or '(' before '}' token
25 | }
| ^
|
s044234695 | p00311 | 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
| |
s225152935 | p00311 | 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
| |
s733084240 | p00311 | C | #include<stdio.h>
int main(void)
{
int h1,h2,k1,k2,a,b,c,d,f,g;
scanf("%d%d%d%d%d%d%d%d",&h1,&h2,&k1,&k2,&a,&b,&c,&d)+
f=a*h1+h1/10*c+b*h2+h2/20*d;
g=a*k1+k1/10*c+b*k2+k2/20*d;
if(f>g)
{
printf("hiroshi\n");
}
else if(f<g)
{
printf("kenjiro\n");
}
else
{
printf("even\n");
}
return 0;
} | main.c: In function 'main':
main.c:6:10: error: lvalue required as left operand of assignment
6 | f=a*h1+h1/10*c+b*h2+h2/20*d;
| ^
|
s767365718 | p00311 | C | #include <stdio.h>
int main(){
int k1,k2,h1,h2,a,b,c,d,x,y;
scanf("%d%d",&h1,&h2);
scanf("%d%d",&k1,&k2);
scanf("%d%d%d%d",&a,&b,&c,&d);
x=((h1*a)+(h1/10*c))+((h2*b)+(h2/20*d));
y=((k1*a)+(k1/10*c))+((k2*b)+(k2/20*d))
if(x>y){
printf("hiroshi\n");
}else if(x<y){
printf("kenjiro\n");
}else{
printf("even\n");
}
return 0;
} | main.c: In function 'main':
main.c:9:40: error: expected ';' before 'if'
9 | y=((k1*a)+(k1/10*c))+((k2*b)+(k2/20*d))
| ^
| ;
10 | if(x>y){
| ~~
|
s311654479 | p00311 | C | #include <stdio.h>
int main(void) {
int a[7];
int hiroshi,kenjiro;
int i;
for(i = 0;i <= 7;i++){
scanf("&d",&n);
}
hiroshi = a[0] * a[4] + (a[0] / 10) * a[6] + a[1] * a[5] + (a[1] / 20) * a[7];
kenjiro = a[2] * a[4] + (a[2] / 10) * a[6] + a[3] * a[5] + (a[3] / 20) * a[7];
if(hiroshi = kenjiro){
printf("even\n");
} else if (hiroshi > kenjiro){
printf("hiroshi\n");
} else {
printf("kenjiro\n");
}
return 0;
}
//ko_i,ko_y,ke_i,ke_y,po_i,po_y,bo_i,bo_y; | main.c: In function 'main':
main.c:8:21: error: 'n' undeclared (first use in this function)
8 | scanf("&d",&n);
| ^
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
|
s603104848 | p00311 | C | #include<stdio.h>
int main(void)
{
????????int h1,h2,k1,k2,a,b,c,d,H,K;
????????scanf ("%d%d",&h1,&h2);
????????scanf ("%d%d",&k1,&k2);
????????scanf ("%d%d%d%d",&a,&b,&c,&d);
????????H=h1*a+h2*b+(h1/10)*c+(h2/20)*d;
????????K=k1*a+k2*b+(k1/10)*c+(k2/20)*d;
????????if (H>K)
????????printf ("hiroshi\n");
????????else if (H<K)
????????printf ("kenjiro\n");
????????else
????????printf ("even\n");
????????return 0;
} | main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
4 | ????????int h1,h2,k1,k2,a,b,c,d,H,K;
| ^
main.c:5:1: error: expected expression before '?' token
5 | ????????scanf ("%d%d",&h1,&h2);
| ^
main.c:5:24: error: 'h1' undeclared (first use in this function)
5 | ????????scanf ("%d%d",&h1,&h2);
| ^~
main.c:5:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:28: error: 'h2' undeclared (first use in this function)
5 | ????????scanf ("%d%d",&h1,&h2);
| ^~
main.c:6:1: error: expected expression before '?' token
6 | ????????scanf ("%d%d",&k1,&k2);
| ^
main.c:6:24: error: 'k1' undeclared (first use in this function)
6 | ????????scanf ("%d%d",&k1,&k2);
| ^~
main.c:6:28: error: 'k2' undeclared (first use in this function)
6 | ????????scanf ("%d%d",&k1,&k2);
| ^~
main.c:7:1: error: expected expression before '?' token
7 | ????????scanf ("%d%d%d%d",&a,&b,&c,&d);
| ^
main.c:7:28: error: 'a' undeclared (first use in this function)
7 | ????????scanf ("%d%d%d%d",&a,&b,&c,&d);
| ^
main.c:7:31: error: 'b' undeclared (first use in this function)
7 | ????????scanf ("%d%d%d%d",&a,&b,&c,&d);
| ^
main.c:7:34: error: 'c' undeclared (first use in this function)
7 | ????????scanf ("%d%d%d%d",&a,&b,&c,&d);
| ^
main.c:7:37: error: 'd' undeclared (first use in this function)
7 | ????????scanf ("%d%d%d%d",&a,&b,&c,&d);
| ^
main.c:8:1: error: expected expression before '?' token
8 | ????????H=h1*a+h2*b+(h1/10)*c+(h2/20)*d;
| ^
main.c:8:9: error: 'H' undeclared (first use in this function)
8 | ????????H=h1*a+h2*b+(h1/10)*c+(h2/20)*d;
| ^
main.c:9:1: error: expected expression before '?' token
9 | ????????K=k1*a+k2*b+(k1/10)*c+(k2/20)*d;
| ^
main.c:9:9: error: 'K' undeclared (first use in this function)
9 | ????????K=k1*a+k2*b+(k1/10)*c+(k2/20)*d;
| ^
main.c:10:1: error: expected expression before '?' token
10 | ????????if (H>K)
| ^
main.c:12:1: error: expected expression before '?' token
12 | ????????else if (H<K)
| ^
main.c:14:1: error: expected expression before '?' token
14 | ????????else
| ^
main.c:16:1: error: expected expression before '?' token
16 | ????????return 0;
| ^
|
s840206044 | p00311 | C | include<stdio.h>
int main(int argc, char const *argv[]) {
int h1,h2,k1,k2,a,b,c,d;
int m,n;
scanf("%d%d%d%d%d%d%d%d",&h1,&h2,&k1,&k2,&a,&b,&c,&d);
m = h1*a+h2*b+(h1/10)*c+(h2/20)*d;
n = k1*a+k2*b+(k1/10)*c+(k2/20)*d;
if (m > n) {
/* code */
printf("hiroshi\n");
} else if (m < n) {
/* code */
printf("kenjiro\n");
} else {
printf("even\n");
}
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s632951969 | p00311 | C++ | #include bits/stdc++.h>
using namespace std;
int main(){
int h,hh;
int k,kk;
int a,b,c,d;
cin>>h>>hh>>k>>kk;
cin>>a>>b>>c>>d;
int x=(a*h+c*(h/10))+(b*hh+d*(hh/10));
int y=(a*k+c*(k/10))+(b*kk+d*(kk/10));
if(x==y){
cout<<“even”<<endl;
}else if(x>y){
cout<<“hiroshi”<<endl;
}else{
cout<<“kenjiro”<<endl;
}
return 0;
}
| a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
1 | #include bits/stdc++.h>
| ^~~~
a.cc:12:15: error: extended character “ is not valid in an identifier
12 | cout<<“even”<<endl;
| ^
a.cc:12:15: error: extended character ” is not valid in an identifier
a.cc:14:15: error: extended character “ is not valid in an identifier
14 | cout<<“hiroshi”<<endl;
| ^
a.cc:14:15: error: extended character ” is not valid in an identifier
a.cc:16:15: error: extended character “ is not valid in an identifier
16 | cout<<“kenjiro”<<endl;
| ^
a.cc:16:15: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin>>h>>hh>>k>>kk;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #include bits/stdc++.h>
a.cc:12:9: error: 'cout' was not declared in this scope
12 | cout<<“even”<<endl;
| ^~~~
a.cc:12:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:15: error: '\U0000201ceven\U0000201d' was not declared in this scope
12 | cout<<“even”<<endl;
| ^~~~~~
a.cc:12:23: error: 'endl' was not declared in this scope
12 | cout<<“even”<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #include bits/stdc++.h>
a.cc:14:9: error: 'cout' was not declared in this scope
14 | cout<<“hiroshi”<<endl;
| ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:15: error: '\U0000201chiroshi\U0000201d' was not declared in this scope
14 | cout<<“hiroshi”<<endl;
| ^~~~~~~~~
a.cc:14:26: error: 'endl' was not declared in this scope
14 | cout<<“hiroshi”<<endl;
| ^~~~
a.cc:14:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:16:9: error: 'cout' was not declared in this scope
16 | cout<<“kenjiro”<<endl;
| ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:15: error: '\U0000201ckenjiro\U0000201d' was not declared in this scope
16 | cout<<“kenjiro”<<endl;
| ^~~~~~~~~
a.cc:16:26: error: 'endl' was not declared in this scope
16 | cout<<“kenjiro”<<endl;
| ^~~~
a.cc:16:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s726609275 | p00311 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int h,hh;
int k,kk;
int a,b,c,d;
cin>>h>>hh>>k>>kk;
cin>>a>>b>>c>>d;
int x=(a*h+c*(h/10))+(b*hh+d*(hh/10));
int y=(a*k+c*(k/10))+(b*kk+d*(kk/10));
if(x==y){
cout<<“even”<<endl;
}else if(x>y){
cout<<“hiroshi”<<endl;
}else{
cout<<“kenjiro”<<endl;
}
return 0;
}
| a.cc:12:15: error: extended character “ is not valid in an identifier
12 | cout<<“even”<<endl;
| ^
a.cc:12:15: error: extended character ” is not valid in an identifier
a.cc:14:15: error: extended character “ is not valid in an identifier
14 | cout<<“hiroshi”<<endl;
| ^
a.cc:14:15: error: extended character ” is not valid in an identifier
a.cc:16:15: error: extended character “ is not valid in an identifier
16 | cout<<“kenjiro”<<endl;
| ^
a.cc:16:15: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:15: error: '\U0000201ceven\U0000201d' was not declared in this scope
12 | cout<<“even”<<endl;
| ^~~~~~
a.cc:14:15: error: '\U0000201chiroshi\U0000201d' was not declared in this scope
14 | cout<<“hiroshi”<<endl;
| ^~~~~~~~~
a.cc:16:15: error: '\U0000201ckenjiro\U0000201d' was not declared in this scope
16 | cout<<“kenjiro”<<endl;
| ^~~~~~~~~
|
s509191911 | p00311 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int h,hh;
int k,kk;
int a,b,c,d;
cin>>h>>hh>>k>>kk;
cin>>a>>b>>c>>d;
int x=(a*h+c*(h/10))+(b*hh+d*(hh/10));
int y=(a*k+c*(k/10))+(b*kk+d*(kk/10));
if(x==y){
cout<<“even”<<endl;
}else if(x>y){
cout<<“hiroshi”<<endl;
}else{
cout<<“kenjiro”<<endl;
}
return 0;
}
| a.cc:12:15: error: extended character “ is not valid in an identifier
12 | cout<<“even”<<endl;
| ^
a.cc:12:15: error: extended character ” is not valid in an identifier
a.cc:14:15: error: extended character “ is not valid in an identifier
14 | cout<<“hiroshi”<<endl;
| ^
a.cc:14:15: error: extended character ” is not valid in an identifier
a.cc:16:15: error: extended character “ is not valid in an identifier
16 | cout<<“kenjiro”<<endl;
| ^
a.cc:16:15: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:15: error: '\U0000201ceven\U0000201d' was not declared in this scope
12 | cout<<“even”<<endl;
| ^~~~~~
a.cc:14:15: error: '\U0000201chiroshi\U0000201d' was not declared in this scope
14 | cout<<“hiroshi”<<endl;
| ^~~~~~~~~
a.cc:16:15: error: '\U0000201ckenjiro\U0000201d' was not declared in this scope
16 | cout<<“kenjiro”<<endl;
| ^~~~~~~~~
|
s793342226 | p00311 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int h1, h2, k1, k2; cin >> h1 >> h2 >> k1 >> k2;
int a, b, c, d; cin >> a >> b >> c >> d;
auto calc = [&](int h, int k) {
int score = h * a + k * b;
score += c * (h / 10);
score += d * (k / 20);
fprintf(stderr, "score = %d\n", score);
return score;
};
int va = calc(h1, k1), vb = calc(h2, k2);
if(va == vb) cout << "even" << endl;
else if(va > vb) cout << "hiroshi" << endl;
else cout << "kenjiro" << endl;
return 0;
}
#error "a"
| a.cc:26:2: error: #error "a"
26 | #error "a"
| ^~~~~
|
s254550004 | p00311 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b, c, d; cin >> a >> b >> c >> d;
int e, f, g, h; cin >> e >> f >> g >> h;
int h = a*e + (a / 10)*g + b*f + (b / 10)*h;
int k = c*e + (c / 10)*g + d*f + (d / 10)*h;
if (h > k)cout << "hiroshi\n";
else if (h < k)cout << "kenjiro\n";
else cout << "even\n";
} | a.cc: In function 'int main()':
a.cc:6:13: error: redeclaration of 'int h'
6 | int h = a*e + (a / 10)*g + b*f + (b / 10)*h;
| ^
a.cc:5:22: note: 'int h' previously declared here
5 | int e, f, g, h; cin >> e >> f >> g >> h;
| ^
|
s748636508 | p00311 | C++ | #include <iostream>
using namespace std;
int main(){
int h1, h2, k1, k2, a, b, c, d, h, k;
cin >> h1 >> h2;
cin >> k1 >> k2;
cin >> a >> b >> c >> d;
h = h1*a + h1/10*c + h2*b + h2/10*d;
k = k1*a + k1/10*c + k2*b + k2/10*d;
if(hr > k){
cout << "hiroshi" << endl;
}
else if(k > hr){
cout << "Kenjiro" << endl;
}
else{
cout << "even" << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:8: error: 'hr' was not declared in this scope; did you mean 'h'?
13 | if(hr > k){
| ^~
| h
|
s496787785 | p00311 | C++ | #include <iostream>
using namespace std;
int main(){
int h1, h2, k1, k2, a, b, c, d, h, k;
cin >> h1 >> h2;
cin >> k1 >> k2;
cin >> a >> b >> c >> d;
h = h1*a + h1/10*c + h2*b + h2/10*d;
k = k1*a + k1/10*c + k2*b + k2/10*d;
if(hr > k){
cout << "hiroshi" << endl;
}
else if(k > hr){
cout << "Kenjiro" << endl;
}
else{
cout << "even" << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:8: error: 'hr' was not declared in this scope; did you mean 'h'?
13 | if(hr > k){
| ^~
| h
|
s026975733 | p00311 | C++ | #include <iostream>
using namespace std;
int main(){
int h1, h2, k1, k2, a, b, c, d, h, k;
cin >> h1 >> h2;
cin >> k1 >> k2;
cin >> a >> b >> c >> d;
h = h1*a + h1/10*c + h2*b + h2/10*d;
k = k1*a + k1/10*c + k2*b + k2/10*d;
if(hr > k){
cout << "hiroshi" << endl;
}
else if(k > hr){
cout << "Kenjiro" << endl;
}
else{
cout << "even" << endl;
}
} | a.cc: In function 'int main()':
a.cc:13:8: error: 'hr' was not declared in this scope; did you mean 'h'?
13 | if(hr > k){
| ^~
| h
|
s940592223 | p00311 | C++ | #include "bits/stdc++.h"/*????????¬(?¶??????????)*/
using namespace std;/*????????¬(?¶??????????)*/
int main()
{
int hh;
int hhh;
int kk;
int kkk;
int a;
int b;
int c;
int d;
cin >> hh >> hhh;
cin >> kk >> kkk;
cin >> a >> b >> c >> d;
cout << a + b + c << endl;
int hiro = (hh * a) + (hhh * b) +((hh / 10) * c) + ((hhh / 20) * d);
int kenji = (kk * a) + (kkk * b) +((kk / 10) * c) + ((kkk / 20) * d);
if(hiro > kenji) cout << hiroshi <<endl;
if(hiro < kenji) cout << kenjiro << endl;
if(hiro == kenji) cout << "even" <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:34: error: 'hiroshi' was not declared in this scope; did you mean 'hiro'?
22 | if(hiro > kenji) cout << hiroshi <<endl;
| ^~~~~~~
| hiro
a.cc:23:34: error: 'kenjiro' was not declared in this scope; did you mean 'kenji'?
23 | if(hiro < kenji) cout << kenjiro << endl;
| ^~~~~~~
| kenji
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.