submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s676369218 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
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;
}
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:17:6: error: expected '}' at end of input
17 | }
| ^
a.cc:8:30: note: to match this '{'
8 | for(int x = 0; x <= K; ++x){
| ... |
s115736511 | p03835 | C++ | #include <iostream>
using namespace std;
int K, S;
int main() {
cin >> K >> S;
int ans = 0;
for (int x = 0; x <= K; x++) {
for (int y = 0; y <= S; y++) {
int z = S-x-y;
if (0 <= z && z <= K) ans++
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:13:40: error: expected ';' before '}' token
13 | if (0 <= z && z <= K) ans++
| ^
| ;
14 | }
| ~
|
s351221963 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int min(){
int K,S; cin >> K >> S;
int sum=0;
for(int i=0;i<K;i++){
for(int j=0;j<K;j++){
if(S-(i+j) >= 0 && S-(i+j) <= K)
sum++;
}
}
cout << sum << endl;
}
| a.cc: In function 'int min()':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
15 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit... |
s700878126 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int min(){
int K,S; cin >> K >> S;
int sum=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)sum++;
}
}
}
cout << sum << endl;
}
| a.cc: In function 'int min()':
a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
15 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit... |
s350794470 | 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 i=0;j<=K;j++){
if(i+j>=K*2 && i+j<=S){
ans++;
}
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:11:17: error: 'j' was not declared in this scope
11 | for(int i=0;j<=K;j++){
| ^
|
s248301602 | p03835 | C++ | #include<bits/stdc++.h>
constexpr long long INFL = 1LL << 60;
constexpr int INF = 1 << 30;
using namespace std;
using ll = long long;
using P = tuple<int, int>;
using iarr = valarray<int>;
int main()
{
int K,S;
cin >> K >> S;
ll cnt = 0;
for(int i = 0; i <= K; ++i){
for(int j = 0; j <= K; ++j... | a.cc: In function 'int main()':
a.cc:23:14: error: expected '}' at end of input
23 | return 0;
| ^
a.cc:12:1: note: to match this '{'
12 | {
| ^
|
s303713297 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int X,Y,Z,ans=0;
for(int i=0;i<=K;i++){
for(int j=0;j<=K;j++){
X=i;
Y=j;
Z=S-X-Y;
if(0<=Z&&Z<=K){
ans++;
}
}
}
cout<<ans<<endl;
return 0;
}#include<iostream>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
... | a.cc:21:2: error: stray '#' in program
21 | }#include<iostream>
| ^
a.cc:21:3: error: 'include' does not name a type
21 | }#include<iostream>
| ^~~~~~~
a.cc:24:5: error: redefinition of 'int main()'
24 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | in... |
s716487665 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define vpii vector<pii>
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define f first
#define s second
ll ncr(ll n,ll m){
if(m>n-m)
m = n-m;
ll ans =1;
for(ll... | a.cc: In function 'int main()':
a.cc:34:7: error: 'z' was not declared in this scope
34 | z = s-i-j;
| ^
|
s521508159 | p03835 | Java | #include <iostream>
#include <vector>
#include <deque>
#include <cmath>
#include <map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include "iomanip"
using namespace std;
int main() {
int k, s, count = 0;
cin >> k >> s;
for (int i = 0; i <= min(k, s); i++) {
for (int j = 0; j <= m... | Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <vector>
^
Main.java:3: error: illegal character: '#'
#include <deque>
^
Main.java:4: error: illegal character: '#'
#include <cmath>
^
Main.java:5: error: illegal character: '#'
#include <map>
^
Main.jav... |
s083352011 | p03835 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <string.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=9... | a.cc: In function 'int main()':
a.cc:37:27: error: expected ';' before 'int'
37 | int k,s; cin >> k >> s
| ^
| ;
38 | int res=0;
| ~~~
a.cc:43:34: error: 'res' was not declared in this scope; did you mean 'rep'?
... |
s260393363 | p03835 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <string.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=9... | a.cc: In function 'int main()':
a.cc:39:10: error: 'p' was not declared in this scope
39 | else p(s*3);
| ^
|
s216373836 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int z;
int result = 0;
for(int x = 0; x < K; x++) {
for(int y = 0; y < K; y++) {
z = S - x - y
if(z >= 0 && z <= K) {
result++;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before 'if'
12 | z = S - x - y
| ^
| ;
13 | if(z >= 0 && z <= K) {
| ~~
|
s309092918 | p03835 | C++ | K, S = map(int, input().split())
cnt = 0
if K >= S:
cnt+=3
def cnt2(k, s):
if 2 * k >= s:
if s - 1 <= k:
return s-1
else:
return k-(s-k)+1
else:
return 0
cnt+=3*cnt2(K, S)
for x in range(1, K+1):
if S-x <=0:
break
cnt += cnt2(K, S-x)
prin... | a.cc:1:1: error: 'K' does not name a type
1 | K, S = map(int, input().split())
| ^
|
s764674072 | 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++){
int y_max = min(K, S-x);
for(int y=0; y<=y_max; y++){
z = S - x - y;
if(z<K) count++;
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:7: error: 'z' was not declared in this scope
12 | z = S - x - y;
| ^
|
s928344503 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S,sum=0;
cin>>K>>S;
for(int i=0;i<K+1;i++){
for(int j=0;j<K+1;j++){
int z=S-i-j;
if(0<z && z<K+1){
sum++;
}
}
}
}
cout<<sum<<endl;
} | a.cc:15:1: error: 'cout' does not name a type
15 | cout<<sum<<endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s411593853 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S,sum=0;
cin>>K>>S;
for(int i=0;i<K+1;i++){
for(int j=0;j<K+1;j++){
int z=S-i-j
if(0<z&&z<K+1){
sum++;
}
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected ',' or ';' before 'if'
9 | if(0<z&&z<K+1){
| ^~
a.cc: At global scope:
a.cc:15:1: error: 'cout' does not name a type
15 | cout<<sum<<endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | ... |
s838203622 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S,sum=0;
cin>>K>>S;
for(int i=0;i<K+1;i++){
for(int j=0;j<K+1;j++){
int Z=S-i-j
if(0<z&&z<K+1){
sum++;
}
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected ',' or ';' before 'if'
9 | if(0<z&&z<K+1){
| ^~
a.cc: At global scope:
a.cc:15:1: error: 'cout' does not name a type
15 | cout<<sum<<endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | ... |
s515828151 | p03835 | C++ | 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){
int z = S - x - y;
if(0 <= z and z <= K){
ans = ans + 1;
}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:3:2: error: 'cin' was not declared in this scope
3 | cin >> K >> S;
| ^~~
a.cc:17:2: error: 'cout' was not declared in this scope
17 | cout << ans << endl;
| ^~~~
a.cc:17:17: error: 'endl' was not declared in this scope
17 | cout << ans << endl;
| ... |
s984081536 | p03835 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<string>
#include <algorithm>
#include<math.h>
using namespace std;
int main(){
int k,s;
int ans=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(i+j+l == s)ans+... | a.cc: In function 'int main()':
a.cc:17:20: error: 'i' was not declared in this scope
17 | if(i+j+l == s)ans++;
| ^
a.cc:17:22: error: 'j' was not declared in this scope
17 | if(i+j+l == s)ans++;
| ^
a.cc:17:24: error: 'l' was not... |
s604513841 | p03835 | C++ | int main(){
int K, S;
int counter = 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)){
//cout << 1 << endl;
//cout << i << j << endl;
counter++;
}
... | a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> K >> S;
| ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << counter << endl;
| ^~~~
a.cc:14:24: error: 'endl' was not declared in this scope
14 | cout << coun... |
s472391450 | p03835 | C++ | #include <iostream>
#include <bits/stdc++.h>
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 = ans + 1;
... | a.cc: In function 'int main()':
a.cc:5:9: 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; ... |
s239673921 | p03835 | C++ | 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){
int z = S - x - y;
if(0 <= z and z <= K){
ans = ans + 1;
}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> K >> S;
| ^~~
a.cc:17:9: error: 'cout' was not declared in this scope
17 | cout << ans << endl;
| ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope
17 | ... |
s464018827 | p03835 | C++ | 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){
int z = S - x - y;
if(0 <= z and z <= K){
ans = ans + 1;
}
}
}
cout << ans << endl;
return 0; | a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
3 | cin >> K >> S;
| ^~~
a.cc:17:1: error: 'cout' was not declared in this scope
17 | cout << ans << endl;
| ^~~~
a.cc:17:16: error: 'endl' was not declared in this scope
17 | cout << ans << endl;
| ... |
s465824993 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin >>K >>S;
int a=0;
for(int h=0;h<=K,h++){
for(int i=0;i<=K,i++){
for(int j=0;j<=K,j++){
if(S==h+i+j)
a++;
}
}
}
cout <<a <<endl;
} | a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before ')' token
8 | for(int h=0;h<=K,h++){
| ^
| ;
a.cc:9:25: error: expected ';' before ')' token
9 | for(int i=0;i<=K,i++){
| ^
| ... |
s746976304 | p03835 | Java | import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int cnt = 0;
for(int i = 0; i <= k; i++){
for(int h = 0; h <= k; h++){
if(s - x - y <= k &... | Main.java:11: error: cannot find symbol
if(s - x - y <= k && s >= x + y){
^
symbol: variable x
location: class Main
Main.java:11: error: cannot find symbol
if(s - x - y <= k && s >= x + y){
^
symbol: variable y
... |
s643602646 | p03835 | C++ |
#include<bits/stdc++.h>
using namespace std;
int main(){
int K,S,counter=0;
cin>>K>>S;
for(int x=0;x<=K;x++){
for(int y=0;y<=K;y++){
int z=S-(x+y);
if(z<=K&&z>=0){
counter++;
}
}
}
cout<<counter<<endl; | a.cc: In function 'int main()':
a.cc:15:23: error: expected '}' at end of input
15 | cout<<counter<<endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s943468083 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int k;
int s;
int main(){
cin >> k;
cin >> s;
int count = 0;
for(int i=0; i<=k; i++){
for(int j=0; j<=k; j++{
if( 0<=((s - i) - j) && ((s - i) - j) <= k ) count++;
}
}
cout << count << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:27: error: expected ')' before '{' token
17 | for(int j=0; j<=k; j++{
| ~ ^
| )
|
s747424039 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int k;
int s;
cin >> k;
cin >> s;
int count = 0;
int main(){
for(int i=0; i<=k; i++){
for(int j=0; j<=k; j++{
if( 0<=((s - i) - j) && ((s - i) - j) <= k ) count++;
}
}
cout << count << endl;
return 0;
} | a.cc:9:1: error: 'cin' does not name a type
9 | cin >> k;
| ^~~
a.cc:10:1: error: 'cin' does not name a type
10 | cin >> s;
| ^~~
a.cc: In function 'int main()':
a.cc:16:27: error: expected ')' before '{' token
16 | for(int j=0; j<=k; j++{
| ~ ^
| ... |
s521320546 | p03835 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
int main(int argc, char const *argv[])
{
int k,s;
int cnt = 0,z;
scanf("%d%d",&k,&s);
for (int x = 0; x <= k ; ++x)
{
for (int y = 0; y <= k; ++y){
z = s - x... | main.c: In function 'main':
main.c:19:51: error: 'ans' undeclared (first use in this function); did you mean 'abs'?
19 | if(0 <= z && z <= k) ++ans;
| ^~~
| abs
main.c:19:51: not... |
s895371755 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k] | a.cc:3:27: error: too many decimal points in number
3 | print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k]
| ^~~~
a.cc:3:40: error: too many decimal points in number
3 | print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k]
| ... |
s757687712 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]] | a.cc:3:22: error: too many decimal points in number
3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]]
| ^~~~
a.cc:3:32: error: too many decimal points in number
3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]]
| ... |
s398083657 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]] | a.cc:3:22: error: too many decimal points in number
3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]]
| ^~~~
a.cc:3:32: error: too many decimal points in number
3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]]
| ... |
s414321160 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | a.cc:3:27: error: too many decimal points in number
3 | print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
| ^~~~
a.cc:3:37: error: too many decimal points in number
3 | print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
| ... |
s493151839 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | a.cc:3:27: error: too many decimal points in number
3 | print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
| ^~~~
a.cc:3:37: error: too many decimal points in number
3 | print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
| ... |
s385305193 | p03835 | C++ | main::IO()
main=do
[k,s]<-map read.words<$>getLine
print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s] | a.cc:4:28: error: too many decimal points in number
4 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s]
| ^~~~
a.cc:4:38: error: too many decimal points in number
4 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s]
| ... |
s631061075 | p03835 | C++ | main=do
[k,s]<-map read.words<$>getLine
print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s] | a.cc:3:28: error: too many decimal points in number
3 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s]
| ^~~~
a.cc:3:38: error: too many decimal points in number
3 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s]
| ... |
s915822616 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K,S;
cin >> K >>S;
int a=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){
a +=1;
}
}
}
}
cout << (a) <<endl;
ret... | a.cc:8:8: error: stray '`' in program
8 | for`(int x = 0;x<=K;x++)
| ^
|
s438705442 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K,S;
cin >> K >>S;
int a=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){
a +=1;
}
}
}
}
cout << (a) <<endl;
retu... | a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before ')' token
10 | for (int y=0;y<=K,y++)
| ^
| ;
a.cc:12:26: error: expected ';' before ')' token
12 | for (int z=0;z<=K,z++)
| ^
| ... |
s856077816 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K,S;
cin >> K >>S;
int a=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){
a =a+1;
}
}
}
}
cout << a <<endl;
retu... | a.cc:8:8: error: stray '`' in program
8 | for`(int x = 0;x<=K;x++)
| ^
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before ')' token
10 | for (int y=0;y<=K,y++)
| ^
| ;
a.cc:12:26: error: expected ';' before ')'... |
s888132346 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K,S;
cin >> K >>S;
int a=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){
a +=1;
}
}
}
}
... | a.cc:8:10: error: stray '`' in program
8 | for`(int x = 0;x<=K;++x)
| ^
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before ')' token
10 | for (int y=0;y<=K,++y)
| ^
| ;
a.cc:12:38: error: expect... |
s955520557 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K,S;
cin >> K >>S;
int a=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){
a +=1;
}
}
}
}
cout << (a) <<endl;
return 0;
} | a.cc:8:4: error: stray '`' in program
8 | for`(int x = 0;x<=K;x++)
| ^
a.cc: In function 'int main()':
a.cc:10:22: error: expected ';' before ')' token
10 | for (int y=0;y<=K,y++)
| ^
| ;
a.cc:12:22: error: expected ';' before ')' token
12 | for (... |
s534781951 | p03835 | C++ | #include <iostream>
using namespace std;
int K, S;
int main(){
cin >> K >> S;
int res = 0;
for(int i = 0; i <= K; i++){
for(int j = 0; j <= K; j++){
if(K >= S - i + j ){
res ++;
}
}
}
}
cout << res << endl;
} | a.cc:17:3: error: 'cout' does not name a type
17 | cout << res << endl;
| ^~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s789596866 | p03835 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int S = sc.nextInt();
int count = 0;
for (int i = 0; i < K; i++) {
for (int j = 0; j < K; j++) {
for (int l = 0; l < K; l++) {
... | Main.java:26: error: class, interface, enum, or record expected
import java.util.Scanner;
^
1 error
|
s363265918 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
int answer = 0;
for(int x = 0; x <= K; x++){
if(x > S) break;
else{
for (int y = 0; y <= K; y++){
if (x + y > S) break;
else{
for (int z = 0; z <= K; z++){
... | a.cc: In function 'int main()':
a.cc:24:16: error: expected '}' at end of input
24 | cout << answer;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s205184552 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k, s, i, , c = 0;
cin >> k >> s;
for(i=0; i<=k; i++){
for(j=0; j<=k; j++){
if(s-i-j >=0 && s-i-j <= k){
c++;
}
}
}
cout << c;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:18: error: expected unqualified-id before ',' token
5 | int k, s, i, , c = 0;
| ^
a.cc:8:13: error: 'j' was not declared in this scope
8 | for(j=0; j<=k; j++){
| ^
|
s370262707 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int k,s;
int count=0;
cin>>k>>s;
for(int i=0;i<=k;++i){
for(int j=0;j<=k;++j){
x=s-i-j;
if(x<=k){
if(i==j&&j!=s)count+=3;
else if(i!=j)count+=6;
else count+=0;
}
}
... | a.cc: In function 'int main()':
a.cc:10:17: error: 'x' was not declared in this scope
10 | x=s-i-j;
| ^
|
s159283545 | p03835 | C++ | #include<iostream>
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;j++){
if(S-i-j>=0 && s-i-j<=K){++ans;}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:24: error: 's' was not declared in this scope
10 | if(S-i-j>=0 && s-i-j<=K){++ans;}
| ^
|
s229206373 | p03835 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main(void) {
int k, s, num = 0;
cin >> k >> s;
for (x = 0; x <= k; x++) {
for (y = 0; y <= k; y++) {
for (z = 0; z <= k; z++) {
if (s == x + y + z)num++;
}
}
}
cout << num << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:12:14: error: 'x' was not declared in this scope
12 | for (x = 0; x <= k; x++) {
| ^
a.cc:13:22: error: 'y' was not declared in this scope
13 | for (y = 0; y <= k; y++) {
| ^
a.cc:14:30: error: 'z' was not d... |
s686925792 | p03835 | C++ | #include<cstdio>
#include<iostream>
using namespace std;
int main(void) {
int k, s, num = 0;
cin >> k >> s;
if (x = 0; x <= k; x++) {
if (y = 0; y <= k; y++) {
if (z = 0; z <= k; z++) {
if (s == x + y + z)num++;
}
}
}
cout << num << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'x' was not declared in this scope
12 | if (x = 0; x <= k; x++) {
| ^
a.cc:12:26: error: expected ')' before ';' token
12 | if (x = 0; x <= k; x++) {
| ~ ^
| )
a.cc:12:2... |
s154888900 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k,s;
int ans = 0;
cin >> k >> s;
for(int x=0; x<=k; x++){
for(int y=0; y<=k; y++){
int z = s-x-y;
if(0<=z<=k) ans ++;
}
}
}
cout << ans << endl;
} | a.cc:17:3: error: 'cout' does not name a type
17 | cout << ans << endl;
| ^~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s257568256 | p03835 | C++ | include <iostream>
int main(){
int k,s;
std::cin >> k >> s;
long long res = 0;
for(int i = 0; i <= k; i ++){
for(int j = 0; j <= k; j ++){
int tmp = s - i - j;
if (tmp <= k && tmp >= 0) res ++;
}
}
std::cout << res;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
|
s210447394 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K. S;
cin >> K >> S;
int cnt = 0;
for (int x = 0; x < K; x++){
for (int y = x; y < K; y++){
if (S - x - y >= y && S - x - y <= K){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected initializer before '.' token
5 | int 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;
| ... |
s127130206 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K. S;
cin >> K >> S;
int cnt = 0;
for (int x = 0; x < K; x++){
for (int y = x; y < K; y++){
if (S - x - y >= 0 && S - x - y <= K){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected initializer before '.' token
5 | int 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;
| ... |
s932558051 | 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-i-j>=0&s-i-j<=K)++res;
}
}
cout<<res;
} | a.cc: In function 'int main()':
a.cc:4:19: error: 's' was not declared in this scope
4 | int K,S;cin>>K>>s;
| ^
|
s620324528 | 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-i-y>=0&s-i-j<=K)++res;
}
}
cout<<res;
} | a.cc: In function 'int main()':
a.cc:4:19: error: 's' was not declared in this scope
4 | int K,S;cin>>K>>s;
| ^
a.cc:8:14: error: 'y' was not declared in this scope
8 | if(S-i-y>=0&s-i-j<=K)++res;
| ^
|
s285793107 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int k,s,ans = 0,z;
cin >> k >> s;
for(int i = 0; i <= K; ++i){
for(int j = 0; j <= K; ++j){
z = s - i - j;
if(0 <= z && z <= k){
ans = ans + 1;
}
}
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:9:29: error: 'K' was not declared in this scope
9 | for(int i = 0; i <= K; ++i){
| ^
|
s398681796 | p03835 | C++ | }
| a.cc:1:3: error: expected declaration before '}' token
1 | }
| ^
|
s024144611 | p03835 | C++ | #include < bits/stdc++.h>
using namespace std;
int main(){
int k,s,ans=0;
int z;
for(int x=0;x<=k;x++){
for(int y=0;y<=k;y++){
z = s - x - y;
if(0<=s && s <= k) ans++;
}
}
cout << ans << endl;
} | a.cc:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include < bits/stdc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s599663566 | p03835 | C++ | #include<iostream>
int main(){
int count = 0;
int K, S;
cin >> K >> S;
for(int x = 0;x <= K;x ++){
if(x == S){
count ++;
break;
}
for(int y = 0;y <= K;y ++){
if(x + y == S){
count ++;
break;
}
... | 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; ///< Li... |
s248218716 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int k,s,i,k,l,sum=0;
cin>>k>>s;
for(i=0;i<=k;i++)
{
for(j=0;j<=k;j++)
{
for(l=0;l<=k;l++)
{
if(i+j+l==s)
{
sum++;
}
}
}
... | a.cc: In function 'int main()':
a.cc:5:15: error: redeclaration of 'int k'
5 | int k,s,i,k,l,sum=0;
| ^
a.cc:5:9: note: 'int k' previously declared here
5 | int k,s,i,k,l,sum=0;
| ^
a.cc:9:13: error: 'j' was not declared in this scope
9 | for(j=0;j<=k;j++)
... |
s140926253 | p03835 | Java | public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int k=sc.nextInt();
int t=sc.nextInt();
int count=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==t)count++;
}
}
}
System.out.println(count);
}
} | 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
|
s498508419 | p03835 | C | #include<stdio.h>
int main(){
int x,y,z;
int s,k;
int cnt=0;
int x=0,c=0;
scanf("%d%d",&k,&s);
if(k>s){
k=s;
}
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
for(int n=0;n<=k;n++){
if(i+n+j==s){
cnt++;
break;
}
}
}
}
printf("%d",cnt);
} | main.c: In function 'main':
main.c:7:13: error: redeclaration of 'x' with no linkage
7 | int x=0,c=0;
| ^
main.c:4:13: note: previous declaration of 'x' with type 'int'
4 | int x,y,z;
| ^
|
s689312517 | p03835 | C++ | #include<iostream>
using namespace std;
int s, k;
int ans;
void DFS(int n, int sum){
if (n == 3 && sum == 0){ ++ans; }
else if (n > 3)return;
for (int i = 0; i <= k; ++i){
num[n + 1] = i;
DFS(n + 1, sum - i);
}
}
int main(){
cin >> k >> s;
DFS(0, s);
cout << ans << endl;
} | a.cc: In function 'void DFS(int, int)':
a.cc:9:17: error: 'num' was not declared in this scope; did you mean 'sum'?
9 | num[n + 1] = i;
| ^~~
| sum
|
s142546848 | p03835 | C | #include<iostream>
using namespace std;
int main(){
int x,y,z,k,s,num=0;
cin>>k>>s;
for(z=0;z<=k;z++){
for(y=0;y<=k;y++){
for(x=0;x<=k;x++){
if(x+y+z==s)
num++;
}
}
}
cout<<num;
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s874152792 | p03835 | C++ | int main()
{
int K, S;
cin >> K >> S;
int ans = 0;
for (int X = 0; X <= K; X++)
{
// if (S < X + 0 + 0) break;
for (int Y = 0; Y <= K; Y++)
{
// if (S < X + Y + 0) break;
if (S - (X + Y) >= 0 && S - (X + Y) <= K) ans++;
}
}
cout << ans << 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:17:9: error: 'cout' was not declared in this scope
17 | cout << ans << endl;
| ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope
17 | ... |
s820232225 | p03835 | C++ | 25*25*25=#include<iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
#include<string>
#include<queue>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
int K,S,ans=0;
cin>>K>>S;
for(int i=0;i<=K;i++){
for(j=0;j<=K;j++){
if(S-i-j>=0&&S-i-j<=K){
ans++;
}
}
}
... | a.cc:1:10: error: stray '#' in program
1 | 25*25*25=#include<iostream>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 25*25*25=#include<iostream>
| ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algori... |
s883500672 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b;
long long cnt = 0;
cin >> a >> b;
//a1+a2+a3 == b
for(int i = 0;i < a;i++){
for(int j = 0;j < a-i;j++){
for(int k = 0;k < a-i-j;k++){
if(i+j+k == s) cnt++;
}
}
}
cout << cn... | a.cc: In function 'int main()':
a.cc:14:29: error: 's' was not declared in this scope
14 | if(i+j+k == s) cnt++;
| ^
|
s346179726 | p03835 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include<math.h>
using namespace std;
int main(void){
// Your code here!
int K,S;
cin >> K >> S;
int count = 0;
for(int i = 0;i <= K;i++){
f... | a.cc: In function 'int main()':
a.cc:18:24: error: expected ';' before '}' token
18 | count++
| ^
| ;
19 | };
| ~
|
s126245911 | p03835 | C++ | #include <iostream>
using namespace std;
int main{
int K, S, ans=0;
int sum;
cin >> K >> S;
for(int i=0; i<=K && i<=S; i++){
for(int j=0; j<=K && j<=S; j++){
sum = i+j;
if(S-sum>=0){
ans++;
}else{
break;
}
}
}
cout << ans << endl;
return 0;
}
| a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
6 | int K, S, ans=0;
| ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:8:3... |
s999975628 | p03835 | C | #include<stdio.h>
int main(){
int K, S, i, j, k count = 0;
scanf("%d %d", &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++;
}
}
}
}
printf("%d\n", count);
} | main.c: In function 'main':
main.c:4:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'count'
4 | int K, S, i, j, k count = 0;
| ^~~~~
main.c:8:12: error: 'k' undeclared (first use in this function)
8 | for (k = 0; k <= K; k++){
| ^
main.c:8:1... |
s995883806 | p03835 | C | #include <stdio.h>
/*void sample1(int k,int s){
int x,y,z,res=0;
for(x=0;x<=k;x++){
for(y=0;y<=k;y++){
z = s - x - y;
if(0<=z && z<=k)res++;
}
}
printf("%d\n",res);
}*/
void sample2(int k,int s){
int z,res=0;
if(k == s){
for(z=0;z<=s+1;z++)res += z;
}else if(k > s){
for(z=0;z<=s;z++){
res +=... | main.c: In function 'main':
main.c:36:9: error: implicit declaration of function 'sample1'; did you mean 'sample2'? [-Wimplicit-function-declaration]
36 | sample1(k,s);
| ^~~~~~~
| sample2
|
s981445169 | p03835 | C | #include<stdio.h>
int main(){
int k,s,i,j,z,count=0;
scanf("%d %d",&k,&s);
for(i=0;i<=k;i++){
for(j=0;j<=k;j++){
z = s - i - j;
if(z>=0 && z<=k){
count++;2
}
}
}
printf("%d",count);
return 0;
} | main.c: In function 'main':
main.c:12:30: error: expected ';' before '}' token
12 | count++;2
| ^
| ;
13 | }
| ~
|
s215335640 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int sum;
int main()
{
int a,b;
cin>>a,b;
int i,j;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++)
{
if(s-i-j>=0&&(s-i-j)<=k)sum++;
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'k' was not declared in this scope
9 | for(int i=0;i<=k;i++)
| ^
a.cc:12:12: error: 's' was not declared in this scope
12 | if(s-i-j>=0&&(s-i-j)<=k)sum++;
| ^
|
s962442496 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int sum;
int main()
{
int a,b;
cin>>a,b;
int i,j;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++)
{
if(s-i-j>=0&&s-i-j<=k)ans++;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'k' was not declared in this scope
9 | for(int i=0;i<=k;i++)
| ^
a.cc:12:12: error: 's' was not declared in this scope
12 | if(s-i-j>=0&&s-i-j<=k)ans++;
| ^
a.cc:12:31: error: 'ans' was not declared in this sc... |
s931388273 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int sum;
int main()
{
int a,b;
cin>>a,b;
int i,j;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++)
{
if(s-i-j>=0&&s-x-y<=k)ans++;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:20: error: 'k' was not declared in this scope
9 | for(int i=0;i<=k;i++)
| ^
a.cc:12:12: error: 's' was not declared in this scope
12 | if(s-i-j>=0&&s-x-y<=k)ans++;
| ^
a.cc:12:24: error: 'x' was not declared in this scop... |
s523285286 | p03835 | C | #include <stdio.h>
int max(int a, int b){return a > b ? a : b;}
int main(void){
int k, s;
int count = 0;
scanf("%d %d", &k, &s);
for(int x = max(s - 2 * k, 0); x <= k; x++)
conut += k - max(s - x - k, 0) + 1;
printf("%d\n", count);
return 0;
}
| main.c: In function 'main':
main.c:10:17: error: 'conut' undeclared (first use in this function); did you mean 'count'?
10 | conut += k - max(s - x - k, 0) + 1;
| ^~~~~
| count
main.c:10:17: note: each undeclared identifier is reported only once for each fu... |
s885724434 | p03835 | C | #include <stdio.h>
int min(a, b){return a > b ? b : a;}
int max(a, b){return a > b ? a : b;}
int main(void){
int k, s;
int count = 0;
scanf("%d %d", &k, &s);
for(int x = max(s - 2 * k, 0); x <= k; x++)
conut += k - max(s - x - k, 0) + 1;
printf("%d\n", count);
return 0;
}
| main.c: In function 'min':
main.c:3:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
3 | int min(a, b){return a > b ? b : a;}
| ^~~
main.c:3:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c: In function 'max':
main.c:4:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
4 |... |
s879813119 | p03835 | C | #include<stdio.h>
int main(){
int K, S;
int X, Y, Z;
int cnt=0;
scanf("%d %d", K, S);
for(X=0; X<=K; X++){
for(Y=0; Y<=K; Y++){
for(Z=0; Z<=K; Z++){
if(X+Y+Z===S)
cnt++
}
}
}
return 0;
} | main.c: In function 'main':
main.c:10:21: error: expected expression before '=' token
10 | if(X+Y+Z===S)
| ^
|
s578239597 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int K,S,X,Y,Z;
int res=0;
cin >> K >> S;
for (X=0; X<K; ++X){
for (Y=0; y<K; ++Y){
Z = S-X-Y;
if (0<=Z<=K) ++res;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:9:19: error: 'y' was not declared in this scope
9 | for (Y=0; y<K; ++Y){
| ^
|
s368232260 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int K,S,X,Y,Z;
int res=0;
cin >> K >> S;
for (X=0; X<K; ++X){
for (Y=0; y<K; ++Y){
int Z = S-X-Y;
if (0<=Z<=K) ++res;
}
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:9:19: error: 'y' was not declared in this scope
9 | for (Y=0; y<K; ++Y){
| ^
|
s308308115 | p03835 | C++ | #include<cstdio>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<fstream>
using namespace std;
int main()
{
int x,y,z;
int s,k;
cin>>s>>k;
itn sum=0;
for(x=0;x<=k;x++)
{
for(y=0;y<=k;y++)
{
for(z=0;z<=k;z++)
{
if(x+y+z==s)
{
... | a.cc: In function 'int main()':
a.cc:15:9: error: 'itn' was not declared in this scope; did you mean 'int'?
15 | itn sum=0;
| ^~~
| int
a.cc:24:41: error: 'sum' was not declared in this scope
24 | sum++;
| ... |
s614001465 | p03835 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c=0,d=0,e=0,count=0;
cin>>a>>b;
for(int c=0;c<b/3;c++){
for(int d=0;d<b/3;d++){
e=(b/3)-c-d;
if(e>=0 and b==c+b+e){
count++;
}
}
}
}
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 | }
| ^
|
s179361739 | p03835 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c=0,d=0,e=0,count=0;
cin>>a>>b;
for(int c=0;c<b/3;c++){
for(int d=0;d<b/3;d++){
e=(b/3)-c-d;
if(e>=0 and b==c+b+e)
count++;
}
}
}
cout<<count<<endl;
}
| a.cc:15:3: error: 'cout' does not name a type
15 | cout<<count<<endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s016520576 | p03835 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c=0,d=0,e=0,count=0;
cin>>a>>b;
for(int i=0;i<b/3;i++){
for(int j=0;j<b/3;j++){
for(int k=0;k<b/3;k++){
if(b==i+j+k)
count++
}
}
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | count++
| ^
| ;
12 | }
| ~
|
s470329686 | p03835 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int main()
{
int k,s;
cin >> k >> s;
int i,j,l
int ans = 0;
for(i = 0;i <=k;++i){
for(j = 0;j <= k;++j){
for(l = 0;l <= k;++l){
... | a.cc: In function 'int main()':
a.cc:15:5: error: expected initializer before 'int'
15 | int ans = 0;
| ^~~
a.cc:18:17: error: 'l' was not declared in this scope
18 | for(l = 0;l <= k;++l){
| ^
a.cc:20:23: error: 'ans' was not declared in this scope; did you mean 'a... |
s636782190 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int k,s,i,ans=0;
scanf("%d %d",&k,&s);
for(i=0;i<=k;i++)
{
for(j=0;j<=k;j++)
{
int ij=s-i-j;
if(ij<=k && ij>=0) ans++;
}
}
printf("%d\n",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'j' was not declared in this scope
9 | for(j=0;j<=k;j++)
| ^
|
s303895648 | 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 t = X+Y+Z;
int Z = S - Y - X;
if(t == S){
count++;}
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:11:21: error: 'Z' was not declared in this scope
11 | int t = X+Y+Z;
| ^
a.cc: At global scope:
a.cc:19:3: error: 'cout' does not name a type
19 | cout << count << endl;
| ^~~~
a.cc:21:1: error: expected declaration before '}' token
... |
s588849668 | 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++){
int t = X+Y+Z
if(t == S){
count++;}
}
}
}
cout << count << endl;
}
... | a.cc: In function 'int main()':
a.cc:13:11: error: expected ',' or ';' before 'if'
13 | if(t == S){
| ^~
|
s512208076 | p03835 | C++ | for(int x=0;x<=k;x++)
{
if(x>s) break;
for(int y=x;y<=k;y++)
{
if(y>s) break;
for(int z=y;z<=k;z++)
{
if(z>s) break;
if(x+y+z==s){
if(x==y==z) count+=1;
else if(x==y||y==z||z==x) count... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int x=0;x<=k;x++)
| ^~~
a.cc:1:13: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
a.cc:1:18: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
|
s286313386 | p03835 | C++ | for(int x=0;x<=k;x++)
{
if(x>s) break;
for(int y=x;y<=k;y++)
{
if(y>s) break;
for(int z=y;z<=k;z++)
{
if(z>s) break;
if(x+y+z==s){
if(x==y==z) count+=1;
else if(x==y||y==z||z==x) count... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int x=0;x<=k;x++)
| ^~~
a.cc:1:13: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
a.cc:1:18: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
|
s152725506 | p03835 | C++ | for(int x=0;x<=k;x++)
{
if(x>s) break;
for(int y=x;y<=k;y++)
{
if(y>s) break;
for(int z=y;z<=k;z++)
{
if(z>s) break;
if(x+y+z==s){
if(x==y==z) count+=1;
else if(x==y||y==z||z==x) count... | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int x=0;x<=k;x++)
| ^~~
a.cc:1:13: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
a.cc:1:18: error: 'x' does not name a type
1 | for(int x=0;x<=k;x++)
| ^
|
s584770154 | p03835 | C++ | int main(){
int k, s;
int count=0;
scanf("%d %d", &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) count++;
}
printf("%d\n",count);
return 0;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
4 | scanf("%d %d", &k, &s);
| ^~~~~
a.cc:11:5: error: 'printf' was not declared in this scope
11 | printf("%d\n",count);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is p... |
s428052911 | p03835 | C++ | int main(){
int k, s;
int count=0;
scanf("%d %d", &k, &s);
for(int x=0;x<=k;k++)
for(int y=0;y<=k;y++)
for(int z=0;z<=k;z++)
{
if(x+y+z==s) count++;
}
printf("%d\n",count);
return 0;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
4 | scanf("%d %d", &k, &s);
| ^~~~~
a.cc:11:5: error: 'printf' was not declared in this scope
11 | printf("%d\n",count);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is p... |
s599770035 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,m,ans;
int i,j,k;
int main(){
cin>>n>>m;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++){
k=s-i-j;
if(k<=n&&k>0)ans++;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 's' was not declared in this scope
9 | k=s-i-j;
| ^
|
s826109435 | p03835 | C++ |
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pr... | a.cc:48:53: error: stray '#' in program
48 | #pragma GCC optimize("-fdelete-null-pointer-checks")#include<cstdio>
| ^
a.cc:23:39: warning: bad option '-fwhole-program' to pragma 'optimize' [-Wpragmas]
23 | #pragma GCC optimize("-fwhole-program")
| ... |
s001818554 | p03835 | C | #include<stdio.h>
int main(void)
{
int k=0,s=0,z=0count=0;
scanf("%d%d",&k,&s);
for(int i = 0;i <= k;i++)
{
for(int j = 0;i <= k;j++)
{
z = s - i - j;
if(0 <= z && z <= k){count++;}
}
}
printf("%d",count);
} | main.c: In function 'main':
main.c:5:17: error: invalid suffix "count" on integer constant
5 | int k=0,s=0,z=0count=0;
| ^~~~~~
main.c:12:28: error: 'count' undeclared (first use in this function)
12 | if(0 <= z && z <= k){count++;}
| ^~~~~
main.c:12... |
s012498073 | p03835 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int k,s;
int x,y,z;
int ans=0;
int main(){
int i,j,kk;
cin>>k>>s;
if(3*k<s){
cout<<"0"<<endl;
return 0;
}
if(3*k==s){
cout<<1<<endl;
return 0;
}
int sum;
ans=k*3
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:16: error: expected ';' before 'cout'
19 | ans=k*3
| ^
| ;
20 | cout<<ans<<endl;
| ~~~~
|
s889207731 | p03835 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace ... | a.cc: In function 'int main()':
a.cc:37:18: error: expected primary-expression before '<=' token
37 | for(int i=0; <=K; i++){
| ^~
|
s232257678 | p03835 | C++ | int main()
{
int K, S;
cin >> K >> S;
int sum = 0;
for (int X = 0; X < K + 1; X++) {
for (int Y = 0; Y < K + 1; Y++) {
if (X + Y <= S) {
sum += 1;
}
}
}
cout << sum << 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:13:9: error: 'cout' was not declared in this scope
13 | cout << sum << endl;
| ^~~~
a.cc:13:24: error: 'endl' was not declared in this scope
13 | ... |
s249513391 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int K, S;
cin >> K >> S;
int ans = 0;
if(S <= K){
ans = (S + 2)*(S + 1)*S/6;
}
if(S > K && S <= 2*K){
ans = (S + 2)*(S + 1)*S/6 - 1;
for(int X = K+1;X < S;X++){
ans -= (S-X+1)*(S-X)/2;
}
if(S > 2*K && S <= 3*K){
(S - 2*K... | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main (){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.