submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s038987006 | p00513 | C++ | #include<iostream>
using namespace std;
bool f(long long a) {
if(a % 2 =v 0) return false;
for(long long i = 3; i *i <= a; i += 2)
if(a % i == 0) return false;
return true;
}
int main() {
int n;
cin >> n;
int res=0;
for(int i=0; i<n; i++) {
long long a;
cin a;
if(f2ga+1)) res++;
}
cout << res << endl;
return 0;
}
| a.cc: In function 'bool f(long long int)':
a.cc:4:13: error: 'v' was not declared in this scope
4 | if(a % 2 =v 0) return false;
| ^
a.cc:4:14: error: expected ')' before numeric constant
4 | if(a % 2 =v 0) return false;
| ~ ^~
| )
a.cc: In function 'int main()':
a.cc:16:8: error: expected ';' before 'a'
16 | cin a;
| ^~
| ;
a.cc:17:8: error: 'f2ga' was not declared in this scope
17 | if(f2ga+1)) res++;
| ^~~~
a.cc:17:15: error: expected primary-expression before ')' token
17 | if(f2ga+1)) res++;
| ^
|
s495725196 | p00513 | C++ | #include<iostream>
using namespace std;
bool f(long long a) {
if(a % 2 =v 0) return false;
for(long long i = 3; i *i <= a; i += 2)
if(a % i == 0) return false;
return true;
}
int main() {
int n;
cin >> n;
int res=0;
for(int i=0; i<n; i++j {
long long a;
cin a;
if(f(a*2+1)) res++;
}
cout << res << endl;
return 0;
}
| a.cc: In function 'bool f(long long int)':
a.cc:4:13: error: 'v' was not declared in this scope
4 | if(a % 2 =v 0) return false;
| ^
a.cc:4:14: error: expected ')' before numeric constant
4 | if(a % 2 =v 0) return false;
| ~ ^~
| )
a.cc: In function 'int main()':
a.cc:14:24: error: expected ')' before 'j'
14 | for(int i=0; i<n; i++j {
| ~ ^
| )
a.cc:14:24: error: 'j' was not declared in this scope
|
s805466416 | p00513 | C++ | #include<iostream>
using namespace std;
bool f(long long a) {
if(a % 2 =v 0) return false;
for(long long i = 3; i *i <= a; i += 2)
if(a % i == 0) return false;
return true;
}
int main() {
int n;
cin >> n;
int res=0;
for(int i=0; i<n; i++) {
long long a;
cin a;
if(f(a*2+1)) res++;
}
cout << res << endl;
return 0;
}
| a.cc: In function 'bool f(long long int)':
a.cc:4:13: error: 'v' was not declared in this scope
4 | if(a % 2 =v 0) return false;
| ^
a.cc:4:14: error: expected ')' before numeric constant
4 | if(a % 2 =v 0) return false;
| ~ ^~
| )
a.cc: In function 'int main()':
a.cc:16:8: error: expected ';' before 'a'
16 | cin a;
| ^~
| ;
|
s606674365 | p00513 | C++ | #include<iostream>
using namespace std;
bool f(long long a) {
if(a % 2 == 0) return false;
for(long long i = 3; i *i <= a; i += 2)
if(a % i == 0) return false;
return true;
}
int main() {
int n;
cin >> n;
int res=0;
for(int i=0; i<n; i++) {
long long a;
cin a;
if(f(a*2+1)) res++;
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:8: error: expected ';' before 'a'
16 | cin a;
| ^~
| ;
|
s576864104 | p00513 | C++ | #include<bits/stdc++.h>
using namespace std;
bool judge(long long int x,int n){
if((n-x)%(2*x+1)==0){return true;}
return false;
}
int main(){
int count=0;
int m;
cin>>m;
for(int t=0;t<m;t++){
int n;
cin>>n;
if(n==0){break;}
bool j=true;
for(int x=1;x*x<=n;x++){
if(judge(x,n)){j=false; break;}
}
if(j){count++;}
}
cout<<count<<endl;
retur
| a.cc: In function 'int main()':
a.cc:36:3: error: 'retur' was not declared in this scope
36 | retur
| ^~~~~
a.cc:36:8: error: expected '}' at end of input
36 | retur
| ^
a.cc:11:11: note: to match this '{'
11 | int main(){
| ^
|
s316951796 | p00513 | C++ | #include<bits/stdc++.h>
using namespace std;
bool judge(long long int x,int n){
if((n-x)%(2*x+1)==0){return true;}
return false;
}
int main(){
int count=0;
int m;
cin>>m;
for(int t=0;t<m;t++){
int n;
cin>>n;
if(n==0){break;}
bool j=true;
for(int x=1;x*x<=n;x++){
if(judge(x,n)){j=false; break;}
}
if(j){count++;}
}
cout<<count<<endl;
return 0;
| a.cc: In function 'int main()':
a.cc:36:12: error: expected '}' at end of input
36 | return 0;
| ^
a.cc:11:11: note: to match this '{'
11 | int main(){
| ^
|
s781879870 | p00514 | Java | import java.util.*;
import java.math.*;
import java.lang.*;
class Main{
static Scanner sc = new Scanner(System.in);
public static void main(String[] args){
int n=sc.nectInt();
int m=sc.nextInt();
int r=sc.nextInt();
r-=n*m;
if(r<0)System.out.println(0);
else {
BigInteger ans = new BigInteger("1");
for(int i=0;i<n-1;i++) {
ans=ans.multiply(BigInteger.valueOf(r+n-i-1))
.divide(BigInteger.valueOf(i+1));
}
System.out.println(ans);
}
}
} | Main.java:10: error: cannot find symbol
int n=sc.nectInt();
^
symbol: method nectInt()
location: variable sc of type Scanner
1 error
|
s241154671 | p00514 | C++ | def permutation(n,r)
result=1
for i in 0..r-1 do
result*=n-i
end
return result
end
def factorial(x)
result=1
for i in 1..x do
result*=i
end
return result
end
def solve(n,m,r)
if n+r-n*m-1<n-1||n+r-n*m-1<0||n-1<0 then
return 0
end
return permutation(n+r-n*m-1,n-1)/factorial(n-1)
end
n,m,r=gets.split(/\s/).map{|x|x.to_i}
puts solve(n,m,r) | a.cc:3:18: error: too many decimal points in number
3 | for i in 0..r-1 do
| ^~~~
a.cc:11:18: error: too many decimal points in number
11 | for i in 1..x do
| ^~~~
a.cc:24:19: error: stray '\' in program
24 | n,m,r=gets.split(/\s/).map{|x|x.to_i}
| ^
a.cc:1:1: error: 'def' does not name a type
1 | def permutation(n,r)
| ^~~
a.cc:25:1: error: 'puts' does not name a type
25 | puts solve(n,m,r)
| ^~~~
|
s579093020 | p00514 | C++ | def fact(n):
res = 1
for i in range(1, n+1):
res *= i
return res
def combination(n, k):
return fact(n)//fact(n-k)//fact(k)
n, m, r = list(map(int, input().split()))
print(combination(r - n*m + n - 1, n-1)) | a.cc:1:1: error: 'def' does not name a type
1 | def fact(n):
| ^~~
|
s908439561 | p00514 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using int_t = long long;
constexpr int_t BASE = 100000000 * 100000000, LEN = 16;
class bigint {
private:
bool negative;
std::vector<int_t> a;
bigint& normalize();
public:
bigint(int_t x = 0);
bigint(const std::string& s);
bigint& operator = (const bigint& x);
bigint& operator = (int_t x);
bigint& operator = (const std::string& s);
const bool operator < (const bigint& x) const;
const bool operator > (const bigint& x) const;
const bool operator <= (const bigint& x) const;
const bool operator >= (const bigint& x) const;
const bool operator != (const bigint& x) const;
const bool operator == (const bigint& x) const;
bigint operator -() const;
bigint& operator += (const bigint& x);
bigint& operator -= (const bigint& x);
bigint& operator *= (const bigint& x);
bigint& operator /= (const bigint& x);
bigint& operator %= (const bigint& x);
const bigint operator + (const bigint& x) const;
const bigint operator - (const bigint& x) const;
const bigint operator * (const bigint& x) const;
const bigint operator / (const bigint& x) const;
const bigint operator % (const bigint& x) const;
friend std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs);
friend std::istream& operator >> (std::ostream& is, bigint& x); //??????????£?
friend std::ostream& operator << (std::ostream& os, const bigint& x);
friend const bigint abs(bigint x);
};
inline bigint& bigint::normalize() {
int i = a.size() - 1;
while (i >= 0 && a[i] == 0) --i;
a.resize(i + 1);
if (a.size() == 0) negative = false;
return *this;
}
inline bigint::bigint(int_t x) : negative(x < 0) {
x = abs(x);
for (; x > 0; x /= BASE) a.push_back(x % BASE);
}
inline bigint::bigint(const std::string& s) : negative(false) {
int p = 0;
if (s[p] == '-') { ++p; negative = true; }
else if (s[p] == '+') { ++p; }
for (int i = s.size() - 1, v = BASE; i >= p; --i, v *= 10) {
int x = s[i] - '0';
if (x < 0 || 9 < x) {
std::cerr << "error: parse error:" << s << std::endl;
exit(1);
}
if (v == BASE) {
v = 1;
a.push_back(x);
}
else a.back() += (x)*v;
}
normalize();
}
inline bigint& bigint::operator = (const bigint& x) {
negative = x.negative;
a = x.a;
return *this;
}
inline bigint& bigint::operator = (int_t x) { return *this = bigint(x); }
inline bigint& bigint::operator = (const std::string& s) { return *this = bigint(s); }
inline const bool bigint::operator < (const bigint& x) const {
if (negative != x.negative) return negative > x.negative;
if (a.size() != x.a.size()) return (a.size() < x.a.size()) ^ negative;
for (int i = a.size() - 1; i >= 0; --i)
if (a[i] != x.a[i]) return (a[i] < x.a[i]) ^ negative;
return false;
}
inline const bool bigint::operator > (const bigint& x) const { return x<(*this); }
inline const bool bigint::operator <= (const bigint& x) const { return !(x<(*this)); }
inline const bool bigint::operator >= (const bigint& x) const { return !((*this)<x); }
inline const bool bigint::operator != (const bigint& x) const { return (*this)<x || x<(*this); }
inline const bool bigint::operator == (const bigint& x) const { return !((*this)<x || x<(*this)); }
inline bigint bigint::operator -() const {
bigint ret(*this);
if (a.size()) ret.negative = !ret.negative;
return ret;
}
inline bigint& bigint::operator += (const bigint& x) {
if (negative != x.negative) return *this -= -x;
if (a.size() < x.a.size()) a.resize(x.a.size());
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += (i<x.a.size() ? x.a[i] : 0) + tmp;
tmp = a[i] / BASE;
a[i] %= BASE;
}
if (tmp) a.push_back(1);
return *this;
}
inline bigint& bigint::operator -= (const bigint& x) {
if (negative != x.negative) return *this += -x;
std::vector<int_t> b(x.a);
if ((*this < x) ^ negative) {
a.swap(b);
negative = !negative;
}
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += BASE - (i<b.size() ? b[i] : 0) + tmp;
tmp = a[i] / BASE - 1;
a[i] %= BASE;
}
return this->normalize();
}
inline bigint& bigint::operator *= (const bigint& x) {
negative ^= x.negative;
std::vector<int_t> c(a.size()*x.a.size() + 1);
for (int i = 0; i < a.size(); ++i) {
long long tmp = 0;
for (int j = 0; j < x.a.size(); ++j) {
long long v = (long long)a[i] * x.a[j] + c[i + j] + tmp;
tmp = v / BASE;
c[i + j] = (int_t)(v % BASE);
}
if (tmp) c[i + x.a.size()] += (int_t)tmp;
}
a.swap(c);
return this->normalize();
}
inline bigint& bigint::operator /= (const bigint& x) {
return *this = divmod(*this, x).first;
}
inline bigint& bigint::operator %= (const bigint& x) {
return *this = divmod(*this, x).second;
}
inline const bigint bigint::operator + (const bigint& x) const {
bigint res(*this); return res += x;
}
inline const bigint bigint::operator - (const bigint& x) const {
bigint res(*this); return res -= x;
}
inline const bigint bigint::operator * (const bigint& x) const {
bigint res(*this); return res *= x;
}
inline const bigint bigint::operator / (const bigint& x) const {
bigint res(*this); return res /= x;
}
inline const bigint bigint::operator % (const bigint& x) const {
bigint res(*this); return res %= x;
}
inline std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs) {
if (!rhs.a.size()) {
std::cerr << "error: division by zero" << std::endl;
exit(1);
}
bigint x(abs(rhs)), q, r;
for (int i = lhs.a.size() - 1; i >= 0; --i) {
r = r * BASE + lhs.a[i];
int head = 0, tail = BASE;
if (r >= x) {
while (head + 1 < tail) {
int_t mid = (head + tail) / 2;
if (x * bigint(mid) > r) tail = mid;
else head = mid;
}
r -= x * head;
}
q.a.push_back(head);
}
reverse(q.a.begin(), q.a.end());
bool neg = lhs.negative ^ lhs.negative;
q.negative = neg; r.negative = neg;
return std::make_pair(q.normalize(), r.normalize());
}
inline std::istream& operator >> (std::istream& is, bigint& x) {
std::string tmp; is >> tmp;
x = bigint(tmp);
return is;
}
inline std::ostream& operator << (std::ostream& os, const bigint& x) {
if (x.negative) os << '-';
if (!x.a.size()) os << 0;
else os << x.a.back();
for (int i = x.a.size() - 2; i >= 0; --i) {
os.width(LEN);
os.fill('0');
os << x.a[i];
}
return os;
}
inline const bigint abs(bigint x) {
x.negative = false;
return x;
}
using namespace std;
int main()
{
int n, m, r;
while (cin >> n >> m >> r)
{
int x = r - n*m + n - 1;
int y = r - m * n;
bigint ans;
if (y < 0 || x < 0) {
ans = 0;
}
else
{
ans = 1;
for (int i = 1; i <= y; i = i + 1)
{
ans = ans * (x - i + 1);
ans = ans / i;
}
}
cout << ans << endl;
}
} | a.cc:7:34: warning: integer overflow in expression of type 'int' results in '1874919424' [-Woverflow]
7 | constexpr int_t BASE = 100000000 * 100000000, LEN = 16;
| ~~~~~~~~~~^~~~~~~~~~~
a.cc:7:34: error: overflow in constant expression [-fpermissive]
a.cc:7:36: error: overflow in constant expression [-fpermissive]
7 | constexpr int_t BASE = 100000000 * 100000000, LEN = 16;
| ^~~~~~~~~
|
s788614200 | p00514 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using int_t = long long;
constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
class bigint {
private:
bool negative;
std::vector<int_t> a;
bigint& normalize();
public:
bigint(int_t x = 0);
bigint(const std::string& s);
bigint& operator = (const bigint& x);
bigint& operator = (int_t x);
bigint& operator = (const std::string& s);
const bool operator < (const bigint& x) const;
const bool operator > (const bigint& x) const;
const bool operator <= (const bigint& x) const;
const bool operator >= (const bigint& x) const;
const bool operator != (const bigint& x) const;
const bool operator == (const bigint& x) const;
bigint operator -() const;
bigint& operator += (const bigint& x);
bigint& operator -= (const bigint& x);
bigint& operator *= (const bigint& x);
bigint& operator /= (const bigint& x);
bigint& operator %= (const bigint& x);
const bigint operator + (const bigint& x) const;
const bigint operator - (const bigint& x) const;
const bigint operator * (const bigint& x) const;
const bigint operator / (const bigint& x) const;
const bigint operator % (const bigint& x) const;
friend std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs);
friend std::istream& operator >> (std::ostream& is, bigint& x); //??????????£?
friend std::ostream& operator << (std::ostream& os, const bigint& x);
friend const bigint abs(bigint x);
};
inline bigint& bigint::normalize() {
int i = a.size() - 1;
while (i >= 0 && a[i] == 0) --i;
a.resize(i + 1);
if (a.size() == 0) negative = false;
return *this;
}
inline bigint::bigint(int_t x) : negative(x < 0) {
x = abs(x);
for (; x > 0; x /= BASE) a.push_back(x % BASE);
}
inline bigint::bigint(const std::string& s) : negative(false) {
int p = 0;
if (s[p] == '-') { ++p; negative = true; }
else if (s[p] == '+') { ++p; }
for (int i = s.size() - 1, v = BASE; i >= p; --i, v *= 10) {
int x = s[i] - '0';
if (x < 0 || 9 < x) {
std::cerr << "error: parse error:" << s << std::endl;
exit(1);
}
if (v == BASE) {
v = 1;
a.push_back(x);
}
else a.back() += (x)*v;
}
normalize();
}
inline bigint& bigint::operator = (const bigint& x) {
negative = x.negative;
a = x.a;
return *this;
}
inline bigint& bigint::operator = (int_t x) { return *this = bigint(x); }
inline bigint& bigint::operator = (const std::string& s) { return *this = bigint(s); }
inline const bool bigint::operator < (const bigint& x) const {
if (negative != x.negative) return negative > x.negative;
if (a.size() != x.a.size()) return (a.size() < x.a.size()) ^ negative;
for (int i = a.size() - 1; i >= 0; --i)
if (a[i] != x.a[i]) return (a[i] < x.a[i]) ^ negative;
return false;
}
inline const bool bigint::operator > (const bigint& x) const { return x<(*this); }
inline const bool bigint::operator <= (const bigint& x) const { return !(x<(*this)); }
inline const bool bigint::operator >= (const bigint& x) const { return !((*this)<x); }
inline const bool bigint::operator != (const bigint& x) const { return (*this)<x || x<(*this); }
inline const bool bigint::operator == (const bigint& x) const { return !((*this)<x || x<(*this)); }
inline bigint bigint::operator -() const {
bigint ret(*this);
if (a.size()) ret.negative = !ret.negative;
return ret;
}
inline bigint& bigint::operator += (const bigint& x) {
if (negative != x.negative) return *this -= -x;
if (a.size() < x.a.size()) a.resize(x.a.size());
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += (i<x.a.size() ? x.a[i] : 0) + tmp;
tmp = a[i] / BASE;
a[i] %= BASE;
}
if (tmp) a.push_back(1);
return *this;
}
inline bigint& bigint::operator -= (const bigint& x) {
if (negative != x.negative) return *this += -x;
std::vector<int_t> b(x.a);
if ((*this < x) ^ negative) {
a.swap(b);
negative = !negative;
}
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += BASE - (i<b.size() ? b[i] : 0) + tmp;
tmp = a[i] / BASE - 1;
a[i] %= BASE;
}
return this->normalize();
}
inline bigint& bigint::operator *= (const bigint& x) {
negative ^= x.negative;
std::vector<int_t> c(a.size()*x.a.size() + 1);
for (int i = 0; i < a.size(); ++i) {
long long tmp = 0;
for (int j = 0; j < x.a.size(); ++j) {
long long v = (long long)a[i] * x.a[j] + c[i + j] + tmp;
tmp = v / BASE;
c[i + j] = (int_t)(v % BASE);
}
if (tmp) c[i + x.a.size()] += (int_t)tmp;
}
a.swap(c);
return this->normalize();
}
inline bigint& bigint::operator /= (const bigint& x) {
return *this = divmod(*this, x).first;
}
inline bigint& bigint::operator %= (const bigint& x) {
return *this = divmod(*this, x).second;
}
inline const bigint bigint::operator + (const bigint& x) const {
bigint res(*this); return res += x;
}
inline const bigint bigint::operator - (const bigint& x) const {
bigint res(*this); return res -= x;
}
inline const bigint bigint::operator * (const bigint& x) const {
bigint res(*this); return res *= x;
}
inline const bigint bigint::operator / (const bigint& x) const {
bigint res(*this); return res /= x;
}
inline const bigint bigint::operator % (const bigint& x) const {
bigint res(*this); return res %= x;
}
inline std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs) {
if (!rhs.a.size()) {
std::cerr << "error: division by zero" << std::endl;
exit(1);
}
bigint x(abs(rhs)), q, r;
for (int i = lhs.a.size() - 1; i >= 0; --i) {
r = r * BASE + lhs.a[i];
int head = 0, tail = BASE;
if (r >= x) {
while (head + 1 < tail) {
int_t mid = (head + tail) / 2;
if (x * bigint(mid) > r) tail = mid;
else head = mid;
}
r -= x * head;
}
q.a.push_back(head);
}
reverse(q.a.begin(), q.a.end());
bool neg = lhs.negative ^ lhs.negative;
q.negative = neg; r.negative = neg;
return std::make_pair(q.normalize(), r.normalize());
}
inline std::istream& operator >> (std::istream& is, bigint& x) {
std::string tmp; is >> tmp;
x = bigint(tmp);
return is;
}
inline std::ostream& operator << (std::ostream& os, const bigint& x) {
if (x.negative) os << '-';
if (!x.a.size()) os << 0;
else os << x.a.back();
for (int i = x.a.size() - 2; i >= 0; --i) {
os.width(LEN);
os.fill('0');
os << x.a[i];
}
return os;
}
inline const bigint abs(bigint x) {
x.negative = false;
return x;
}
using namespace std;
int main()
{
int n, m, r;
while (cin >> n >> m >> r)
{
int x = r - n*m + n - 1;
int y = r - m * n;
bigint ans;
if (y < 0 || x < 0) {
ans = 0;
}
else
{
ans = 1;
for (int i = 1; i <= y; i = i + 1)
{
ans = ans * (x - i + 1);
ans = ans / i;
}
}
cout << ans << endl;
}
}#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using int_t = long long;
constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
class bigint {
private:
bool negative;
std::vector<int_t> a;
bigint& normalize();
public:
bigint(int_t x = 0);
bigint(const std::string& s);
bigint& operator = (const bigint& x);
bigint& operator = (int_t x);
bigint& operator = (const std::string& s);
const bool operator < (const bigint& x) const;
const bool operator > (const bigint& x) const;
const bool operator <= (const bigint& x) const;
const bool operator >= (const bigint& x) const;
const bool operator != (const bigint& x) const;
const bool operator == (const bigint& x) const;
bigint operator -() const;
bigint& operator += (const bigint& x);
bigint& operator -= (const bigint& x);
bigint& operator *= (const bigint& x);
bigint& operator /= (const bigint& x);
bigint& operator %= (const bigint& x);
const bigint operator + (const bigint& x) const;
const bigint operator - (const bigint& x) const;
const bigint operator * (const bigint& x) const;
const bigint operator / (const bigint& x) const;
const bigint operator % (const bigint& x) const;
friend std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs);
friend std::istream& operator >> (std::ostream& is, bigint& x); //??????????£?
friend std::ostream& operator << (std::ostream& os, const bigint& x);
friend const bigint abs(bigint x);
};
inline bigint& bigint::normalize() {
int i = a.size() - 1;
while (i >= 0 && a[i] == 0) --i;
a.resize(i + 1);
if (a.size() == 0) negative = false;
return *this;
}
inline bigint::bigint(int_t x) : negative(x < 0) {
x = abs(x);
for (; x > 0; x /= BASE) a.push_back(x % BASE);
}
inline bigint::bigint(const std::string& s) : negative(false) {
int p = 0;
if (s[p] == '-') { ++p; negative = true; }
else if (s[p] == '+') { ++p; }
for (int i = s.size() - 1, v = BASE; i >= p; --i, v *= 10) {
int x = s[i] - '0';
if (x < 0 || 9 < x) {
std::cerr << "error: parse error:" << s << std::endl;
exit(1);
}
if (v == BASE) {
v = 1;
a.push_back(x);
}
else a.back() += (x)*v;
}
normalize();
}
inline bigint& bigint::operator = (const bigint& x) {
negative = x.negative;
a = x.a;
return *this;
}
inline bigint& bigint::operator = (int_t x) { return *this = bigint(x); }
inline bigint& bigint::operator = (const std::string& s) { return *this = bigint(s); }
inline const bool bigint::operator < (const bigint& x) const {
if (negative != x.negative) return negative > x.negative;
if (a.size() != x.a.size()) return (a.size() < x.a.size()) ^ negative;
for (int i = a.size() - 1; i >= 0; --i)
if (a[i] != x.a[i]) return (a[i] < x.a[i]) ^ negative;
return false;
}
inline const bool bigint::operator > (const bigint& x) const { return x<(*this); }
inline const bool bigint::operator <= (const bigint& x) const { return !(x<(*this)); }
inline const bool bigint::operator >= (const bigint& x) const { return !((*this)<x); }
inline const bool bigint::operator != (const bigint& x) const { return (*this)<x || x<(*this); }
inline const bool bigint::operator == (const bigint& x) const { return !((*this)<x || x<(*this)); }
inline bigint bigint::operator -() const {
bigint ret(*this);
if (a.size()) ret.negative = !ret.negative;
return ret;
}
inline bigint& bigint::operator += (const bigint& x) {
if (negative != x.negative) return *this -= -x;
if (a.size() < x.a.size()) a.resize(x.a.size());
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += (i<x.a.size() ? x.a[i] : 0) + tmp;
tmp = a[i] / BASE;
a[i] %= BASE;
}
if (tmp) a.push_back(1);
return *this;
}
inline bigint& bigint::operator -= (const bigint& x) {
if (negative != x.negative) return *this += -x;
std::vector<int_t> b(x.a);
if ((*this < x) ^ negative) {
a.swap(b);
negative = !negative;
}
int_t tmp = 0;
for (int i = 0; i < a.size(); ++i) {
a[i] += BASE - (i<b.size() ? b[i] : 0) + tmp;
tmp = a[i] / BASE - 1;
a[i] %= BASE;
}
return this->normalize();
}
inline bigint& bigint::operator *= (const bigint& x) {
negative ^= x.negative;
std::vector<int_t> c(a.size()*x.a.size() + 1);
for (int i = 0; i < a.size(); ++i) {
long long tmp = 0;
for (int j = 0; j < x.a.size(); ++j) {
long long v = (long long)a[i] * x.a[j] + c[i + j] + tmp;
tmp = v / BASE;
c[i + j] = (int_t)(v % BASE);
}
if (tmp) c[i + x.a.size()] += (int_t)tmp;
}
a.swap(c);
return this->normalize();
}
inline bigint& bigint::operator /= (const bigint& x) {
return *this = divmod(*this, x).first;
}
inline bigint& bigint::operator %= (const bigint& x) {
return *this = divmod(*this, x).second;
}
inline const bigint bigint::operator + (const bigint& x) const {
bigint res(*this); return res += x;
}
inline const bigint bigint::operator - (const bigint& x) const {
bigint res(*this); return res -= x;
}
inline const bigint bigint::operator * (const bigint& x) const {
bigint res(*this); return res *= x;
}
inline const bigint bigint::operator / (const bigint& x) const {
bigint res(*this); return res /= x;
}
inline const bigint bigint::operator % (const bigint& x) const {
bigint res(*this); return res %= x;
}
inline std::pair<bigint, bigint> divmod(const bigint& lhs, const bigint& rhs) {
if (!rhs.a.size()) {
std::cerr << "error: division by zero" << std::endl;
exit(1);
}
bigint x(abs(rhs)), q, r;
for (int i = lhs.a.size() - 1; i >= 0; --i) {
r = r * BASE + lhs.a[i];
int head = 0, tail = BASE;
if (r >= x) {
while (head + 1 < tail) {
int_t mid = (head + tail) / 2;
if (x * bigint(mid) > r) tail = mid;
else head = mid;
}
r -= x * head;
}
q.a.push_back(head);
}
reverse(q.a.begin(), q.a.end());
bool neg = lhs.negative ^ lhs.negative;
q.negative = neg; r.negative = neg;
return std::make_pair(q.normalize(), r.normalize());
}
inline std::istream& operator >> (std::istream& is, bigint& x) {
std::string tmp; is >> tmp;
x = bigint(tmp);
return is;
}
inline std::ostream& operator << (std::ostream& os, const bigint& x) {
if (x.negative) os << '-';
if (!x.a.size()) os << 0;
else os << x.a.back();
for (int i = x.a.size() - 2; i >= 0; --i) {
os.width(LEN);
os.fill('0');
os << x.a[i];
}
return os;
}
inline const bigint abs(bigint x) {
x.negative = false;
return x;
}
using namespace std;
int main()
{
int n, m, r;
while (cin >> n >> m >> r)
{
int x = r - n*m + n - 1;
int y = r - m * n;
bigint ans;
if (y < 0 || x < 0) {
ans = 0;
}
else
{
ans = 1;
for (int i = 1; i <= y; i = i + 1)
{
ans = ans * (x - i + 1);
ans = ans / i;
}
}
cout << ans << endl;
}
} | a.cc:226:2: error: stray '#' in program
226 | }#include <iostream>
| ^
a.cc: In constructor 'bigint::bigint(const std::string&)':
a.cc:56:36: warning: overflow in conversion from 'long long int' to 'int' changes value from '10000000000000000' to '1874919424' [-Woverflow]
56 | for (int i = s.size() - 1, v = BASE; i >= p; --i, v *= 10) {
| ^~~~
a.cc: In function 'std::pair<bigint, bigint> divmod(const bigint&, const bigint&)':
a.cc:165:30: warning: overflow in conversion from 'long long int' to 'int' changes value from '10000000000000000' to '1874919424' [-Woverflow]
165 | int head = 0, tail = BASE;
| ^~~~
a.cc: At global scope:
a.cc:226:3: error: 'include' does not name a type
226 | }#include <iostream>
| ^~~~~~~
a.cc:232:17: error: redefinition of 'constexpr const int_t BASE'
232 | constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
| ^~~~
a.cc:7:17: note: 'constexpr const int_t BASE' previously defined here
7 | constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
| ^~~~
a.cc:232:51: error: redefinition of 'constexpr const int_t LEN'
232 | constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
| ^~~
a.cc:7:51: note: 'constexpr const int_t LEN' previously defined here
7 | constexpr int_t BASE = 100000000LL * 100000000LL, LEN = 16;
| ^~~
a.cc:233:7: error: redefinition of 'class bigint'
233 | class bigint {
| ^~~~~~
a.cc:8:7: note: previous definition of 'class bigint'
8 | class bigint {
| ^~~~~~
a.cc:266:16: error: redefinition of 'bigint& bigint::normalize()'
266 | inline bigint& bigint::normalize() {
| ^~~~~~
a.cc:41:16: note: 'bigint& bigint::normalize()' previously defined here
41 | inline bigint& bigint::normalize() {
| ^~~~~~
a.cc:273:8: error: redefinition of 'bigint::bigint(int_t)'
273 | inline bigint::bigint(int_t x) : negative(x < 0) {
| ^~~~~~
a.cc:48:8: note: 'bigint::bigint(int_t)' previously defined here
48 | inline bigint::bigint(int_t x) : negative(x < 0) {
| ^~~~~~
a.cc:277:8: error: redefinition of 'bigint::bigint(const std::string&)'
277 | inline bigint::bigint(const std::string& s) : negative(false) {
| ^~~~~~
a.cc:52:8: note: 'bigint::bigint(const std::string&)' previously defined here
52 | inline bigint::bigint(const std::string& s) : negative(false) {
| ^~~~~~
a.cc:295:16: error: redefinition of 'bigint& bigint::operator=(const bigint&)'
295 | inline bigint& bigint::operator = (const bigint& x) {
| ^~~~~~
a.cc:70:16: note: 'bigint& bigint::operator=(const bigint&)' previously defined here
70 | inline bigint& bigint::operator = (const bigint& x) {
| ^~~~~~
a.cc:300:16: error: redefinition of 'bigint& bigint::operator=(int_t)'
300 | inline bigint& bigint::operator = (int_t x) { return *this = bigint(x); }
| ^~~~~~
a.cc:75:16: note: 'bigint& bigint::operator=(int_t)' previously defined here
75 | inline bigint& bigint::operator = (int_t x) { return *this = bigint(x); }
| ^~~~~~
a.cc:301:16: error: redefinition of 'bigint& bigint::operator=(const std::string&)'
301 | inline bigint& bigint::operator = (const std::string& s) { return *this = bigint(s); }
| ^~~~~~
a.cc:76:16: note: 'bigint& bigint::operator=(const std::string&)' previously defined here
76 | inline bigint& bigint::operator = (const std::string& s) { return *this = bigint(s); }
| ^~~~~~
a.cc:302:19: error: redefinition of 'const bool bigint::operator<(const bigint&) const'
302 | inline const bool bigint::operator < (const bigint& x) const {
| ^~~~~~
a.cc:77:19: note: 'const bool bigint::operator<(const bigint&) const' previously defined here
77 | inline const bool bigint::operator < (const bigint& x) const {
| ^~~~~~
a.cc:309:19: error: redefinition of 'const bool bigint::operator>(const bigint&) const'
309 | inline const bool bigint::operator > (const bigint& x) const { return x<(*this); }
| ^~~~~~
a.cc:84:19: note: 'const bool bigint::operator>(const bigint&) const' previously defined here
84 | inline const bool bigint::operator > (const bigint& x) const { return x<(*this); }
| ^~~~~~
a.cc:310:19: error: redefinition of 'const bool bigint::operator<=(const bigint&) const'
310 | inline const bool bigint::operator <= (const bigint& x) const { return !(x<(*this)); }
| ^~~~~~
a.cc:85:19: note: 'const bool bigint::operator<=(const bigint&) const' previously defined here
85 | inline const bool bigint::operator <= (const bigint& x) const { return !(x<(*this)); }
| ^~~~~~
a.cc:311:19: error: redefinition of 'const bool bigint::operator>=(const bigint&) const'
311 | inline const bool bigint::operator >= (const bigint& x) const { return !((*this)<x); }
| ^~~~~~
a.cc:86:19: note: 'const bool bigint::operator>=(const bigint&) const' previously defined here
86 | inline const bool bigint::operator >= (const bigint& x) const { return !((*this)<x); }
| ^~~~~~
a.cc:312:19: error: redefinition of 'const bool bigint::operator!=(const bigint&) const'
312 | inline const bool bigint::operator != (const bigint& x) const { return (*this)<x || x<(*this); }
| ^~~~~~
a.cc:87:19: note: 'const bool bigint::operator!=(const bigint&) const' previously defined here
87 | inline const bool bigint::operator != (const bigint& x) const { return (*this)<x || x<(*this); }
| ^~~~~~
a.cc:313:19: error: redefinition of 'const bool bigint::operator==(const bigint&) const'
313 | inline const bool bigint::operator == (const bigint& x) const { return !((*this)<x || x<(*this)); }
| ^~~~~~
a.cc:88:19: note: 'const bool bigint::operator==(const bigint&) const' previously defined here
88 | inline const bool bigint::operator == (const bigint& x) const { return !((*this)<x || x<(*this)); }
| ^~~~~~
a.cc:314:15: error: redefinition of 'bigint bigint::operator-() const'
314 | inline bigint bigint::operator -() const {
| ^~~~~~
a.cc:89:15: note: 'bigint bigint::operator-() const' previously defined here
89 | inline bigint bigint::operator -() const {
| ^~~~~~
a.cc:319:16: error: redefinition of 'bigint& bigint::operator+=(const bigint&)'
319 | inline bigint& bigint::operator += (const bigint& x) {
| ^~~~~~
a.cc:94:16: note: 'bigint& bigint::operator+=(const bigint&)' previously defined here
94 | inline bigint& bigint::operator += (const bigint& x) {
| ^~~~~~
a.cc:331:16: error: redefinition of 'bigint& bigint::operator-=(const bigint&)'
331 | inline bigint& bigint::operator -= (const bigint& x) {
| ^~~~~~
a.cc:106:16: note: 'bigint& bigint::operator-=(const bigint&)' previously defined here
106 | inline bigint& bigint::operator -= (const bigint& x) {
| ^~~~~~
a.cc:346:16: error: redefinition of 'bigint& bigint::operator*=(const bigint&)'
346 | inline bigint& bigint::operator *= (const bigint& x) {
| ^~~~~~
a.cc:121:16: note: 'bigint& bigint::operator*=(const bigint&)' previously defined here
121 | inline bigint& bigint::operator *= (const bigint& x) {
| ^~~~~~
a.cc:361:16: error: redefinition of 'bigint& bigint::operator/=(const bigint&)'
361 | inline bigint& bigint::operator /= (const bigint& x) {
| ^~~~~~
a.cc:136:16: note: 'bigint& bigint::operator/=(const bigint&)' previously defined here
136 | inline bigint& bigint::operator /= (const bigint& x) {
| ^~~~~~
a.cc:364:16: error: redefinition of 'bigint& bigint::operator%=(const bigint&)'
364 | inline bigint& bigint::operator %= (const bigint& x) {
| ^~~~~~
a.cc:139:16: note: 'bigint& bigint::operator%=(const bigint&)' previously defined here
139 | inline bigint& bigint::operator %= (const bigint& x) {
| ^~~~~~
a.cc:367:21: error: redefinition of 'const bigint bigint::operator+(const bigint&) const'
367 | inline const bigint bigint::operator + (const bigint& x) const {
| ^~~~~~
a.cc:142:21: note: 'const bigint bigint::operator+(const bigint&) const' previously defined here
142 | inline const bigint bigint::operator + (const bigint& x) const {
| ^~~~~~
a.cc:370:21: error: redefinition of 'const bigint bigint::operator-(const bigint&) const'
370 | inline const bigint bigint::operator - (const bigint& x) const {
| ^~~~~~
a.cc:145:21: note: 'const bigint bigint::operator-(const bigint&) const' previously defined here
145 | inline const bigint bigint::operator - (const bigint& x) const {
| ^~~~~~
a.cc:373:21: error: redefinition of 'const bigint bigint::operator*(const bigint&) const'
373 | inline const bigint bigint::operator * (const bigint& x) const {
| ^~~~~~
a.cc:148:21: note: 'const bigint bigint::operator*(const bigint&) const' previously defined here
148 | inline const bigint bigint::operator * (const bigint& x) const {
| ^~~~~~
a.cc:376:21: error: redefinition of 'const bigint bigint::operator/(const bigint&) const'
376 | inline const bigint bigint::operator / (const bigint& x) const {
| ^~~~~~
a.cc:151:21: note: 'const bigint bigint::operator/(const bigint&) const' previously defined here
151 | inline const bigint bigint::operator / (const bigint& x) const {
| ^~~~~~
a.cc:379:21: error: redefinition of 'const bigint bigint::operator%(const bigint&) const'
379 | inline const bigint bigint::o |
s809427973 | p00514 | C++ | import std.bigint;
import std.stdio;
import core.stdc.stdio;
void main() {
int n,m,r;
scanf("%d%d%d",&n,&m,&r);
r -= n*m;
if(r<=0) puts("0");
else{
BigInt ans = 1;
for(int i=1; i<n; i++){
ans = ans * (i+r) / i;
}
writeln(ans);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import std.bigint;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.stdio;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import core.stdc.stdio;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: '::main' must return 'int'
5 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
7 | scanf("%d%d%d",&n,&m,&r);
| ^~~~~
a.cc:10:18: error: 'puts' was not declared in this scope
10 | if(r<=0) puts("0");
| ^~~~
a.cc:12:17: error: 'BigInt' was not declared in this scope
12 | BigInt ans = 1;
| ^~~~~~
a.cc:14:25: error: 'ans' was not declared in this scope
14 | ans = ans * (i+r) / i;
| ^~~
a.cc:16:25: error: 'ans' was not declared in this scope
16 | writeln(ans);
| ^~~
a.cc:16:17: error: 'writeln' was not declared in this scope
16 | writeln(ans);
| ^~~~~~~
|
s340598074 | p00514 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip ;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1<<30;
class Calc{
#define N 10000
#define MOD 100000000
public:
int carry, borrow,w,remainder;
int z[N];
void Calc::ladd(int a[], int b[]){
carry=0;
for(int i=N-1;i>=0;i--){
z[i]=a[i]+b[i]+carry;
if(z[i]<MOD)carry=0;
else{
z[i]-=MOD;
carry=1;
}
}
}
void Calc::lsub(int a[], int b[]){
borrow=0;
for(int i=N-1;i>=0;i--){
z[i]=a[i]-b[i]-borrow;
if(z[i]>=0)borrow=0;
else{
z[i]+=MOD;
borrow=1;
}
}
}
void Calc::lmul(int c[], int d){
carry=0;
for(int i=N-1;i>=0;i--){
w=c[i];
z[i]=(w*d+carry)%MOD;
carry=(w*d+carry)/MOD;
}
}
void Calc::ldiv(int c[], int d){
remainder=0;
for(int i=0;i<N;i++){
w=c[i];
z[i]=(w+remainder)/d;
remainder=((w+remainder)%d)*MOD;
}
}
void Calc::displayL(int s[]){
int t=0;
for(;t<N;t++)if(s[t]){
printf("%d",s[t]);
break;
}
for(t++;t<N;t++)printf("%08d",s[t]);
printf("\n");
}
void Calc::displayS(int s){
for(int i=0;i<N-1;i++)printf("%8s"," ");
printf("%08d\n",s);
}
};
int main(){
Calc calc;
ll a,b,c;
cin>>a>>b>>c;
c-=a*b;
if(c<0){
cout<<0<<endl;
}else{
rep(i,N){
calc.z[i]=0;
}
calc.z[N-1]=1;
loop(i,1,c+a)calc.lmul(calc.z,i);
loop(i,1,c+1)calc.ldiv(calc.z,i);
loop(i,1,a)calc.ldiv(calc.z,i);
calc.displayL(calc.z);
}
} | a.cc:39:14: error: extra qualification 'Calc::' on member 'ladd' [-fpermissive]
39 | void Calc::ladd(int a[], int b[]){
| ^~~~
a.cc:50:14: error: extra qualification 'Calc::' on member 'lsub' [-fpermissive]
50 | void Calc::lsub(int a[], int b[]){
| ^~~~
a.cc:61:14: error: extra qualification 'Calc::' on member 'lmul' [-fpermissive]
61 | void Calc::lmul(int c[], int d){
| ^~~~
a.cc:69:14: error: extra qualification 'Calc::' on member 'ldiv' [-fpermissive]
69 | void Calc::ldiv(int c[], int d){
| ^~~~
a.cc:77:14: error: extra qualification 'Calc::' on member 'displayL' [-fpermissive]
77 | void Calc::displayL(int s[]){
| ^~~~
a.cc:86:14: error: extra qualification 'Calc::' on member 'displayS' [-fpermissive]
86 | void Calc::displayS(int s){
| ^~~~
|
s980766672 | p00514 | C++ | #include <cstdio>
#include <cstring>
#define BASE (1000000)
typedef long long lint;
int main()
{
int n, m, r;
int head, tail;
int i, j;
static lint ans[20000], temp[20000];
lint carry;
tail = sizeof(ans) / sizeof(__int64) - 1;
scanf("%d%d%d", &n, &m, &r);
if (r - m * n < 0 || n + r - m * n - 1 < 0){
printf("0\n");
}
else {
head = tail;
ans[tail] = 1;
//nCkを求める. n!
for (i = 1; i <= n + r - m * n - 1; i++){
carry = 0;
for (j = tail; j >= head; j--){
carry += i * ans[j];
ans[j] = carry % BASE;
carry /= BASE;
}
while (carry != 0){
ans[--head] = carry % BASE;
carry /= BASE;
}
}
//k!
for (i = r - m * n; i >= 2; i--){
memcpy(temp, ans, sizeof(ans));
carry = 0;
for (j = head; j <= tail; j++){
carry = carry * BASE + temp[j];
ans[j] = carry / i;
carry %= i;
}
}
//(n - k)!
for (i = n - 1; i >= 2; i--){
memcpy(temp, ans, sizeof(ans));
carry = 0;
for (j = head; j <= tail; j++){
carry = carry * BASE + temp[j];
ans[j] = carry / i;
carry %= i;
}
}
while (ans[head] == 0){
head++;
}
for (i = head; i <= tail; i++){
if (i != head){
printf("%06lld", ans[i]);
}
else {
printf("%lld", ans[i]);
}
}
printf("\n");
}
return (0);
} | a.cc: In function 'int main()':
a.cc:15:33: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
15 | tail = sizeof(ans) / sizeof(__int64) - 1;
| ^~~~~~~
| __int64_t
|
s270097535 | p00514 | C++ | // -*- coding:utf-8; tab-width:4 -*-
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
// ティツァツ」テァツュツ?
namespace solution {
using namespace std;
typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef long long LL;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair<INT, INT> II;
struct Solution {
void init() {
}
bool input() {
}
solve() {
}
int run() {
while ( init(), input() ) {
solve();
}
return 0;
}
};
}
int main() {
return solution::Solution().run();
} | a.cc:42:9: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
42 | solve() {
| ^~~~~
a.cc: In member function 'bool solution::Solution::input()':
a.cc:40:9: warning: no return statement in function returning non-void [-Wreturn-type]
40 | }
| ^
a.cc: In member function 'int solution::Solution::solve()':
a.cc:43:9: warning: no return statement in function returning non-void [-Wreturn-type]
43 | }
| ^
|
s838213767 | p00514 | C++ | import math
import sys
n, m, r=sys.stdin.readline().split()
n=int(n)
m=int(m)
r=int(r)
if r-n*m >= 0:
print math.factorial(r-n*m+n-1)/math.factorial(r-n*m)/math.factorial(n-1)
else :
print 0 | a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s900918896 | p00514 | C++ |
def foo(infile, outfile):
import math
n, m, r=infile.readline().split()
n=int(n)
m=int(m)
r=int(r)
print 0
if r-n*m >= 0:
print math.factorial(r-n*m+n-1)/math.factorial(r-n*m)/math.factorial(n-1)
else :
print 0
if __name__ == "__main__":
import sys
foo(sys.stdin, sys.stdout) | a.cc:2:1: error: 'def' does not name a type
2 | def foo(infile, outfile):
| ^~~
|
s458651615 | p00514 | C++ | #include <iostream>
using namespace std;
int N, M, R;
int memo[10000][10000];
int rec(int i, int rest)
{
if(memo[i][rest] == -1) return memo[i][rest];
if(i == N) return rest == 0;
int ret = 0;
for(int use = 0; use <= rest; use++) {
ret += rec(i+1, rest - use);
}
return memo[i][rest] = ret;
}
int main()
{
memset(memo, -1, sizeof memo);
cin >> N >> M >> R;
cout << rec(0, R - N*M) << endl;
} | a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
24 | memset(memo, -1, sizeof memo);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s571786853 | p00514 | C++ | def kaijou(n):
res=1
for i in xrange(1,x+1):
res*=i
return res
def comb(a,b):
if(a<b or b<0):return 0
if(b==0):return 1
return kaijou(a)/kaijou(b)/kaijou(a-b)
a,b,c=map(int,raw_input().split())
c-=a*b
print comb(c+a-1,c) | a.cc:1:1: error: 'def' does not name a type
1 | def kaijou(n):
| ^~~
|
s473151375 | p00515 | Java | import java.util.Scanner;
public class AverageScore {
public static void main(String[] args) {
final Scanner sc= new Scanner(System.in);
int sum=0;
for(int i=0;i<5;i++){
int num=sc.nextInt();
if(num<40) sum+=40;
else sum+=num;
}
System.out.println(sum/5);
}
} | Main.java:2: error: class AverageScore is public, should be declared in a file named AverageScore.java
public class AverageScore {
^
1 error
|
s903787761 | p00515 | Java | import java.util.Scanner;
public class aoj {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sum = 0;
for(int i=0;i<5;i++){
int a = sc.nextInt();
if(a<40){
a = 40;
}
sum += a;
}
System.out.println(sum/5);
}
} | Main.java:3: error: class aoj is public, should be declared in a file named aoj.java
public class aoj {
^
1 error
|
s402969476 | p00515 | Java | package SD;
import java.util.Scanner;
public class Z01 {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int[10];
int ave,sum = 0;
for(int i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
sum = sum+score[i];
}
ave = sum/5;
sc.close();
System.out.println(ave);
}
} | Main.java:3: error: class Z01 is public, should be declared in a file named Z01.java
public class Z01 {
^
1 error
|
s895271030 | p00515 | Java | import java.util.Scanner;
public class Z01 {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int[10];
int ave,sum = 0;
for(int i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
sum = sum+score[i];
}
ave = sum/5;
sc.close();
System.out.println(ave);
}
} | Main.java:2: error: class Z01 is public, should be declared in a file named Z01.java
public class Z01 {
^
1 error
|
s830303347 | p00515 | Java | package AOJ0414;
import java.util.Scanner;
public class averagescore1 {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int [5];
int i, sum = 0;
for(i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
}
//System.out.printf("%d\n", score[0]);
for(int k = 0; k < 5; k++){
sum = sum + score[k];
}
System.out.printf("%d\n", sum / 5);
}
} | Main.java:3: error: class averagescore1 is public, should be declared in a file named averagescore1.java
public class averagescore1 {
^
1 error
|
s379501310 | p00515 | Java |
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int [5];
int i, sum = 0;
for(i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
}
//System.out.printf("%d\n", score[0]);
for(int k = 0; k < 5; k++){
sum = sum + score[k];
}
System.out.printf("%d\n", sum / 5);
} | Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s582814871 | p00515 | Java | public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int [5];
int i, sum = 0;
for(i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
}
//System.out.printf("%d\n", score[0]);
for(int k = 0; k < 5; k++){
sum = sum + score[k];
}
System.out.printf("%d\n", sum / 5);
}
} | Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s333600767 | p00515 | Java |
import java.io.InputStreamReader;
import java.util.Scanner;
public class MAIN {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
InputStreamReader isr = new InputStreamReader(System.in);
int ave,sum=0;
Scanner sc = new Scanner(System.in);
int[] data=new int[10];
for(int i=0;i<5;i++){
data[i]=sc.nextInt();
if(data[i]<40)data[i]=40;
}
for(int i=0;i<5;i++){
sum+=data[i];
}
System.out.printf("%d\n", sum/5);
}
} | Main.java:6: error: class MAIN is public, should be declared in a file named MAIN.java
public class MAIN {
^
1 error
|
s416242249 | p00515 | Java | package Class01;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int a[] = new int[5];
int sum = 0;
for(int i = 0; i < 5; i++){
a[i] = sc.nextInt();
if(a[i] < 40){
a[i] = 40;
}
}
for(int i = 0; i < 5; i++){
sum = sum + a[i];
}
System.out.println(sum/5);
}
} | Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:6: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s497769607 | p00515 | C | #include <stdio.h>
int main(void){
int a[5] = {0};
int i;
int avg=0;
for(i=0; i<5; i++) {
scanf("%d", &a[i]);
if(a[i]<40) a[i]=40;
avg += a[i];
}
print("%d", avg/5);
return 0;
} | main.c: In function 'main':
main.c:15:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
15 | print("%d", avg/5);
| ^~~~~
| printf
|
s194867865 | p00515 | C | #include <stdio.h>
int main(void)
{
int sum = 0;
int i;
for (i = 0; i < 5; i++){
int point;
scanf("%d", &point);
if (point < 40) point = 40;
sum += point;
}
printf("%d\n", point / 5);
} | main.c: In function 'main':
main.c:15:24: error: 'point' undeclared (first use in this function); did you mean 'printf'?
15 | printf("%d\n", point / 5);
| ^~~~~
| printf
main.c:15:24: note: each undeclared identifier is reported only once for each function it appears in
|
s909808811 | p00515 | C | #include<stdio>
int main(void)
{int x,sum;
for(i=0; i<5; i++){
scanf("%d",&x);
if(x<40)
x=40;
sum=sum+x;
}
sum=sum/5;
printf("%d",sum);
return(0);
} | main.c:1:9: fatal error: stdio: No such file or directory
1 | #include<stdio>
| ^~~~~~~
compilation terminated.
|
s198059870 | p00515 | C | #include<stdio.h>
int main(void)
{int x,sum;
for(i=0; i<5; i++){
scanf("%d",&x);
if(x<40)
x=40;
sum=sum+x;
}
sum=sum/5;
printf("%d",sum);
return(0);
} | main.c: In function 'main':
main.c:4:7: error: 'i' undeclared (first use in this function)
4 | for(i=0; i<5; i++){
| ^
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
|
s420226350 | p00515 | C | #include<stdio.h>
int main(void)
{int x,sum,i;
for(i=0; i<5; i++){
scanf("%d",&x);
if(x<=40)
x=40;
sum=sum+x;
}
sum=sum/5;
printf("%d"\n,sum);
return(0);
} | main.c: In function 'main':
main.c:13:14: error: stray '\' in program
13 | printf("%d"\n,sum);
| ^
main.c:13:14: error: expected ')' before 'n'
13 | printf("%d"\n,sum);
| ~ ^~
| )
|
s532342688 | p00515 | C | #include<stdio.h>
int main()
{
int taro;
int jiro;
int sabu;
int shiro;
int hanako;
int sum=0;
scanf("%d",&taro);
scanf("%d",&jiro);
scanf("%d",&sabu);
scanf("%d",&shiro);
scanf("%d",&hanako);
if(taro<40)sum+=40;
else sum+=taro;
if(jiro<40)sum+=40;
else sum+=jiro;
if(sabo<40)sum+=40;
else sum+=sabu;
if(shiro<40)sum+=40;
else sum+=shiro;
if(hanako<40)sum+=40;
else sum+=hanako;
printf("%d\n",sum/5);
return 0;
} | main.c: In function 'main':
main.c:22:12: error: 'sabo' undeclared (first use in this function); did you mean 'sabu'?
22 | if(sabo<40)sum+=40;
| ^~~~
| sabu
main.c:22:12: note: each undeclared identifier is reported only once for each function it appears in
|
s375505975 | p00515 | C | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5 | main.c:1:1: error: invalid suffix "times" on floating constant
1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
| ^~~~~~~
main.c:1:1: error: expected identifier or '(' before numeric constant
main.c:1:35: error: unknown type name 'p'
1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
| ^
main.c:1:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
| ^
|
s790206974 | p00515 | C | #include <stdio.h>
int main(void)
{
int scr[5];
int sum=0;
int i;
for(i=0;i<5;i++);
scanf("%d",&scr[i]);
for(i=0;i<5;i++)
if(v[i]<40)
v[i]=40;
for(i=0;i<5;i++)
sum+=v[i];
printf("%d\n",sum/5);
return 0;
} | main.c: In function 'main':
main.c:12:8: error: 'v' undeclared (first use in this function)
12 | if(v[i]<40)
| ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
|
s001863204 | p00515 | C | #include <stdio.h>
int main(void) {
int a,b,c,d,e;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
a=(a+b+c+d+e)/5;
printf("%d\n",a[int]);
// your code goes here
return 0;
} | main.c: In function 'main':
main.c:8:25: error: expected expression before 'int'
8 | printf("%d\n",a[int]);
| ^~~
|
s655283670 | p00515 | C | #include <stdio.h>
int main(void) {
int a,b,c,d,e;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
a=(a+b+c+d+e)/5;
int a;
printf("%d\n",a);
// your code goes here
return 0;
} | main.c: In function 'main':
main.c:8:13: error: redeclaration of 'a' with no linkage
8 | int a;
| ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
4 | int a,b,c,d,e;
| ^
|
s658118165 | p00515 | C | #include <stdio.h>
int main(void) {
int a,b,c,d,e;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
if(a<40){
a=40;
}
else(b<40){
b=40;
}
else(c<40){
c=40;
}
else(d<40){
d=40;
}
else(e<40){
e=40;
}
a=(a+b+c+d+e)/5;
int a;
printf("%d\n",a);
// your code goes here
return 0;
} | main.c: In function 'main':
main.c:10:19: error: expected ';' before '{' token
10 | else(b<40){
| ^
| ;
main.c:23:13: error: redeclaration of 'a' with no linkage
23 | int a;
| ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
4 | int a,b,c,d,e;
| ^
|
s224897854 | p00515 | C | #include <stdio.h>
int main(void) {
int a,b,c,d,e;
scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
if(a<40){
a=40;
}
else if(b<40){
b=40;
}
else if(c<40){
c=40;
}
else if(d<40){
d=40;
}
else if(e<40){
e=40;
}
a=(a+b+c+d+e)/5;
int a;
printf("%d\n",a);
// your code goes here
return 0;
} | main.c: In function 'main':
main.c:23:13: error: redeclaration of 'a' with no linkage
23 | int a;
| ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
4 | int a,b,c,d,e;
| ^
|
s740676265 | p00515 | C | #include<stdio.h>
int main(void)
{
int n[5];
int i;
int avr = 0;
for(i = 0;i < 5;i++)
{
scanf("%d".&n[i]);
}
for(i = 0;i < 5;i++)
{
if(n[i] < 40)
{
n[i] = 40;
}
}
for(i = 0;i < 5;i++)
{
avr += n[i];
}
avr = avr / 5;
printf("%d".avr);
return 0;
} | main.c: In function 'main':
main.c:10:28: error: expected identifier before '&' token
10 | scanf("%d".&n[i]);
| ^
main.c:24:20: error: request for member 'avr' in something not a structure or union
24 | printf("%d".avr);
| ^
|
s923150733 | p00515 | C | #include <stdio.h>
int fun1(int data[], int n);
int main()
{
int const n = 5;
int i,data[n];
for(i=0; i<n; i++)
{
scanf("%d",&data[i]);
if(data[i]<40)
{
data[i]=40;
}
}
printf("%d",fun1(data,n));
return 0;
}
int fun2(int data[], int n)
{
int i,average = 0;
for(i=0; i<n; i++)
{
average += data[i];
}
return average/n;
} | /usr/bin/ld: /tmp/cc4VZMEU.o: in function `main':
main.c:(.text+0xd3): undefined reference to `fun1'
collect2: error: ld returned 1 exit status
|
s710456827 | p00515 | C | #include <stdio.h>
int main(void) {
int a
scanf("%d",&a);
int b;
scanf("%d",&b);
int c;
scanf("%d",&c);
int d;
scanf("%d",&d);
int e;
scanf("%d",&e);
int s;
s= a+b+c+d+e;
printf("%d\n",s/5);
return 0;
}
| main.c: In function 'main':
main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
4 | scanf("%d",&a);
| ^~~~~
main.c:4:21: error: 'a' undeclared (first use in this function)
4 | scanf("%d",&a);
| ^
main.c:4:21: note: each undeclared identifier is reported only once for each function it appears in
|
s634557287 | p00515 | C++ | #include <iostream>
using namespace std;
int main() {
int T, J, S, Y, H;
cin >> T >> J >> S >> y >> H;
if(T<40){
T = 40;
}
if(J<40){
J = 40;
}
if(S<40){
S = 40;
}
if(Y<40){
Y = 40;
}
if(H<40){
H = 40;
}
cout << (I + J + S + Y + H)/5 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:25: error: 'y' was not declared in this scope
6 | cin >> T >> J >> S >> y >> H;
| ^
a.cc:24:11: error: 'I' was not declared in this scope
24 | cout << (I + J + S + Y + H)/5 << endl;
| ^
|
s163769189 | p00515 | C++ | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);} | a.cc:1:1: error: 'i' does not name a type
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:31: error: 'a' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:19: error: 'scanf' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~~
a.cc:1:48: error: 's' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:53: error: 'i' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:77: error: 's' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:63: error: 'printf' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
|
s809663475 | p00515 | C++ | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);} | a.cc:1:1: error: 'i' does not name a type
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:31: error: 'a' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:19: error: 'scanf' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~~
a.cc:1:48: error: 's' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:53: error: 'i' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:77: error: 's' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^
a.cc:1:63: error: 'printf' was not declared in this scope
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
|
s349431569 | p00515 | C++ | #include <iostream>
using namespace std;
int main(){
int a[5],sum=0;
for(int i=0;i<5++i){
cin>>a[i];
if(a[i]<40) a[i];
sum+=a[i];
}
cout << sum/5 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: lvalue required as increment operand
7 | for(int i=0;i<5++i){
| ^
a.cc:7:20: error: expected ';' before 'i'
7 | for(int i=0;i<5++i){
| ^
| ;
|
s290087927 | p00515 | C++ | #include<stdio.h>
int main(){
int s=0,x;
for(inti=0;i<5;i++)
{scanf("%d",&x);if(x<40)x=40;s+=x;}
printf("%d\n",x/5);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'inti' was not declared in this scope; did you mean 'int'?
5 | for(inti=0;i<5;i++)
| ^~~~
| int
a.cc:5:12: error: 'i' was not declared in this scope
5 | for(inti=0;i<5;i++)
| ^
|
s970178770 | p00515 | C++ | #include<iostream>
int main{
int a[5];
int b;
for(int i; i<5; i++){
cin>>a[i];
b=b+a[i];
}
cout<<b/5<<endl;
}
| a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
4 | int a[5];
| ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:6:3: error: expected unqualified-id before 'for'
6 | for(int i; i<5; i++){
| ^~~
a.cc:6:14: error: 'i' does not name a type
6 | for(int i; i<5; i++){
| ^
a.cc:6:19: error: 'i' does not name a type
6 | for(int i; i<5; i++){
| ^
a.cc:10:3: error: 'cout' does not name a type
10 | cout<<b/5<<endl;
| ^~~~
a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
|
s222349430 | p00515 | C++ | #include<iostream>
using namespace std;
int main{
int a[5];
int b;
for(int i; i<5; i++){
cin>>a[i];
b=b+a[i];
}
cout<<b/5<<endl;
}
| a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main{
| ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
4 | int a[5];
| ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
3 | int main{
| ^
a.cc:6:3: error: expected unqualified-id before 'for'
6 | for(int i; i<5; i++){
| ^~~
a.cc:6:14: error: 'i' does not name a type
6 | for(int i; i<5; i++){
| ^
a.cc:6:19: error: 'i' does not name a type
6 | for(int i; i<5; i++){
| ^
a.cc:10:3: error: 'cout' does not name a type
10 | cout<<b/5<<endl;
| ^~~~
a.cc:11:1: error: expected declaration before '}' token
11 | }
| ^
|
s716602091 | p00515 | C++ | #include<iostream>
using namespace std;
int main(){
int a[5];
int b=0;
for(int i; i<5; i++){
cin>>a[i];
a[i]=a[i]/5
if(a[i]<8){
a[i]=8}
b=b+a[i];
}
cout<<b<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before 'if'
9 | a[i]=a[i]/5
| ^
| ;
10 | if(a[i]<8){
| ~~
|
s307968556 | p00515 | C++ | #include<iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <set>
#include <string.h>
#include <functional>
using namespace std;
int main()
{
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
if(a<40)
a=40;
if(b<40)
b=40;
if(c<40)
c=40;
if(d<40)
d=40;
if(e<40)
e=40;
cout<<(s+b+c+d+e)/5<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:30:12: error: 's' was not declared in this scope
30 | cout<<(s+b+c+d+e)/5<<endl;
| ^
|
s171394557 | p00515 | C++ | #include<stdio.h>
int main(){
int data[10], i, sum, ave;
for(i = 1, i <= 5, i++){
scanf("%d", &data[i]);
if(data[i] < 40) data[i] = 40;
sum += data[i];
}
ave = sum / 5;
printf("%d", ave);
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before ')' token
5 | for(i = 1, i <= 5, i++){
| ^
| ;
a.cc:11:19: error: expected ')' before ';' token
11 | printf("%d", ave);
| ^
| )
a.cc:5:5: note: to match this '('
5 | for(i = 1, i <= 5, i++){
| ^
|
s197778060 | p00515 | C++ | #include<stdio.h>
int main(){
int data[10], i, sum = 0, ave;
for(i = 1, i <= 5, i++){
scanf("%d", &data[i]);
if(data[i] < 40) data[i] = 40;
sum += data[i];
}
ave = sum / 5;
printf("%d", ave);
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before ')' token
5 | for(i = 1, i <= 5, i++){
| ^
| ;
a.cc:11:19: error: expected ')' before ';' token
11 | printf("%d", ave);
| ^
| )
a.cc:5:5: note: to match this '('
5 | for(i = 1, i <= 5, i++){
| ^
|
s665802612 | p00515 | C++ | JOI13-quest1.cpp Defines the entry point for the console application.
#include <stdio.h>
int main(void)
{
int temp, sum = 0;
for (int i = 0; i 5; i++) {
scanf(%d, &temp);
if (temp = 40) {
sum += temp;
}
else {
sum += 40;
}
}
printf(%dn, sum 5);
return 0;
} | a.cc:1:2: error: 'JOI13' does not name a type
1 | JOI13-quest1.cpp Defines the entry point for the console application.
| ^~~~~
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before numeric constant
10 | for (int i = 0; i 5; i++) {
| ^ ~
| ;
a.cc:10:29: error: expected ')' before ';' token
10 | for (int i = 0; i 5; i++) {
| ~ ^
| )
a.cc:10:31: error: 'i' was not declared in this scope
10 | for (int i = 0; i 5; i++) {
| ^
a.cc:21:16: error: expected primary-expression before '%' token
21 | printf(%dn, sum 5);
| ^
a.cc:21:17: error: 'dn' was not declared in this scope
21 | printf(%dn, sum 5);
| ^~
a.cc:21:24: error: expected ')' before numeric constant
21 | printf(%dn, sum 5);
| ~ ^ ~
| )
a.cc:21:9: error: 'printf' was not declared in this scope
21 | printf(%dn, sum 5);
| ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
4 | #include <stdio.h>
+++ |+#include <cstdio>
5 |
|
s847191004 | p00515 | C++ | JOI13-quest1.cpp Defines the entry point for the console application.
#include <stdio.h>
int main(void)
{
int temp, sum = 0;
for (int i = 0; i 5; i++) {
scanf("%d", &temp);
if (temp = 40) {
sum += temp;
}
else {
sum += 40;
}
}
printf("%d\n" sum / 5);
return 0;
} | a.cc:1:2: error: 'JOI13' does not name a type
1 | JOI13-quest1.cpp Defines the entry point for the console application.
| ^~~~~
a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before numeric constant
8 | for (int i = 0; i 5; i++) {
| ^ ~
| ;
a.cc:8:29: error: expected ')' before ';' token
8 | for (int i = 0; i 5; i++) {
| ~ ^
| )
a.cc:8:31: error: 'i' was not declared in this scope
8 | for (int i = 0; i 5; i++) {
| ^
a.cc:19:22: error: expected ')' before 'sum'
19 | printf("%d\n" sum / 5);
| ~ ^~~~
| )
a.cc:19:9: error: 'printf' was not declared in this scope
19 | printf("%d\n" sum / 5);
| ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
3 | #include <stdio.h>
+++ |+#include <cstdio>
4 |
|
s514599822 | p00515 | C++ | //JOI13-quest1.cpp Defines the entry point for the console application.
#include <stdio.h>
int main(void)
{
int temp, sum = 0;
for (int i = 0; i 5; i++) {
scanf("%d", &temp);
if (temp = 40) {
sum += temp;
}
else {
sum += 40;
}
}
printf("%d\n" sum / 5);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before numeric constant
8 | for (int i = 0; i 5; i++) {
| ^ ~
| ;
a.cc:8:29: error: expected ')' before ';' token
8 | for (int i = 0; i 5; i++) {
| ~ ^
| )
a.cc:8:31: error: 'i' was not declared in this scope
8 | for (int i = 0; i 5; i++) {
| ^
a.cc:19:22: error: expected ')' before 'sum'
19 | printf("%d\n" sum / 5);
| ~ ^~~~
| )
|
s199364798 | p00515 | C++ | //JOI13-quest1.cpp Defines the entry point for the console application.
#include <stdio.h>
int main(void)
{
int temp, sum = 0;
for (int i = 0; i < 5; i++) {
scanf("%d", &temp);
if (temp == 40) {
sum += temp;
}
else {
sum += 40;
}
}
printf("%d\n" sum / 5);
return 0;
} | a.cc: In function 'int main()':
a.cc:19:22: error: expected ')' before 'sum'
19 | printf("%d\n" sum / 5);
| ~ ^~~~
| )
|
s915312809 | p00515 | C++ | #include<iostream>
int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);} | a.cc:2:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:20: error: 'i' was not declared in this scope
2 | int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);}
| ^
|
s892878322 | p00515 | C++ | #include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);} | a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:50: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
|
s194250776 | p00515 | C++ | #include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);} | a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:50: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
|
s182478333 | p00515 | C++ | #include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;} | a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:50: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
a.cc:2:77: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s242501805 | p00515 | C++ | // Example program
#include <iostream>
using namespace std;
int main()
{
int a; int b; int c; int d; int e;
cin>>a>>b>>c>>d<<e;
if(a<40){
a==40
}else{
a==a
}
if(b<40){
b==40
}else{
b==b
}
if(c<40){
c==40
}else{
c==c
}
if(d<40){
d==40
}else{
d==d
}
if(d<40){
d==40
}else{
d==d
}
cout << (a+b+c+d+e)/5 << endl;
} | a.cc: In function 'int main()':
a.cc:8:20: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
8 | cin>>a>>b>>c>>d<<e;
| ~~~~~~~~~~~~~~~^~~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:8:20: note: candidate: 'operator<<(int, int)' (built-in)
8 | cin>>a>>b>>c>>d<<e;
| ~~~~~~~~~~~~~~~^~~
a.cc:8:20: 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/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:2:
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
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:8:17: note: cannot convert '(&(&(& std::cin.std::basic_istream<char>::operator>>(a))->std::basic_istream<char>::operator>>(b))->std::basic_istream<char>::operator>>(c))->std::basic_istream<char>::operator>>(d)' (type 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin>>a>>b>>c>>d<<e;
| ~~~~~~~~~~~~^~~
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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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:8:22: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin>>a>>b>>c>>d<<e;
| ^
/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> |
s918502558 | p00515 | C++ | n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);} | a.cc:1:1: error: 'n' does not name a type
1 | n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);}
| ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
1 | n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);}
| ^
|
s564944439 | p00515 | C++ | 5.times{n=gets.to_i;m+=n}p m/5 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5.times{n=gets.to_i;m+=n}p m/5
| ^~~~~~~
a.cc:1:26: error: 'p' does not name a type
1 | 5.times{n=gets.to_i;m+=n}p m/5
| ^
|
s323804801 | p00515 | C++ |
public class averagescore1 {
public static void main(String[] args) {
import java.util.Scanner;
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int [5];
int i, sum = 0;
for(i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
}
//System.out.printf("%d\n", score[0]);
for(int k = 0; k < 5; k++){
sum = sum + score[k];
}
System.out.printf("%d\n", sum / 5);
}
} | a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class averagescore1 {
| ^~~~~~
|
s751482866 | p00515 | C++ | public class Main {
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner sc = new Scanner(System.in);
int[] score = new int [5];
int i, sum = 0;
for(i = 0; i < 5; i++){
score[i] = sc.nextInt();
if(score[i] < 40){
score[i] = 40;
}
}
//System.out.printf("%d\n", score[0]);
for(int k = 0; k < 5; k++){
sum = sum + score[k];
}
System.out.printf("%d\n", sum / 5);
}
} | a.cc:1:1: error: expected unqualified-id before 'public'
1 | public class Main {
| ^~~~~~
|
s639098856 | p00515 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,e,x;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
x=(a+b+c+d+e)/5;
printf("%d\n"x);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: unable to find string literal operator 'operator""x' with 'const char [4]', 'long unsigned int' arguments
7 | printf("%d\n"x);
| ^~~~~~~
|
s078637217 | p00515 | C++ | ans = 0
for i in range(5):
ans += max(40,int(input())) // 5
print(ans) | a.cc:1:1: error: 'ans' does not name a type
1 | ans = 0
| ^~~
|
s460024534 | p00515 | C++ | #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int a[5],s=0;
r(i,5)cin>>a[i];
r(i,5){
if(a[i]<40)s+=40;
else s+=a[i]
}
cout<<s/5<<endl;
} | a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before '}' token
9 | else s+=a[i]
| ^
| ;
10 | }
| ~
|
s670443779 | p00515 | C++ | #include<iostream>
using namespace std;
int main(){
for (i=1; i<=5; i++){
cin >> p;
if(p < 40) { p = 40; }
sum += p;
}
cout << sum / 5 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:6: error: 'i' was not declared in this scope
4 | for (i=1; i<=5; i++){
| ^
a.cc:5:12: error: 'p' was not declared in this scope
5 | cin >> p;
| ^
a.cc:7:4: error: 'sum' was not declared in this scope
7 | sum += p;
| ^~~
a.cc:9:9: error: 'sum' was not declared in this scope
9 | cout << sum / 5 << endl;
| ^~~
|
s887164615 | p00515 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main (void)
{
int a[5],con;
for (int i = 0; i < 5; i++)
{
cin >> a;
if (a < 40)
{
a = 0;
a = 40;
}
con += a;
}
cout << con / 5 << endl;
} | a.cc: In function 'int main()':
a.cc:20:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [5]')
20 | cin >> a;
| ~~~ ^~ ~
| | |
| | int [5]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
20 | cin >> a;
| ^
/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>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&'
/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>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&'
/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>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&'
/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>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&'
/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>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&'
/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>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&'
/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>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&'
/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>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
20 | cin >> a;
| ^
| |
| int*
a.cc:20:24: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&'
/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>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:20:24: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
20 | cin >> a;
| ^
/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 'int [5]' 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 'int [5]' 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 'int [5]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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 'int [5]' 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 argu |
s407230532 | p00515 | C++ | #include <iostream>
using namespace std;
int main ()
{
int a[i],con;
for (int i = 0; i < 5; i++)
{
cin >> a;
if (a[i] < 40)
{
a[i] = 0;
a[i] = 40;
}
con += a[i];
}
cout << con / 5 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:15: error: 'i' was not declared in this scope
7 | int a[i],con;
| ^
a.cc:11:24: error: 'a' was not declared in this scope
11 | cin >> a;
| ^
|
s764809255 | p00515 | C++ | #include <iostream>
using namespace std;
int main ()
{
int a[3000],con;
for (int i = 0; i < 5; i++)
{
cin >> a;
if (a[i] < 40)
{
a[i] = 0;
a[i] = 40;
}
con += a[i];
}
cout << con / 5 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [3000]')
11 | cin >> a;
| ~~~ ^~ ~
| | |
| | int [3000]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
11 | cin >> a;
| ^
/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>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&'
/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>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&'
/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>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&'
/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>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&'
/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>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&'
/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>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&'
/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>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&'
/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>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&'
/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>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
11 | cin >> a;
| ^
/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 'int [3000]' 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 'int [3000]' 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 'int [3000]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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 'int [3000]' 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 c |
s128011113 | p00515 | C++ | #include <iostream>
using namespace std;
int main ()
{
int a[300],con;
for (int i = 0; i < 5; i++)
{
cin >> a;
if (a[i] < 40)
{
a[i] = 0;
a[i] = 40;
}
con += a[i];
}
cout << con / 5 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [300]')
11 | cin >> a;
| ~~~ ^~ ~
| | |
| | int [300]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
11 | cin >> a;
| ^
/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>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&'
/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>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&'
/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>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&'
/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>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&'
/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>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&'
/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>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&'
/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>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&'
/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>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
11 | cin >> a;
| ^
| |
| int*
a.cc:11:24: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&'
/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>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:11:24: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
11 | cin >> a;
| ^
/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 'int [300]' 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 'int [300]' 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 'int [300]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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 'int [300]' 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 convers |
s711236727 | p00515 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,e,f;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&f);
x=(a+b+c+d+f)/5;
printf("%d\n",x);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'x' was not declared in this scope
6 | x=(a+b+c+d+f)/5;
| ^
|
s853774945 | p00515 | C++ | #include<stdio.h>
#include <iostream>
#include<string>
#include<algorithm>
#include<sstream>
#include<math.h>
int main() {
int a[5];
int ans=0;
for (int i = 0; i < 5; i++) {
cin >> a[i];
if (a[i] < 40)a[i] = 40;
ans += a[i] / 5;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
11 | cin >> a[i];
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
15 | cout << ans << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:15:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
15 | cout << ans << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s859148647 | p00515 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, c, d, e,f;
cin >> a, b, c, d, e;
f =(a + b + c + d + e) / 5
cout << f<< endl;
}
| a.cc: In function 'int main()':
a.cc:6:27: error: expected ';' before 'cout'
6 | f =(a + b + c + d + e) / 5
| ^
| ;
7 | cout << f<< endl;
| ~~~~
|
s361440418 | p00515 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
if(a < 40) {
a = 40
}
if(b < 40) {
b = 40
}
if(c < 40) {
c = 40
}
if(d < 40) {
d = 40
}
if(e < 40) {
e = 40
}
cout << (a+b+c+d+e)/5 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before '}' token
8 | a = 40
| ^
| ;
9 | }
| ~
a.cc:11:13: error: expected ';' before '}' token
11 | b = 40
| ^
| ;
12 | }
| ~
a.cc:14:13: error: expected ';' before '}' token
14 | c = 40
| ^
| ;
15 | }
| ~
a.cc:17:13: error: expected ';' before '}' token
17 | d = 40
| ^
| ;
18 | }
| ~
a.cc:20:13: error: expected ';' before '}' token
20 | e = 40
| ^
| ;
21 | }
| ~
|
s004598763 | p00515 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin >>a>>b>>c>>d>>e;
if(a<40)
a=40;
if(b<40)
b=40;
if(c<40)
c=40;
if(d<40)
d=40;
if(e<40)
e=40;
}
cout<<(a+b+c+d+e)/5<<endl;
return 0;
}
| a.cc:21:1: error: 'cout' does not name a type
21 | cout<<(a+b+c+d+e)/5<<endl;
| ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
22 | return 0;
| ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s891000490 | p00515 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin >>a>>b>>c>>d>>e;
if(a<40)
a=40;
if(b<40)
b=40;
if(c<40)
c=40;
if(d<40)
d=40;
if(e<40)
e=40;
}
cout<<(a+b+c+d+e)/5<<endl;
return 0;
}
| a.cc:21:1: error: 'cout' does not name a type
21 | cout<<(a+b+c+d+e)/5<<endl;
| ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
22 | return 0;
| ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s210043837 | p00515 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin >>a>>b>>c>>d>>e;
if(a<40)
a=40;
if(b<40)
b=40;
if(c<40)
c=40;
if(d<40)
d=40;
if(e<40)
e=40;
}
cout<<(a+b+c+d+e)/5<<endl;
return 0;
}
| a.cc:21:1: error: 'cout' does not name a type
21 | cout<<(a+b+c+d+e)/5<<endl;
| ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
22 | return 0;
| ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s521551388 | p00515 | C++ | #include<iosteam>
using namespase std;
int main(){
int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;
if( a<40 ){
a=40;
}
if( b<40 ){
b=40;
}
if( c<40 ){
c=40;
}
if( d<40 ){
d=40;
}
if( e<40 ){
e=40;
}
cout << (a+b+c+d+e)/5 << endl;
return 0;
}
| a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s749794728 | p00515 | C++ | #include<iosteam>
using namespase std;
int main(){
int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;
int m=0;
if( a<40 ){
m += 40;
}
else{
m += a;
}
if( b<40 ){
m += 40;
}
else{
m += b;
}
if( c<40 ){
m += 40;
}
else{
m += c;
}
if( d<40 ){
m += 40;
}
else{
m += d;
}
if( e<40 ){
m += 40;
}
else{
m += e;
}
cout << m/5 << endl;
return 0;
}
| a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s792467459 | p00515 | C++ | #include<iostream>
using namespase std;
int main(){
int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;
int m=0;
if( a<40 ){
m += 40;
}
else{
m += a;
}
if( b<40 ){
m += 40;
}
else{
m += b;
}
if( c<40 ){
m += 40;
}
else{
m += c;
}
if( d<40 ){
m += 40;
}
else{
m += d;
}
if( e<40 ){
m += 40;
}
else{
m += e;}
cout << m/5 << endl;
return 0;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> a >> b >> c >> d >> e;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:43:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
43 | cout << m/5 << 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:43:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
43 | cout << m/5 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s058583362 | p00515 | C++ | #include<iostream>
using namespase std;
int main(){
int a,b,c,d,e;
cin >> a >> b >> c >> d >> e;
int m=0;
if( a<40 ){
m += 40;
}
else{
m += a;
}
if( b<40 ){
m += 40;
}
else{
m += b;
}
if( c<40 ){
m += 40;
}
else{
m += c;
}
if( d<40 ){
m += 40;
}
else{
m += d;
}
if( e<40 ){
m += 40;
}
else{
m += e;}
cout << m/5 << endl;
return 0;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> a >> b >> c >> d >> e;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:43:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
43 | cout << m/5 << 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:43:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
43 | cout << m/5 << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s659828593 | p00515 | C++ | #include<iostream>
using namespace std;
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
if (a < 40) {
a=40
}
if (b < 40) {
b = 40
}
if (c < 40) {
c = 40
}
if (d < 40) {
d = 40
}
if (e < 40) {
e = 40
}
cout << (a + b + c + d + e) / 5 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:21: error: expected ';' before '}' token
8 | a=40
| ^
| ;
9 | }
| ~
a.cc:11:23: error: expected ';' before '}' token
11 | b = 40
| ^
| ;
12 | }
| ~
a.cc:14:23: error: expected ';' before '}' token
14 | c = 40
| ^
| ;
15 | }
| ~
a.cc:17:23: error: expected ';' before '}' token
17 | d = 40
| ^
| ;
18 | }
| ~
a.cc:20:23: error: expected ';' before '}' token
20 | e = 40
| ^
| ;
21 | }
| ~
|
s602180914 | p00515 | C++ | #include<iostream>
using namespace std;
int main(i){
int s[2]={0};
for(;i<6;i++){cin >> s[0];
s[1] += s[0]>39?s[0]:40;
}
cout << s[1]/5 << endl;
return 0;
} | a.cc:3:5: error: cannot declare '::main' to be a global variable
3 | int main(i){
| ^~~~
a.cc:3:10: error: 'i' was not declared in this scope
3 | int main(i){
| ^
|
s155563798 | p00515 | C++ | #include<stdio.h>
int main(i){
int a,sum=0;
for(;i<6;i++){
scanf("%d",&a);
sum += a<40?40:a;
}
printf("%d\n",sum/5);
return 0;
} | a.cc:2:5: error: cannot declare '::main' to be a global variable
2 | int main(i){
| ^~~~
a.cc:2:10: error: 'i' was not declared in this scope
2 | int main(i){
| ^
|
s483043024 | p00516 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.Integer.parseInt;
public class P0593 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while ((line = br.readLine()) != null && !line.isEmpty()) {
int n, m;
int[][] vote;
n = parseInt(line.substring(0, line.indexOf(' ')));
m = parseInt(line.substring(line.indexOf(' ') + 1));
vote = new int[n][2];
for (int i = 0; i < n; i++) {
vote[i][0] = parseInt(br.readLine());
}
for (int i = 0; i < m; i++) {
int cost = parseInt(br.readLine());
for (int j = 0; j < n; j++) {
if (vote[j][0] <= cost) {
vote[j][1]++;
break;
}
}
}
int event = 0, max = 0;
for (int i = 0; i < n; i++) {
if (vote[i][1] > max) {
max = vote[i][1];
event = i;
}
}
System.out.println(event + 1);
}
}
} | Main.java:7: error: class P0593 is public, should be declared in a file named P0593.java
public class P0593 {
^
1 error
|
s202636511 | p00516 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner S = new Scanner(System.in);
int N = S.nextInt();
int M = S.nextInt();
int[] A = new int[N];
int[] A_num = new int[N];
int[] B = new int[M];
int answer = 0;
for(int i = 0;i < N;i++){
A[i] = S.nextInt();
}
for(int i = 0;i < M;i++){
B[i] = S.nextInt();
}
for(int j = 0;j < M;j++){
int s = B[j];
for(int i = 0;i < N;i++){
if(s >= A[i]){
A_num[i]++;
break;
}
}
}
int max = A_num[0];
for(int i = 0;i < N;i++){
if(max <= A_num[i]){
max = A_num[i];
answer = i + 1;
}
}
System.out.println(answer);
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s403287714 | p00516 | Java | import java.util.Scanner;
public class text {
public static void main(String[] args){
Scanner S = new Scanner(System.in);
int N = S.nextInt();
int M = S.nextInt();
int[] A = new int[N];
int[] A_num = new int[N];
int[] B = new int[M];
int a = 0;
for(int i = 0;i < N;i++){
A[i] = S.nextInt();
}
for(int i = 0;i < M;i++){
B[i] = S.nextInt();
}
for(int j = 0;j < M;j++){
int s = B[j];
for(int i = 0;i < N;i++){
if(s >= A[i]){
A_num[i]++;
break;
}
}
}
int max = A_num[0];
for(int i = 0;i < N;i++){
if(max <= A_num[i]){
max = A_num[i];
a = i + 1;
}
}
System.out.print(a);
}
} | Main.java:3: error: class text is public, should be declared in a file named text.java
public class text {
^
1 error
|
s865265906 | p00516 | Java | package text;
import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] A = new int[n];
int[] a_monney= new int[n];
int[] b = new int[m];
int answer = 0;
for(int i = 0;i < n;i++){
A[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
int s = b[i];
for(int j = 0;j < n;j++){
if(s >= A[j]){
a_monney[j]++;
break;
}
}
}
int max = a_monney[0];
for(int i = 0;i < n;i++){
if(max <= a_monney[i]){
max = a_monney[i];
answer = i + 1;
}
}
System.out.print(answer);
}
} | Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s237405790 | p00516 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int m = s.nextInt();
int[] A = new int[n];
int[] a_= new int[n];
int[] b = new int[m];
int answer = 0;
for(int i = 0;i < n;i++){
A[i] = s.nextInt();
}
for(int i = 0;i < m;i++){
b[i] = s.nextInt();
}
for(int i = 0;i < m;i++){
int s = b[i];
for(int j = 0;j < n;j++){
if(s >= A[j]){
a_[j]++;
break;
}
}
}
int max = a_[0];
for(int i = 0;i < n;i++){
if(max <= a_[i]){
max = a_[i];
answer = i + 1;
}
}
System.out.print(answer);
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
Main.java:24: error: variable s is already defined in method main(String[])
int s = b[i];
^
2 errors
|
s195549156 | p00516 | Java | import java.util.*;
public class main {
public static void main(String[] args){
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int m = s.nextInt();
int[] A = new int[n];
int[] a_= new int[n];
int[] b = new int[m];
int answer = 0;
for(int i = 0;i < n;i++){
A[i] = s.nextInt();
}
for(int i = 0;i < m;i++){
b[i] = s.nextInt();
}
for(int i = 0;i < m;i++){
int s = b[i];
for(int j = 0;j < n;j++){
if(s >= A[j]){
a_[j]++;
break;
}
}
}
int max = a_[0];
for(int i = 0;i < n;i++){
if(max <= a_[i]){
max = a_[i];
answer = i + 1;
}
}
System.out.print(answer);
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
Main.java:24: error: variable s is already defined in method main(String[])
int s = b[i];
^
2 errors
|
s560494940 | p00516 | Java | package kadai_2;
import java.util.*;
public class vote {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int kyougi[] = new int[N];
int shinsain[] = new int[M];
int vote[] = new int[N];
for(int j = 0; j < N; j++){
kyougi[j] = sc.nextInt();
}
for(int j = 0; j < M; j++){
shinsain[j] = sc.nextInt();
}
for(int i = 0; i < M; i++){
for(int j = 0; j < N; j++){
if(shinsain[i] >= kyougi[j]){
vote[j]++;
break;
}
}
}
int MAX = 0;
for(int i = 0; i < N; i++){
if(vote[MAX] < vote[i]){
MAX = i;
}
}
System.out.println(MAX+1);
}
} | Main.java:5: error: class vote is public, should be declared in a file named vote.java
public class vote {
^
1 error
|
s000244786 | p00516 | Java | import java.io.*;
import java.util.StringTokenizer;
import java.util.Arrays;
class Main{
static final PrintWriter out=new PrintWriter(System.out);
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
StringTokenizer st=new StringTokenizer(line);
int n=Integer.parseInt(st.nextToken());
int m=Integer.parseInt(st.nextToken());
int[] cost=new int[n];
int[] vote1=new int[n];
for(int i=0;i<n;i++) cost[i]=Integer.parseInt(br.readLine());
for(int i=0;i<m;i++){
int judge=Integer.parseInt(br.readLine());
for(int j=0;j<n;j++){
if(cost[j]>judge) continue;
vote1[j]++;
break;
}
}
int[] vote2=vote1.clone();
Arrays.sort(vote2);
int max=vote2[n-1];
for(int i=0;i<n;i++){
if(vote1[i]==max){
out.prntln(i+1);
break;
}
}
out.flush();
}
}
} | Main.java:32: error: cannot find symbol
out.prntln(i+1);
^
symbol: method prntln(int)
location: variable out of type PrintWriter
1 error
|
s322661809 | p00516 | Java | public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n,m;
n = sc.nextInt();
m = sc.nextInt();
int a[] = new int[n];
int b[] = new int[m];
int vote[] = new int[n];
int max = 0;
int answer = 0;
for(int i=0;i<n;i++){
a[i] = sc.nextInt();
}
for(int i=0;i<m;i++){
b[i] = sc.nextInt();
}
for(int i=0;i<m;i++){
int j = 0;
while(b[i] < a[j]){
j++;
}
vote[j] ++;
}
for(int i=0;i<n;i++){
if(vote[i] > answer){
max = vote[i];
answer = i+1;
}
}
System.out.println(answer);
}
} | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s779608860 | p00516 | Java | package Spring;
import java.util.*;
public class Main1 {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a[] = new int[n];//??¶???????????¨
int b[] = new int[m];//????????????
int cnt[] = new int[n];//????????????
int max = 0, idx = 0;//?????§?????¨????????????????????????
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
cnt[i] = 0;//????????????????????????
}
for(int i = 0;i < m;i++){
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
for(int k = 0;k < n;k++){
if(a[k] <= b[i]){
cnt[k]++;
break;
}
}
}
for(int i = 0;i < n;i++){
if(max < a[i]){
max = a[i];
idx = i;
}
}
System.out.println(idx);
}
} | Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
1 error
|
s443822890 | p00516 | Java | import java.util.*;
public class Main1 {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int a[] = new int[n];//??¶???????????¨
int b[] = new int[m];//????????????
int cnt[] = new int[n];//????????????
int max = 0, idx = 0;//?????§?????¨????????????????????????
for(int i = 0;i < n;i++){
a[i] = sc.nextInt();
cnt[i] = 0;//????????????????????????
}
for(int i = 0;i < m;i++){
b[i] = sc.nextInt();
}
for(int i = 0;i < m;i++){
for(int k = 0;k < n;k++){
if(a[k] <= b[i]){
cnt[k]++;
break;
}
}
}
for(int i = 0;i < n;i++){
if(max < a[i]){
max = a[i];
idx = i;
}
}
System.out.println(idx);
}
} | Main.java:2: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.