submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s576217400 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int count = 0;
for (int X = 0; X <= K; X ++){
for (int Y = 0; Y <= K; Y ++){
for (int Z = 0; Z <= K; Z ++){
if (X + Y + Z = S){
count ++;
}
}
}
}
cout << count << '\n';
} | a.cc: In function 'int main()':
a.cc:11:19: error: lvalue required as left operand of assignment
11 | if (X + Y + Z = S){
| ~~~~~~^~~
|
s928284892 | p03835 | C++ | int main(void)
{
int K, S, t, z;
cin >> K >> S;
t = 0;
for(int x = 0; x <= K; x++){
for(int y = 0; y <= K; y++){
z = S - x - y;
if(0 <= z &&z <= K){
t++;
}
}
}
cout << t << endl;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> K >> S;
| ^~~
a.cc:14:3: error: 'cout' was not declared in this scope
14 | cout << t << endl;
| ^~~~
a.cc:14:16: error: 'endl' was not declared in this scope
14 | cout << t << endl;
| ^~~~
|
s759136072 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
int count=0;
for(int i=0; i<=K; i++;){
for(int j=0; j<=K; j++;){
if(S-K <= (i+j) && (i+j)<= S){
count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:25: error: expected ')' before ';' token
10 | for(int i=0; i<=K; i++;){
| ~ ^
| )
a.cc:10:26: error: expected primary-expression before ')' token
10 | for(int i=0; i<=K; i++;){
| ^
|
s167084020 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
int K,S;
cin >> K >> S;
int ans = 0;
for(int x = 0; x <= K; x++)
{
for(int y = 0; y <= K; y++S)
{
int z = S - x - y;
if(0 <= z and z <= K)
{
ans = ans + 1;
}
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:14:30: error: expected ')' before 'S'
14 | for(int y = 0; y <= K; y++S)
| ~ ^
| )
a.cc:14:31: error: expected ';' before ')' token
14 | for(int y = 0; y <= K; y++S)
| ^
| ;
|
s005831145 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
2 int K,S;
3 cin >> K >> S;
4
1
5 int ans = 0;
6
7 for(int x = 0; x <= K; ++x){
8 for(int y = 0; y <= K; ++y){
9 int z = S - x - y;
10 if(0 <= z and z <= K){
11 ans = ans + 1;
12 }
13 }
14 }
15
16 cout << ans << endl;
17
18 }
| a.cc: In function 'int main()':
a.cc:6:2: error: expected ';' before 'int'
6 | 2 int K,S;
| ^~~~
| ;
a.cc:7:2: error: expected ';' before 'cin'
7 | 3 cin >> K >> S;
| ^~~~
| ;
a.cc:8:2: error: expected ';' before numeric constant
8 | 4
| ^
| ;
9 | 1
| ~
a.cc:11:2: error: expected ';' before numeric constant
11 | 6
| ^
| ;
12 | 7 for(int x = 0; x <= K; ++x){
| ~
a.cc:12:18: error: 'x' was not declared in this scope
12 | 7 for(int x = 0; x <= K; ++x){
| ^
a.cc:12:23: error: 'K' was not declared in this scope
12 | 7 for(int x = 0; x <= K; ++x){
| ^
a.cc:20:3: error: expected ';' before numeric constant
20 | 15
| ^
| ;
21 | 16 cout << ans << endl;
| ~~
a.cc:22:3: error: expected ';' before numeric constant
22 | 17
| ^
| ;
23 | 18 }
| ~~
|
s731441144 | p03835 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int ans = 0;
for (int i = 0; i <= k; i++) {
for (int j = 0; j <= k; j++) {
for (int l = 0; l <= k; l++) {
if(i + j + l == s) ans++;
}
}
}
System.out.println(ans);
}
| Main.java:17: error: reached end of file while parsing
}
^
1 error
|
s284920454 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007
void setIO(string name) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((name+".in").c_str(),"r",stdin);
freopen((name+".out").c_str(),"w",stdout);
}
void fast(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
}
int main() {
fast();
int k,s;
cin>>k>>s;
int sum=0;
//int i=s/3;
for(int x=i;x<=min(s,k);x++){
for(int y=x;y<=min(s,k);y++){
if(x+y>s){
x=k+1;
break;
}
for(int z=y;z<=min(s,k);z++){
if(x+y+z>s){
x=k+1;
y=k+1;
break;
}
if(x+y+z==s){
if(x==y && y==z && x==z){
sum+=1;
}else if(x==y || y==z || x==z){
sum+=3;
}else{
sum+=6;
}
}
}
}
}
cout<<sum<<"\n";
} | a.cc: In function 'int main()':
a.cc:25:14: error: 'i' was not declared in this scope
25 | for(int x=i;x<=min(s,k);x++){
| ^
|
s530491176 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K,S;
cin >> K >> S;
int count = 0;
for(int x = 0; x <= K; x++){
for(int y = 0; y <= K; y++){
int z = S - x - y;
if(z >= 0 && z <= K){
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s512242660 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K,S;
cin >> K >> S;
int count = 0;
for(int x = 0; x <= K; x++){
for(int y = 0; y <= K; y++){
for(int z = 0; z <= K; z++){
if( (x + y + z) == S){
count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s452011675 | p03835 | C++ | // lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define int long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
string str;
int k;
cin>>k>>n;
int v[k+1];
int w[(k+1)+(k+1)];
rep(i,k+1){
v[i]=i;
//cout<<i<<" ";
}
//ln;
rep(i,k+1){
rep(j,k+1){
w[i*(k+1)*j];
// cout<<v[i]+v[j]<<" ";
}
}
//ln;
map<int,int> mp;
rep(i,(k+1)*(k+1)){
rep(j,k+1){
mp[w[i]+v[j]]++;
}
}
cout<<mp[n]<<endl;
return 0;
}
| cc1plus: error: '::main' must return 'int'
|
s779423837 | p03835 | C++ | // lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
string str;
ll k;
cin>>k>>n;
ll v[k+1];
vector<ll> w;
rep(i,k+1){
v[i]=i;
//cout<<i<<" ";
}
//ln;
rep(i,k+1){
rep(j,k+1){
w.push_back(v[i]+v[j]);
// cout<<v[i]+v[j]<<" ";
}
}
//ln;
map<ll,ll> mp;
rep(i,(k+1)*(k+1))){
rep(j,k+1){
mp[w[i]+v[j]]++;
}
}
cout<<mp[n]<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:37:23: error: expected primary-expression before ')' token
37 | rep(i,(k+1)*(k+1))){
| ^
|
s856559319 | p03835 | C++ | // lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
string str;
ll k;
cin>>k>>n;
ll v[n+1];
vector<ll> w;
rep(i,k+1){
v[i]=i;
//cout<<i<<" ";
}
//ln;
rep(i,v.size()){
rep(j,v.size()){
w.push_back(v[i]+v[j]);
// cout<<v[i]+v[j]<<" ";
}
}
//ln;
map<ll,ll> mp;
rep(i,w.size()){
rep(j,v.size()){
mp[w[i]+v[j]]++;
}
}
cout<<mp[n]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:29:13: error: request for member 'size' in 'v', which is of non-class type 'long long int [(n + 1)]'
29 | rep(i,v.size()){
| ^~~~
a.cc:10:44: note: in definition of macro 'REP'
10 | #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
| ^
a.cc:29:5: note: in expansion of macro 'rep'
29 | rep(i,v.size()){
| ^~~
a.cc:30:17: error: request for member 'size' in 'v', which is of non-class type 'long long int [(n + 1)]'
30 | rep(j,v.size()){
| ^~~~
a.cc:10:44: note: in definition of macro 'REP'
10 | #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
| ^
a.cc:30:9: note: in expansion of macro 'rep'
30 | rep(j,v.size()){
| ^~~
a.cc:38:17: error: request for member 'size' in 'v', which is of non-class type 'long long int [(n + 1)]'
38 | rep(j,v.size()){
| ^~~~
a.cc:10:44: note: in definition of macro 'REP'
10 | #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
| ^
a.cc:38:9: note: in expansion of macro 'rep'
38 | rep(j,v.size()){
| ^~~
|
s225522453 | p03835 | C++ | #include <vector>
#include <algorithm>
#include <cmath>
typedef long long ll;
#define rep(i,n) for(int i = 0;i<n;++i)
#define repi(itr,vec) for(auto itr = vec.begin();itr!=vec.end();++itr)
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll k, s;
cin >> k >> s;
ll ans = 0;
rep(i, k+1){
ll yz = s-i;
if(yz>=0){
ll temp = min(yz, k)-max(yz-k,(ll)0)+1;
if(temp>0) ans+=temp;
else continue;
}
else{
break;
}
}
cout << ans << '\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'ios' has not been declared
9 | ios::sync_with_stdio(false);
| ^~~
a.cc:10:9: error: 'cin' was not declared in this scope
10 | cin.tie(nullptr);
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <cmath>
+++ |+#include <iostream>
4 | typedef long long ll;
a.cc:27:3: error: 'cout' was not declared in this scope
27 | cout << ans << '\n';
| ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s390272336 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K,S
cin >> K >> S;
int C = 0
for (int i = 0; i < K; i++) {
for (int j = 0; j < K; j++){
for(int k = 0; k < K; k++){
if(i+j+k == S){
C++;
}
}
}
}
cout << C << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
6 | cin >> K >> S;
| ^~~
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i = 0; i < K; i++) {
| ^~~
a.cc:8:19: error: 'i' was not declared in this scope
8 | for (int i = 0; i < K; i++) {
| ^
|
s318311036 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
cin >> K >> S;
int C = 0
for (int i = 0; i < K; i++) {
for (int j = 0; i < K; j++){
for(int k = 0; i < K; k++){
if(i+j+k == S){
C++;
}
}
}
}
cout << C << endl;
} | a.cc: In function 'int main()':
a.cc:5:10: error: 'K' was not declared in this scope
5 | cin >> K >> S;
| ^
a.cc:5:15: error: 'S' was not declared in this scope
5 | cin >> K >> S;
| ^
a.cc:7:3: error: expected ',' or ';' before 'for'
7 | for (int i = 0; i < K; i++) {
| ^~~
a.cc:7:19: error: 'i' was not declared in this scope
7 | for (int i = 0; i < K; i++) {
| ^
|
s849135618 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{ int n,s;
cin>>n>>s;
long int cnt=0;
for(int i=0;i<=n;i++)
{ int t1=s-i;
if(t1>2*n)
continue;
for(int j=0;j<=n;j++)
{ int t2=t1-j;
if(t2>n)
coninue;
for(int k=0;k<=n;k++)
{ if(i+j+k==s)
cnt++;
}
}
}
cout<<cnt;
} | a.cc: In function 'int main()':
a.cc:14:12: error: 'coninue' was not declared in this scope
14 | coninue;
| ^~~~~~~
|
s824745832 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k,s,ans=0;
cin >> k >> s;
for ( int i=0 ; i<=k ; i++){
for (int j=0 ; j<=k ; i++){
for (int l=0 ; l<=k ; l++){
if ( i+j+l==s){
ans++;
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s435008624 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b,ans=0;
cin>>a>>b;
for(int i=1;i<=a-2;i++)
for(int k=1;k<=a-2;k++)
for(int j=1;j<=a-2;j++)
if(i+k+j==s) ans++;
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 's' was not declared in this scope
10 | if(i+k+j==s) ans++;
| ^
|
s434363972 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int k,s;
int ans = 0;
cin >> k >> s;
for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int k=0;k<=n;k++) if(i+j+k==s) ans++;
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:20: error: 'n' was not declared in this scope
7 | for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int k=0;k<=n;k++) if(i+j+k==s) ans++;
| ^
|
s509987343 | p03835 | C++ | #include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
// int n;
// cin >> n;
// int a[n];
// sort(a, a + n);
// int len = 0;
// for (int i = 0; i < n; i++) cin >> a[i];
// for (int i = 0; i < n; i++) {
// for (int j = i + 1; j < n; j++) {
// for (int k = j + 1; k < n; k++) {
// if (a[i] + a[j] > a[k]) len = max(len, a[i] + a[j] + a[k]);
// }
// }
// }
// cout << len << endl;
// int n;
// cin >> n;
// int x[n], y[n];
// double dist = 0.0;
// for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
// for (int i = 0; i < n; i++) {
// for (int j = i + 1; j < n; j++) {
// dist = max(dist, sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j],
// 2)));
// }
// }
// cout << dist << endl;
int k, s;
cin >> k >> s;
int count = 0;
for (int x = 0; x <= k; x++) {
for (int y = 0; y <= k; y++) {
if(s-x-y<=k)
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:42:9: error: expected primary-expression before '}' token
42 | }
| ^
|
s680207726 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
cin >> K >> S;
int ans =0;
int num = 0;
for(int i=0;i<K;i++){
for(int j=0;j<K;j++){
for(int k=0;k<K;k++){
num = i + j + k;
if (num == S){
ans +=1;
}
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:5:12: error: 'K' was not declared in this scope
5 | cin >> K >> S;
| ^
a.cc:5:17: error: 'S' was not declared in this scope
5 | cin >> K >> S;
| ^
|
s604437005 | p03835 | C++ | #include<iostream>
using namepsace std;
int main(){
cin >> K >> S;
int ans =0;
int num = 0;
for(int i=0;i<K;i++){
for(int j=0;j<K;j++){
for(int k=0;k<K;k++){
num = i + j + k;
if (num == S){
ans +=1;
}
}
}
}
cout << ans << endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
2 | using namepsace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> K >> S;
| ^~~
| 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:5:12: error: 'K' was not declared in this scope
5 | cin >> K >> S;
| ^
a.cc:5:17: error: 'S' was not declared in this scope
5 | cin >> K >> S;
| ^
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
19 | 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:19:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
19 | 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)
| ^~~~
|
s943398337 | p03835 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
int k,s;
int ans = 0;
cin >> k >> s >> endl;
for(x=0;x<=k;x++){
for(y=0,y<=k;y++){
for(z=0;z<=k;z++){
if(x+y+z==s) ans++;
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:8:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
8 | cin >> k >> s >> endl;
| ~~~~~~~~~~~~~~^~~~~~~
In file included 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,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<u |
s259727427 | p03835 | C | #include <stdio.h>
int main(void){
long long K,S,i,j,k;
long long count = 0;
scanf("%lld %lld",&K,&S);
for(i=0;i<K;i++){
for(j=0;j<K;j++){
for(k=0;k<K;k++){
if(i+j+k==S){
count++;
}
}
}
}
prinyf("%d",count);
return 0;
} | main.c: In function 'main':
main.c:19:3: error: implicit declaration of function 'prinyf'; did you mean 'printf'? [-Wimplicit-function-declaration]
19 | prinyf("%d",count);
| ^~~~~~
| printf
|
s771566825 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k, s, sum=0;
cin >> k >> s;
for(int x=0; x <= k; x++){
if(x > s) break;
for(int y=0; y <= k; y++){
if((x+y) > s) break;
if((s-x+y) <= k)) sum++;
}
}
cout << sum << endl;
}
| a.cc: In function 'int main()':
a.cc:12:23: error: expected primary-expression before ')' token
12 | if((s-x+y) <= k)) sum++;
| ^
|
s105185332 | p03835 | C++ | #include <bits/stdc++.h>
int main() {
int S,K,sum=0; cin>>K>>S;
for(int i=0; i<=K; i++) for(int j=0; j<=K; j++) {
if(0 <= S-i-j && S-i-j <= K) sum++;
}
cout<<sum<<endl;
}
| a.cc: In function 'int main()':
a.cc:4:18: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | int S,K,sum=0; cin>>K>>S;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout<<sum<<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:8:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout<<sum<<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)
| ^~~~
|
s764037125 | p03835 | C++ | #include <bits/stdc++/h>
int main() {
int S,K,sum=0; cin>>K>>S;
for(int i=0; i<=K; i++) for(int j=0; j<=K; j++) {
if(0 <= S-i-j && S-i-j <= K) sum++;
}
cout<<sum<<endl;
}
| a.cc:1:10: fatal error: bits/stdc++/h: No such file or directory
1 | #include <bits/stdc++/h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s546021791 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k, s, sum=0;
cin >> k >> s;
for(int x=0; x < s; x++){
if((x+y+z) > s) break;
for(int y=0; y < s; y++){
if((x+y+z) > s) break;
for(int z=0; z < s; z++){
if((x+y+z) > s) break;
if((x+y+z) == z) sum++;
}
}
}
cout << sum << endl;
}
| a.cc: In function 'int main()':
a.cc:9:11: error: 'y' was not declared in this scope
9 | if((x+y+z) > s) break;
| ^
a.cc:9:13: error: 'z' was not declared in this scope
9 | if((x+y+z) > s) break;
| ^
a.cc:11:15: error: 'z' was not declared in this scope
11 | if((x+y+z) > s) break;
| ^
|
s105386437 | p03835 | C++ | k, s = map(int, input().split())
#.
ans = 0
#.
for x in range(k+1):
for y in range(k+1):
#.
des_v = s - x - y
#.
if des_v >= 0 and des_v <= k:
ans += 1
print(ans) | a.cc:3:2: error: invalid preprocessing directive #.
3 | #.
| ^
a.cc:6:2: error: invalid preprocessing directive #.
6 | #.
| ^
a.cc:9:10: error: invalid preprocessing directive #.
9 | #.
| ^
a.cc:12:10: error: invalid preprocessing directive #.
12 | #.
| ^
a.cc:1:1: error: 'k' does not name a type
1 | k, s = map(int, input().split())
| ^
|
s586333039 | p03835 | C++ | #include <bits/stdc++.h>
#include <algorithm>
#include <utility>
typedef long long int lli;
using namespace std;
int main(){
int w,h,n;
cin >> w >> h >> n;
int max_x=w;
int min_x=0;
int max_y=h;
int min_y=0;
for(LL i=0; i<n; i++){
cin >> x >> y >> a;
if(a==1){
min_x=max(min_x,x);
}else if(a==2){
max_x=min(max_x,x);
}else if(a==3){
min_y=max(min_y,y);
}else{
max_y=min(max_y,y);
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:9: error: 'LL' was not declared in this scope
14 | for(LL i=0; i<n; i++){
| ^~
a.cc:14:17: error: 'i' was not declared in this scope
14 | for(LL i=0; i<n; i++){
| ^
a.cc:15:16: error: 'x' was not declared in this scope
15 | cin >> x >> y >> a;
| ^
a.cc:15:21: error: 'y' was not declared in this scope
15 | cin >> x >> y >> a;
| ^
a.cc:15:26: error: 'a' was not declared in this scope
15 | cin >> x >> y >> a;
| ^
|
s541021001 | p03835 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scn = new Scanner(System.in);
int k = scn.nextInt();
int s = scn.nextInt();
int count = 0;
for(int x=0; x<=k; ++x){
for(int y=0; y<=K; ++y){
if(s>=x+y && s-(x+y)<=k){
count = count + 1;
}
}
}
System.out.println(count);
}
}
| Main.java:10: error: cannot find symbol
for(int y=0; y<=K; ++y){
^
symbol: variable K
location: class Main
1 error
|
s627545245 | p03835 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scn = new Scanner(System.in);
int k = scn.nextInt();
int s = scn.nextInt();
int count = 0;
for(int x=0; x<=k; ++x){
for(int y=0; y<=K; ++y){
if(s>=x+y && s-(x+y)<=k){
count = count + 1
}
}
}
System.out.println(count);
}
}
| Main.java:12: error: ';' expected
count = count + 1
^
1 error
|
s233012985 | p03835 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scn = new Scanner(System.in);
int k = scn.nextInt();
int s = scn.nextInt();
int count = 0;
for(int x=0; x<=k; ++x){
for(int y=0; y<=K; ++y){
if(s>=x+y && s-(x+y)<=k){
count = count + 1
}
}
}
System.out.println(count);
}
} | Main.java:12: error: ';' expected
count = count + 1
^
1 error
|
s425652046 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main(){
int K,S;
cin >> K >> S;
int ans = 0;
for(int i = 0;i < K+1;i++){
for(int j = 0;j < K + 1;j++){
if(S-i-j >= 0 && S-i-j <=K){
ans++;
}
}
}
printf("%d\n",ans);
}
int K,S;
cin >> K >> S;
int ans = 0;
for(int i = 0;i < K+1;i++){
for(int j = 0;j < K + 1;j++){
if(S-i-j >= 0){
ans++;
}
}
}
print("%d\n",ans);
}
| a.cc:23:3: error: 'cin' does not name a type
23 | cin >> K >> S;
| ^~~
a.cc:25:3: error: expected unqualified-id before 'for'
25 | for(int i = 0;i < K+1;i++){
| ^~~
a.cc:25:17: error: 'i' does not name a type
25 | for(int i = 0;i < K+1;i++){
| ^
a.cc:25:25: error: 'i' does not name a type
25 | for(int i = 0;i < K+1;i++){
| ^
a.cc:32:8: error: expected constructor, destructor, or type conversion before '(' token
32 | print("%d\n",ans);
| ^
a.cc:33:1: error: expected declaration before '}' token
33 | }
| ^
|
s499855250 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin >> a >> b;
int count = 0;
for(int i=0;i<=a;i++){
for(int j=0;j<=a;j++){
if(i+j>b) break;
if else(i+j+a>=b){
count++;
break;
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:10:8: error: expected '(' before 'else'
10 | if else(i+j+a>=b){
| ^~~~
| (
|
s311946066 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin >> a >> b;
int count = 0;
for(int i=0;i<=a;i++){
for(int j=0;j<=a;j++){
if(i+j+a>=b){
count++;
break;
}
}
}
}
cout << count << endl;
}
| a.cc:16:3: error: 'cout' does not name a type
16 | cout << count << endl;
| ^~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s356480645 | p03835 | C | #include <bits/stdc++.h>
using namespace std;
int three_dist(int x, int y ,int z)
{
int r=0;
if(x != y) r++;
if(x != z) r++;
if(z != y) r++;
return r;
}
int main()
{
double c=0;
int k ,s;
cin >> k >> s;
if (k>=s)
for (int i=0 ,j=s; i<s; --j ,i++)
{
c += 3;
if (i > 1)
{
if (i%2 == 1)
c += 3;
c += (((i/2)-1)*6);
}
}
else
{
int small = (s - 2*k);
for (int i=(small<0 ? 0 :small); i<=k; i++)
{
int y = s-i;
for (int u = y-k; u<=y/2; u++)
{
cout << i<<" "<< u<<" "<< y-u<<" \n";
if (three_dist(i , u ,y-u) == 2)
c += 1.5;
else if (three_dist(i , u ,y-u) == 3)
c += 2;
}
}
}
if (s%3 == 0 && s/3 <= k)
c++;
cout << (s ? c : 1);
return 0;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s384730464 | p03835 | C++ | //3重ループだと2500^3=1.5625*10^10で間に合わない
//2つの文字の値が決まれば残りの文字の値が1つに決まる
//2500^2=6.25*10^6で間に合う
#include <bits/stdc++.h>
using namespace std;
int main(){
int k , s;
cin >> k >> s;
int count =0;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
if((3k-i-j)>=0&&(3k-i-j)<=k) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:15:11: error: fixed-point types not supported in C++
15 | if((3k-i-j)>=0&&(3k-i-j)<=k) count++;
| ^~
a.cc:15:24: error: fixed-point types not supported in C++
15 | if((3k-i-j)>=0&&(3k-i-j)<=k) count++;
| ^~
|
s753530589 | p03835 | C | #include<stdio.h>
int main(){
int K, S, Sum = 0;
scanf("%d%d",&K,&S);
for(int i=0; i<=K; i++){
for(int j=0; j<=K; j++){
if(S-i-j<=K && S-i-j >= 0) Sum++;
}
}
pritnf("%d¥n", Sum);
return 0;
}
| main.c: In function 'main':
main.c:13:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
13 | pritnf("%d¥n", Sum);
| ^~~~~~
| printf
|
s787096302 | p03835 | C | #include<stdio.h>
int main(){
int K, S, Sum = 0;
scanf("%d%d",&K,&S);
for(int i=0; i<=K; i++){
for(int j=0; j<=K; j++){
if(S-i-j<=K && S-i-j >= 0) Sum++;
}
}
cout << Sum << endl;
return 0;
} | main.c: In function 'main':
main.c:13:3: error: 'cout' undeclared (first use in this function)
13 | cout << Sum << endl;
| ^~~~
main.c:13:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:18: error: 'endl' undeclared (first use in this function)
13 | cout << Sum << endl;
| ^~~~
|
s960817659 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int i = 0;
int j = 0;
for(int x = 0;x <= K;x++){
for(int y = 0;y <= K;y++){
for(int z = 0;z <= K;z++){
j = x + y + z;
if(j == S){
i++;
break;
}
j = 0;
}
}
cout<<i<<endl;
} | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s759116771 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
int cnt =0,s=S;
for(int i=0;i<=K;i++){
S=s;
if(S>3*K){
break;
}
S -=i;
if(S>2*K){
continue;
}
if(S>K){
cnt +=2*K-S+1;
}
if(S<=K){
cnt +=S+1;
}
cout << cnt <<endl;
} | a.cc: In function 'int main()':
a.cc:25:4: error: expected '}' at end of input
25 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s198569669 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int K, S, count = 0;
cin >> K >> S;
for(int X = 0; X <= K; X++){
for(int Y = 0; Y <= K ; Y++){
Z = S - X - Y;
if(Z <= K) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'Z' was not declared in this scope
8 | Z = S - X - Y;
| ^
|
s695720561 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
int k, s;
cin >> k >> s;
int count = 0;
for (int x = 0; x <= k; x++)
for (int y = 0; y <= k; y++) {
int z = s - x - y;
if (z >= 0 && z <= k) {
count++;
}
}
cout << count << endl;
return 0; | a.cc: In function 'int main()':
a.cc:17:12: error: expected '}' at end of input
17 | return 0;
| ^
a.cc:5:17: note: to match this '{'
5 | int main() {
| ^
|
s184599293 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k,s;
cin >> k>>s;
int count=0;
for(int x=0; x<k+1; x++){
for(int y=0; y<k+1; y++){
if (s-x-y>=0 && S-x-y<=K) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:13:23: error: 'S' was not declared in this scope
13 | if (s-x-y>=0 && S-x-y<=K) count++;
| ^
a.cc:13:30: error: 'K' was not declared in this scope
13 | if (s-x-y>=0 && S-x-y<=K) count++;
| ^
|
s748259945 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k,s;
cin >> k>>s;
int count=0;
for(int x=0; x<k+1; x++){
for(int y=0; y<k+1; y++){
if (s-sum>=0 && S-sum<=K) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:13:13: error: 'sum' was not declared in this scope
13 | if (s-sum>=0 && S-sum<=K) count++;
| ^~~
a.cc:13:23: error: 'S' was not declared in this scope
13 | if (s-sum>=0 && S-sum<=K) count++;
| ^
a.cc:13:30: error: 'K' was not declared in this scope
13 | if (s-sum>=0 && S-sum<=K) count++;
| ^
|
s557756608 | p03835 | C++ |
int main() {
int K, S;
cin >> K;
cin >> S;
int cont = 0;
for (int i=0;i<=K;i++){
for (int j = 0; j<=K; j++) {
int z = S - i - j;
if (z>= 0 && z <= K) {
++cont;
}
}
}
cout << cont << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> K;
| ^~~
a.cc:18:9: error: 'cout' was not declared in this scope; did you mean 'cont'?
18 | cout << cont << endl;
| ^~~~
| cont
a.cc:18:25: error: 'endl' was not declared in this scope
18 | cout << cont << endl;
| ^~~~
|
s769443074 | p03835 | C++ | #include<bits/stdc++.h>
#define PI acos(-1.0)
#define eps 1e-67
#define pf printf
#define sf scanf
#define sd(n) scanf("%d",&n)
#define sd2(n1,n2) scanf("%d %d",&n1,&n2)
#define slf(n) scanf("%lf",&n)
#define slf2(n1,n2) scanf("%lf %lf",&n1,&n2)
#define sLf(n1) scanf("%Lf",&n1)
#define sLf2(n1,n2) scanf("%Lf %Lf",&n1,&n2)
#define sl(n) scanf("%lld",&n)
#define sl2(n1,n2) scanf("%lld %lld",&n1,&n2)
#define rep(i,a,b) for(long long int i=a;i<b;i++)
#define repb(i,a,b) for(long long int i=a;i>=b;i--)
#define repa(i,a,b,c) for(long long int i=a;i<b;i=i+c)
#define reps(i,a,b,c) for(long long int i=a;i>b;i=i-c)
#define asort(a) sort(a.begin(),a.end())
#define asortb(a,comp) sort(a.begin(),a.end(),comp)
#define arev(a) reverse(a.begin(),a.end())
#define all(v) (v).begin(),(v).end()
#define allc(v,comp) (v).begin(),(v).end(),comp
#define allrc(v,a,b,comp) (v).begin()+a,(v).end()-b,comp
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define pbb pop_back
#define mp make_pair
#define mt make_tuple
#define bs(v,x) binary_search(v.begin(),v.end(),x)
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define tl(c) towlower(c)
#define root(x) sqrt(x)
#define power(a,n) pow(a,n)
#define tu(c) towupper(c)
#define sq(a) ((a)*(a))
#define cube(a) ((a)*(a)*(a))
#define mx 1000
#define MX 100000
using namespace std;
typedef string str;
typedef long long int ll;
const ll mod=1000000007;
typedef double lf;
typedef long double llf;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef char ch;
typedef map<ll,ll> mpl;
int main()
{
ll k,s,i,j,c=0;
cin>>k>>s;
rep(i,0,k){
rep(j,o,k)
{
if((s-i-j)<=k && (s-i-j)>=0){
c++;
}
}
}
cout<<c<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:65:14: error: 'o' was not declared in this scope
65 | rep(j,o,k)
| ^
a.cc:14:40: note: in definition of macro 'rep'
14 | #define rep(i,a,b) for(long long int i=a;i<b;i++)
| ^
|
s793082333 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
long long int n,m,count=0;
cin>>n>>m;
int i,j,k;
for(i=0;i<=n;i++)
{
for(j=0;j<n;j++)
{
for(k=0;k<n;k++)
{
if(i+j+k==m)
count++;
}
}
}
cin>>count>>endl;
}
| a.cc: In function 'int main()':
a.cc:19:13: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
19 | cin>>count>>endl;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
| ~~ |
s071896056 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
void solve(long long K, long long S)
{
long long cnt = 0;
vector<long long> S_Z(K, 0);
for (long long i = 0; i <= K; i++)
{
for (long long j = i; j <= K; j++)
{
for (long long k = j; k <= K; k++)
{
if (i + j + k == S)
{
if (i == j && j == k)
cnt++;
else if (i == j || j == k || i == k)
cnt += 3;
else
cnt += 6
break;
}
}
}
}
cout << cnt << endl;
}
// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
long long K;
scanf("%lld", &K);
long long S;
scanf("%lld", &S);
solve(K, S);
return 0;
}
| a.cc: In function 'void solve(long long int, long long int)':
a.cc:22:33: error: expected ';' before 'break'
22 | cnt += 6
| ^
| ;
23 |
24 | break;
| ~~~~~
|
s595390435 | p03835 | C++ | #include <bits\stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int k,s; cin >> k >> s;
int ans{};
for(int i{}; i<=k; ++i){
for(int j{}; j<=k; ++j){
int z = s-i-j;
if(0<=z && z<=k){
ans+=1;
}
}
}
cout << ans << "\n";
return 0;
}
| a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s692403060 | p03835 | C++ | //三重ループはTLEでした。
#include <bits/stdc++.h>
using namespace std;
int main() {
int k,s;
cin >>k>>s;
int count=0;
for(int i=0;i <=k;i++){
for(int j=0;j <=k;j++){
int m=s-i-j;
if(i+j+m==s && i <=k &&i >=0){
count++;}
}
}
}
cout <<count <<endl;
} | a.cc:18:3: error: 'cout' does not name a type
18 | cout <<count <<endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s099207217 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s;
cin >> k >> s;
int count=0;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
if(0<=s-i-j<=k)count++;
}
}
}
cout << count << endl;
}
| a.cc:13:3: error: 'cout' does not name a type
13 | cout << count << endl;
| ^~~~
a.cc:14:1: error: expected declaration before '}' token
14 | }
| ^
|
s398634592 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> k >> s;
int count=0;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
for(int h=0;h<=k;h++){
if(s==i+j+h){
count++;
}
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:5:10: error: 'k' was not declared in this scope
5 | cin >> k >> s;
| ^
a.cc:5:15: error: 's' was not declared in this scope
5 | cin >> k >> s;
| ^
|
s176704952 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
ll K,S;
cin>>K>>S;
int cnt=0;
rep(x,K+1){
rep(y,K+1){
ll z=S-x-y;
// cout<<x<<" "<<y<<" "<<z<<"\n";
if(z>=0 && z<=K) cnt++;
}
}
cout<<cnt<<endl;
} | a.cc:13:19: error: extended character is not valid in an identifier
13 | if(z>=0 && z<=K) cnt++;
| ^
a.cc: In function 'int main()':
a.cc:13:19: error: unable to find numeric literal operator 'operator""\U00003000'
13 | if(z>=0 && z<=K) cnt++;
| ^~~
|
s503359343 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
ll K,S;
cin>>K>>S;
int cnt=0;
rep(x,K+1){
rep(y,K+1){
ll z=S-x-y;
// cout<<x<<" "<<y<<" "<<z<<"\n";
if(z>=0 && z<=K) cnt++;
}
}
cout<<cnt<<endl;
} | a.cc:13:19: error: extended character is not valid in an identifier
13 | if(z>=0 && z<=K) cnt++;
| ^
a.cc: In function 'int main()':
a.cc:13:19: error: unable to find numeric literal operator 'operator""\U00003000'
13 | if(z>=0 && z<=K) cnt++;
| ^~~
|
s234431531 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
ll K, S;
cin >> K >> S;
ll sum = 0;
for (ll i = 0; i <= K; i++) {
for (ll j = 0; j <= K; j++) {
for (ll k = 0; k <= K; k++) {
if (S - i - j <=K) {
sum += 1;
}
}
}
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
5 | ll K, S;
| ^~
a.cc:6:12: error: 'K' was not declared in this scope
6 | cin >> K >> S;
| ^
a.cc:6:17: error: 'S' was not declared in this scope
6 | cin >> K >> S;
| ^
a.cc:8:7: error: expected ';' before 'sum'
8 | ll sum = 0;
| ^~~~
| ;
a.cc:9:12: error: expected ';' before 'i'
9 | for (ll i = 0; i <= K; i++) {
| ^~
| ;
a.cc:9:20: error: 'i' was not declared in this scope
9 | for (ll i = 0; i <= K; i++) {
| ^
a.cc:10:16: error: expected ';' before 'j'
10 | for (ll j = 0; j <= K; j++) {
| ^~
| ;
a.cc:10:24: error: 'j' was not declared in this scope
10 | for (ll j = 0; j <= K; j++) {
| ^
a.cc:11:20: error: expected ';' before 'k'
11 | for (ll k = 0; k <= K; k++) {
| ^~
| ;
a.cc:11:28: error: 'k' was not declared in this scope
11 | for (ll k = 0; k <= K; k++) {
| ^
a.cc:13:21: error: 'sum' was not declared in this scope
13 | sum += 1;
| ^~~
a.cc:18:13: error: 'sum' was not declared in this scope
18 | cout << sum << endl;
| ^~~
|
s308371094 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++);
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int k, s;
cin >> k >> s;
int cnt = 0;
for (int x = 0; x <= k; ++x) {
for (int y = 0; y <= k; ++y) {
int z = s - (x + y);
if (z >= 0 && z <= k) ++cnt;
}
}
cout << cnt << endl;
| a.cc: In function 'int main()':
a.cc:18:25: error: expected '}' at end of input
18 | cout << cnt << endl;
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s735214588 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
if((i+j+(s-i-j))==s){
ans++;
}
}
}
}
cout<<ans<<endl;
} | a.cc:16:3: error: 'cout' does not name a type
16 | cout<<ans<<endl;
| ^~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s994533254 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int count=0;
for (int i=0; i<=K; i++){
for (int j=0; j<=K; j++){
if (S-i-j<=K && i+j<=2K) count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:38: error: fixed-point types not supported in C++
10 | if (S-i-j<=K && i+j<=2K) count++;
| ^~
a.cc: At global scope:
a.cc:14:5: error: 'cout' does not name a type
14 | cout << count << endl;
| ^~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s003547746 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int64_t l=0;
for(int i=0;i<=K && i<=S;i++)
for(int j=i;K-(i+j)>=j && S-(i+j)>=j;j++){
k=K-(i+j);
if(i==j && j==k)
l++;
else if(i==j||j==k||k==i)
l+=3;
else
l+=6;
}
cout<<l<<endl;
} | a.cc: In function 'int main()':
a.cc:10:7: error: 'k' was not declared in this scope
10 | k=K-(i+j);
| ^
|
s024606736 | p03835 | Java | import java.util.Scanner;
public class main{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int k=sc.nextInt();
int s=sc.nextInt();
int ans=0;
for(int x=0;x<k+1;x++){
for(int y=0;x<k+1;x++){
for(int z=0;x<k+1;x++){
if(x+y+z==s){
ans++;
}
}
}
}
System.out.println(ans);
}
} | Main.java:2: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s692770930 | p03835 | C++ | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iterator>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int K,S;
cin >> K >> S;
int ans = 0;
rep(x, K+1) {
rep(y, K+1) {
int z = S - x -y;
if(0 <= z and z <= K) {
++ans
}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:34:14: error: expected ';' before '}' token
34 | ++ans
| ^
| ;
35 | }
| ~
|
s900171011 | p03835 | C++ | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iterator>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> K >> S;
int ans = 0;
rep(x, K+1) {
rep(y, K+1) {
int z = S - x -y;
if(0 <= z and z <= K) {
++ans
}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:10: error: 'K' was not declared in this scope
25 | cin >> K >> S;
| ^
a.cc:25:15: error: 'S' was not declared in this scope
25 | cin >> K >> S;
| ^
a.cc:33:14: error: expected ';' before '}' token
33 | ++ans
| ^
| ;
34 | }
| ~
|
s118275235 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k, s;
cin >> k >> s;
int count = 0;
for(int i = 0; i<=k, i++){
for(int j = 0; j<=k, j++){
if(s-(i+j) <= k)
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:9:27: error: expected ';' before ')' token
9 | for(int i = 0; i<=k, i++){
| ^
| ;
a.cc:10:29: error: expected ';' before ')' token
10 | for(int j = 0; j<=k, j++){
| ^
| ;
|
s710053793 | p03835 | C++ |
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main(){
int k,s; cin>>k>>s;
int cnt=0;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
int len = sum-i-j;
if(i+j+len == sum && len > 0)
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:19: error: 'sum' was not declared in this scope
14 | int len = sum-i-j;
| ^~~
|
s676560649 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,srt,end) for(ll i=(ll)(srt); i<(ll)(end); i++)
int main(){
ll K,S;
cin>>K>>S;
ll z;
ll ans=0;
rep(x,0,K+1){
rep(y,0,K+1)){
z = S-x-y;
if(0<=z&&z<=K)ans++;
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:21: error: expected primary-expression before ')' token
12 | rep(y,0,K+1)){
| ^
|
s622797341 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
int main(){
ll K,S;
cin>>K>>S;
ll z;
ll ans=0;
rep(x,0,K+1){
rep(y,0,K+1)){
z = S-x-y;
if(0<=z&&z<=K)ans++;
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before 'K'
11 | rep(x,0,K+1){
| ^
a.cc:4:46: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^~~
a.cc:11:13: error: expected ')' before 'K'
11 | rep(x,0,K+1){
| ^
a.cc:4:46: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^~~
a.cc:4:42: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^
a.cc:11:5: note: in expansion of macro 'rep'
11 | rep(x,0,K+1){
| ^~~
a.cc:12:17: error: expected primary-expression before 'K'
12 | rep(y,0,K+1)){
| ^
a.cc:4:46: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^~~
a.cc:12:17: error: expected ')' before 'K'
12 | rep(y,0,K+1)){
| ^
a.cc:4:46: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^~~
a.cc:4:42: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++)
| ^
a.cc:12:9: note: in expansion of macro 'rep'
12 | rep(y,0,K+1)){
| ^~~
a.cc:12:21: error: expected primary-expression before ')' token
12 | rep(y,0,K+1)){
| ^
|
s535466088 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
int main(){
ll K,S;
cin>>K>>S;
ll z;
ll ans=0;
rep(x,0,K+1){
rep(y,0,K+1)){
z = S-x-y;
if(0<=z&&z<=K)ans++;
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:11: error: expected primary-expression before numeric constant
11 | rep(x,0,K+1){
| ^
a.cc:4:37: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:11:11: error: expected ')' before numeric constant
11 | rep(x,0,K+1){
| ^
a.cc:4:37: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:4:33: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^
a.cc:11:5: note: in expansion of macro 'rep'
11 | rep(x,0,K+1){
| ^~~
a.cc:11:13: error: expected primary-expression before 'K'
11 | rep(x,0,K+1){
| ^
a.cc:4:49: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:11:13: error: expected ')' before 'K'
11 | rep(x,0,K+1){
| ^
a.cc:4:49: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:4:45: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^
a.cc:11:5: note: in expansion of macro 'rep'
11 | rep(x,0,K+1){
| ^~~
a.cc:12:15: error: expected primary-expression before numeric constant
12 | rep(y,0,K+1)){
| ^
a.cc:4:37: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:12:15: error: expected ')' before numeric constant
12 | rep(y,0,K+1)){
| ^
a.cc:4:37: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:4:33: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^
a.cc:12:9: note: in expansion of macro 'rep'
12 | rep(y,0,K+1)){
| ^~~
a.cc:12:17: error: expected primary-expression before 'K'
12 | rep(y,0,K+1)){
| ^
a.cc:4:49: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:12:17: error: expected ')' before 'K'
12 | rep(y,0,K+1)){
| ^
a.cc:4:49: note: in definition of macro 'rep'
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^~~
a.cc:4:45: note: to match this '('
4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++)
| ^
a.cc:12:9: note: in expansion of macro 'rep'
12 | rep(y,0,K+1)){
| ^~~
a.cc:12:21: error: expected primary-expression before ')' token
12 | rep(y,0,K+1)){
| ^
|
s903725324 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, s, total;
cin >> n >> s;
int count = 0;
for(int i = 0; i<=n; i++){
for(int j = 0; j<=n; j++){
total = s-i-j;
if(0 <= total && toatal <= n)
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:24: error: 'toatal' was not declared in this scope; did you mean 'total'?
12 | if(0 <= total && toatal <= n)
| ^~~~~~
| total
|
s674602483 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, s, total;
cin >> n >> s;
int count = 0;
for(int i = 0; i<=n; i++){
for(int j = 0; j<=n; j++){
total = s-i+j;
if(0 <= total && toatal <= n)
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:24: error: 'toatal' was not declared in this scope; did you mean 'total'?
12 | if(0 <= total && toatal <= n)
| ^~~~~~
| total
|
s506514397 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, s, total;
cin >> n >> s;
int count = 0;
for(int i = 0; i<=n; i++){
for(int j = 0; j<=n; j++){
total = i+j;
if(0 <= && s-total <=n)
count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:19: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
12 | if(0 <= && s-total <=n)
| ~~~~^~~~~~
a.cc:12:12: error: ordered comparison of pointer with integer zero ('int' and 'void*')
12 | if(0 <= && s-total <=n)
| ~~^~~~~~~~~~~~~
a.cc:12:18: error: label 's' used but not defined
12 | if(0 <= && s-total <=n)
| ^
|
s568379005 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, s, total;
cin >> n >> s;
int count = 0;
for(int i = 0; i<=n; i++){
for(int j = 0; j<=n; j++){
total = i+j;
if(total == s-k)
count++;
if(j>s)
break;
}
if(i>s)
break;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:21: error: 'k' was not declared in this scope
12 | if(total == s-k)
| ^
|
s331800155 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, s, total;
cin >> n >> s;
int count = 0;
for(int i = 0; i<=n; i++){
for(int j = 0; j<=n; j++){
total = i+j;
if(total == s-k)
count++;
}
if(j>s)
break;
}
if(i>s)
break;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:21: error: 'k' was not declared in this scope
12 | if(total == s-k)
| ^
a.cc:15:8: error: 'j' was not declared in this scope
15 | if(j>s)
| ^
a.cc:18:8: error: 'i' was not declared in this scope
18 | if(i>s)
| ^
a.cc:19:7: error: break statement not within loop or switch
19 | break;
| ^~~~~
a.cc: At global scope:
a.cc:21:3: error: 'cout' does not name a type
21 | cout << count << endl;
| ^~~~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s892208007 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int i,j;
int K,S;
int count=0;
cin>>K>>S;
for(i=0;i<=K&&i<=S;i++){
for(j=0;i+j<=S&&j<=K;j++){
int x=S-i-j;
if(x<=K)count++;
}
}
cout<<count; | a.cc: In function 'int main()':
a.cc:15:13: error: expected '}' at end of input
15 | cout<<count;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s673519908 | p03835 | C++ | using namespace std;
int main(){
int i,j;
int K,S;
int count=0;
cin>>K>>S;
for(i=0;i<=K&&i<=S;i++){
for(j=0;i+j<=S&&j<=K;j++){
int x=S-i-j;
if(x<=K)count++;
}
}
cout<<count;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin>>K>>S;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:14:1: error: 'cout' was not declared in this scope
14 | cout<<count;
| ^~~~
a.cc:14:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s080967046 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, s;
cin >> k >> s;
int res = 0;
for (int i = 0; i <= k; i++) {
for (int j = 0; j <= k; j++) {
if (s - x - y >= 0 && s - x - y <= k) {
res++;
}
}
}
cout << res << endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: 'x' was not declared in this scope
10 | if (s - x - y >= 0 && s - x - y <= k) {
| ^
a.cc:10:19: error: 'y' was not declared in this scope
10 | if (s - x - y >= 0 && s - x - y <= k) {
| ^
|
s122891416 | p03835 | C | #include <iostream>
using namespace std;
int main(void) {
int k, s;
cin >> k >> s;
int ans = 0;
for (int i = 0; i <= k; i++) {
for (int j = 0; j < k; j++) {
if (s - i - j <= k) {
ans++;
cout << i << " " << j;
}
}
}
cout << ans << endl;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s573794481 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k,s; cin >> k >> s;
int ans=0;
for(int x=0;x<=k; x++){
for(int y=0;y<=k; y++){
int z=s-x-y;
if(0 <= z && z <= K){
ans++;
}
}
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:10:25: error: 'K' was not declared in this scope
10 | if(0 <= z && z <= K){
| ^
|
s376459287 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k,s; cin >> k >> s;
int ans=0;
for(int x=0;x<=k; x++;){
for(int y=0;y<=k; y++;){
for(int z=0;z<=k; z++;){
if(s==x+y+z){
ans++;
}
}
}
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected ')' before ';' token
7 | for(int x=0;x<=k; x++;){
| ~ ^
| )
a.cc:7:25: error: expected primary-expression before ')' token
7 | for(int x=0;x<=k; x++;){
| ^
|
s402827379 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K, S, X, Y, Z, Sum = 0;
cin >> K >> S;
for (int i = 0; i <= K; i++)
{
for (int a = 0; a <= K; a++)
{
X = i;
Y = a;
Z = S - X - Y;
if (Z <= K && 0 <= Z)
{
Sum++;
}
}
}
cout << Sum;
| a.cc: In function 'int main()':
a.cc:25:17: error: expected '}' at end of input
25 | cout << Sum;
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s343181802 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int num, Max;
int count;
cin >> num >> Max;
for (int i = 0; i <= num; i++) {
for (int j = 0; J <= num; j++) {
for (int k = 0; k <= num; k++) {
if (i + j + k == Max) {
count++;
}
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'J' was not declared in this scope
9 | for (int j = 0; J <= num; j++) {
| ^
|
s025162294 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for (int i=s; i<t; ++i)
#define pb push_back
using namespace std;
using P = pair<int,int>;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef tuple<int,int,int> T;
typedef vector<P> vp;
typedef vector<T> vt;
const int INF = 1001001001;
int main(void) {
ll K, S;
cin >> K >> S;
int ans=0;
for(int x=0; x<=K; x++){
for(int y=0; y<=K; y++){
if(x+y+z==S){
ans++;
}
}
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:24:14: error: 'z' was not declared in this scope
24 | if(x+y+z==S){
| ^
|
s385895582 | p03835 | C++ | #include <iostream>
using namespace std;
int main()
{
int k,s;
cin>>k>>s;
int ans = 0;
for(int x = 0; x <= K; ++x){
for(int y = 0; y <= K; ++y){
int z = S - x - y;
if(0 <= z and z <= K){
ans = ans + 1;
}
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:8:29: error: 'K' was not declared in this scope
8 | for(int x = 0; x <= K; ++x){
| ^
a.cc:10:33: error: 'S' was not declared in this scope
10 | int z = S - x - y;
| ^
|
s165927341 | p03835 | C++ | int main()
{
int sum = 0;
int num, ans;
cin >> num >> ans;
for (int i = 0; i < num + 1; i++)
{
for (int j = 0; j < num + 1; j++)
{
for (int k = 0; k < num + 1; k++)
{
if (i + j + k == ans)
sum++;
}
}
}
cout << sum;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> num >> ans;
| ^~~
a.cc:17:3: error: 'cout' was not declared in this scope
17 | cout << sum;
| ^~~~
|
s484449820 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k,s,count,time,z;
cin>>k>>s;
count=0;
for(int x=0;x<=k;x++){
for(int y=x;y<=k;y++){
z=s-x-y;
if(!(y<=z and z<=k ))break;
if(x==y and x==z and y==z )count+=1;
else if(x==y or x==z or y==z )count+=3;
else count+=6;
}
}
}
cout<<count<<endl;
}
| a.cc:20:3: error: 'cout' does not name a type
20 | cout<<count<<endl;
| ^~~~
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s229679612 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k,s,count,time;
cin>>k>>s;
count=0;
for(int x=0;x<=k;x++){
time=x
if(time>s){
break;
}
for(int y=0;y<=k;y++){
time+=y;
if(time>s){
break;
}
for(int z=0;z<=k;z++){
if(time+z==s){
count+=1;
}
}
}
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'if'
9 | time=x
| ^
| ;
10 | if(time>s){
| ~~
|
s924957260 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K.S;cin>>K>>S;
long long count=0;
for(int i=0;i<=K;i++){
for(int j=0;j<=K;j++){
if(S-(i+j)<=K&&S-(i+j)>=0){
count++;
}
}
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:4:8: error: expected initializer before '.' token
4 | int K.S;cin>>K>>S;
| ^
a.cc:4:16: error: 'K' was not declared in this scope
4 | int K.S;cin>>K>>S;
| ^
a.cc:4:19: error: 'S' was not declared in this scope
4 | int K.S;cin>>K>>S;
| ^
|
s133294226 | p03835 | C++ |
#include <iostream>
using namespace std;
int main() {
int K, S, cnt = 0, z_init = 0;
scanf_s("%d %d", &K, &S);
if (S > 2 * K) z_init = S - 2 * K;
for (int z = z_init; z <= K; ++z) {
if (S - z < 0) break;
if (S - z > K) cnt += (2 * K - S + z + 1);
else cnt += (S - z + 1);
}
printf("%d\n", cnt);
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | scanf_s("%d %d", &K, &S);
| ^~~~~~~
| scanf
|
s826254579 | p03835 | C++ |
//#define _USE_MATH_DEFINES
#include <iostream>
//#include <vector>
#include <algorithm>
//#include <numeric>
//#include <string>
//#include <array>
//#include <set>
//#include <sstream>
//#include <cstdio>
//#include <cmath>
using namespace std;
int main() {
int K, S, cnt = 0, z_init = 0;
scanf_s("%d %d", &K, &S);
if (S > 2 * K) z_init = S - 2 * K;
for (int z = z_init; z <= K; ++z) {
if (S - z < 0) break;
if (S - z > K) cnt += (2 * K - S + z + 1);
else cnt += (S - z + 1);
}
printf("%d\n", cnt);
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
19 | scanf_s("%d %d", &K, &S);
| ^~~~~~~
| scanf
|
s839868786 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, s;
cin >> k >> s;
int count = 0;
for (int x = 0; i <= k; i++) {
for (int y = 0; j <= k; j++) {
int z = s - x - y;
if (0 <= z && z <= k) count++;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:9:19: error: 'i' was not declared in this scope
9 | for (int x = 0; i <= k; i++) {
| ^
a.cc:10:21: error: 'j' was not declared in this scope
10 | for (int y = 0; j <= k; j++) {
| ^
|
s929113145 | p03835 | C++ |
using namespace std;
#define ALL(obj) obj.begin(),obj.end()
#define pb(obj) push_back(obj)
#define REP(i,N) for(int i=0;i<N;i++)
typedef long long ll;
ll const MOD=1e9+7;
using ll = long long;
int main(){
int k,s;
cin>>k>>s;
int count=0;
REP(a,k+1){
REP(b,k+1){
if(0<=s-a-b&&s-a-b<=k){
count++;
}
}
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
12 | cin>>k>>s;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:21:3: error: 'cout' was not declared in this scope
21 | cout<<count<<endl;
| ^~~~
a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:16: error: 'endl' was not declared in this scope
21 | cout<<count<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 |
|
s818960643 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
int main() {
int k,s;
cin >> k >> s;
int ans=0;
rep(i,k+1) {
rep(int j=i,k+1) {
rep(int l=i,k+1) {
if(i+j+l==s) ans++;
}}}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:2:22: error: two or more data types in declaration of 'j'
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^~~
a.cc:9:5: note: in expansion of macro 'rep'
9 | rep(int j=i,k+1) {
| ^~~
a.cc:9:9: error: expected primary-expression before 'int'
9 | rep(int j=i,k+1) {
| ^~~
a.cc:2:38: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^
a.cc:9:9: error: expected ')' before 'int'
9 | rep(int j=i,k+1) {
| ^~~
a.cc:2:38: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^
a.cc:2:21: note: to match this '('
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^
a.cc:9:5: note: in expansion of macro 'rep'
9 | rep(int j=i,k+1) {
| ^~~
a.cc:9:13: error: redeclaration of 'int j'
9 | rep(int j=i,k+1) {
| ^
a.cc:2:38: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^
a.cc:9:13: note: 'int j' previously declared here
9 | rep(int j=i,k+1) {
| ^
a.cc:2:30: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<(n);++i)
| ^
|
s016197403 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S, n=0; cin >> K >> S;
for (int X=0; X<=K; X++) {
for (int Y=0; Y<=K; Y++) {
Z=S-X-Y;
if (Z>=0&&Z<=K) n++;
}
}
cout << n << endl;
} | a.cc: In function 'int main()':
a.cc:8:7: error: 'Z' was not declared in this scope
8 | Z=S-X-Y;
| ^
|
s144463871 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S, n=0; cin >> K >> S;
for (int X=0; X<=K; X++) {
for (int Y=0; Y<=K; Y++) {
for (int Z=0; Z<=K; Z;;) {
if (X+Y+Z==S) n++;
}
}
}
cout << n << endl;
} | a.cc: In function 'int main()':
a.cc:8:28: error: expected ')' before ';' token
8 | for (int Z=0; Z<=K; Z;;) {
| ~ ^
| )
a.cc:8:30: error: expected primary-expression before ')' token
8 | for (int Z=0; Z<=K; Z;;) {
| ^
|
s816817235 | p03835 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int K, S, count;
cin >> K >> S ;
for(int i = 0; i <= K; i++){
for(int j = 0; j <= K; j++){
int z = S - i - j;
if(z => 0 && z <= K){
count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:11:15: error: expected primary-expression before '>' token
11 | if(z => 0 && z <= K){
| ^
|
s534504944 | p03835 | C++ | ll func(ll K,ll S)
{
ll count = 0;
for (int x = 0; x < K, ++x)
{
for (int y = 0; y < K; ++y)
{
for (int z=0;z<K;z++)
{
if (x + y + z == S)
{
++count;
}
}
}
}
return count;
}
int main()
{
ll K,S;
std::cin >> K >> S;
std::cout<<func(K,S);
return 0;
}
| a.cc:1:1: error: 'll' does not name a type
1 | ll func(ll K,ll S)
| ^~
a.cc: In function 'int main()':
a.cc:24:9: error: 'll' was not declared in this scope
24 | ll K,S;
| ^~
a.cc:25:14: error: 'cin' is not a member of 'std'
25 | std::cin >> K >> S;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | ll func(ll K,ll S)
a.cc:25:21: error: 'K' was not declared in this scope
25 | std::cin >> K >> S;
| ^
a.cc:25:26: error: 'S' was not declared in this scope
25 | std::cin >> K >> S;
| ^
a.cc:28:14: error: 'cout' is not a member of 'std'
28 | std::cout<<func(K,S);
| ^~~~
a.cc:28:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:20: error: 'func' was not declared in this scope
28 | std::cout<<func(K,S);
| ^~~~
|
s719250932 | p03835 | C++ | #include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int k,s;
cin >> k >> s;
int a=0;
for (int i=0;i<=k;i++) {
for (int j=0;j<=k;j++) {
int b=s-i-j;
if (0<=b && b<=k) aA++;
}
}
cout << a;
} | a.cc: In function 'int main()':
a.cc:21:43: error: 'aA' was not declared in this scope; did you mean 'a'?
21 | if (0<=b && b<=k) aA++;
| ^~
| a
|
s803679878 | p03835 | C++ | clude <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
const int MOD = 1e9+7;
int main() {
int K,S;
cin >> K >> S;
int sum = 0;
rep(x,K+1){
rep(y,K+1){
if(x+y >= S-K &&x+y <= S) sum = sum+1;
}
}
cout << sum << endl;
} | a.cc:1:1: error: 'clude' does not name a type
1 | clude <bits/stdc++.h>
| ^~~~~
a.cc:7:12: error: 'vector' does not name a type
7 | using vi = vector<int>;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
13 | cin >> K >> S;
| ^~~
a.cc:20:9: error: 'cout' was not declared in this scope
20 | cout << sum << endl;
| ^~~~
a.cc:20:24: error: 'endl' was not declared in this scope
20 | cout << sum << endl;
| ^~~~
|
s614915617 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
const int MOD = 1e9+7;
int main() {
int K,S;
int sum = 0;
rep(x,K){
rep(y,K){
if(x+y >= S-K &&x+y =< S) sum = sum+1;
}
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:16:38: error: expected primary-expression before '<' token
16 | if(x+y >= S-K &&x+y =< S) sum = sum+1;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.