submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s477147501 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void) {
int k, s;
cin >> k >> s;
int num = 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) num++;
}
}
}
cout << num;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:19: error: lvalue required as left operand of assignment
12 | if (x + y + z = s) num++;
| ~~~~~~^~~
|
s097400694 | p03835 | C++ | #include<stdio.h>
using namespace std;
int main(void) {
int k, s, z, 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 >= 0 && x + y + z == s) {
count++;
}
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | cin >> k >> s ;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:18:9: error: 'cout' was not declared in this scope
18 | cout << count << endl;
| ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:26: error: 'endl' was not declared in this scope
18 | cout << count << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<stdio.h>
+++ |+#include <ostream>
2 | using namespace std;
|
s242538260 | p03835 | C |
#include <iostream>
#include<stdio.h>
using namespace std;
int main(void) {
int k, s, z, 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 >= 0 && x + y + z == s) {
count++;
}
}
}
cout << count << endl;
return 0;
} | main.c:2:10: fatal error: iostream: No such file or directory
2 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s461039261 | p03835 | C | #include <iostream>
#include<stdio.h>
using namespace std;
int main(void) {
int k, s, z, count = 0;
scanf_s("%d %d", &k, &s);
for (int x = 0; x <= k; x++) {
for (int y = 0; y <= k; y++) {
z = s - x - y;
if (z >= 0 && x + y + z == s) {
count++;
}
}
}
printf("%d", count);
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s801940346 | p03835 | C++ |
#include <iostream>
#include<stdio.h>
using namespace std;
int main(void) {
int k, s, z, count = 0;
scanf_s("%d %d", &k, &s);
for (int x = 0; x <= k; x++) {
for (int y = 0; y <= k; y++) {
z = s - x - y;
if (z >= 0 && x + y + z == s) {
count++;
}
}
}
printf("%d", count);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
11 | scanf_s("%d %d", &k, &s);
| ^~~~~~~
| scanf
|
s035868131 | p03835 | C++ | //shara's here
//SPEEEEEEEEEED IS KEEEEEEEEEEY
#include <bits/stdc++.h>
using namespace std;
//fold
typedef int q;
typedef double w;
typedef string s;
typedef long long ll;
//using ll = long long;
typedef long double ld;
const ll INF = 1e18 + 10;
#if !defined(ONLINE_JUDGE)
#include "/home/xsharawi/Desktop/cpp/debug.hpp"
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define push_back pb
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
//endfold
int main(){
speed;
ll x,y,ans=0;
cin>>x>>y;
for(ll i=0;i<=x;i++){
for(ll j=0;j<=x;j++){
ll z= y - (i+j);
if( z>=0 && z<=x ){ans++;}
}
}
cout<<ans<<endl;
return 0;}
/*
███████████████████████████████████████████████████
███████████████████████████████████████████████████
██████████████████████████████████▀████████████████
██████████████████████████████████░▀███████████████
██████████████████████████████▌███░░░▀▀████████████
██▀████████████████████▐██████░▐██░░░░░░▀▀█████████
██░████████████████████▐█████▌░██▌▄░░░░▄▄░▄████▀███
█▌░███████████████████▀░█████░░░█░░░▄████░░███▀▐███
█▌░▐██████████████████░░████▌░░░▀░░▀███▀▀░▐███▄████
██░▀██████████████▌▐█▐▄▄████▌░░░░░░░░░░░░░▌████████
███░███████████████▀░▄▄██▀█▐░░░░░░░░░░░░░░▐████████
███▄░██████████████▄░░░░░░▀▀▀░░░░░░░░░░░░░█▐███████
████▄░██████████████████▄▄▄▄▄▄▐▄░░░░░░░░░░░████████
█████▄█████████████████▀▀▀▀▀▀░░░░░░░░░░░░░░████████
████████████████████████▄░░░░░░░░░░░░░░░▄░░████████
██████████████████████████▄▄▄░░░░░░░░░▄█░▄█████████
████████████████████████████████▄░░░░██▄███▀░░▀████
█████████████████████████████▀█████▄███▀▀▀░░▄▄░████
████████████████████████████▀░░▀░░▀▀░░░░▄▄▄██▀░░▀▀█
███████████████████████████▌░░░░░░░░░░░███████░░░▄█
███████████████▄░▀████████▀░░░░░░▀░░░░███████▌░░░██
███▄▄████████████▄░▀██████▄░░░░░█░░░░████████░░░▀▀
░▀█████████████████▄░▀█████░░░░██░░░░▀██████░░░░░▄█
▐█▄▀█████████████████▄░▀████░░░██▌░░░▐████▀░░░░▄███
▐███▄▀▀█████████████████▄░▀▀░░░░▀██▌▄█▀▀░░░▄▄██████
▀▀▀▀▀░░░▀▀▀▀▀░░░▀▀▀▀▀▀▀▀▀▀▀░░░░░░░▀▀░░░░░░▀▀▀▀▀▀▀▀▀
*/ | a.cc:14:10: fatal error: /home/xsharawi/Desktop/cpp/debug.hpp: No such file or directory
14 | #include "/home/xsharawi/Desktop/cpp/debug.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s205678466 | p03835 | C++ | #include <bits/std++.h>
using namespace std;
int main() {
int k, s; cin >> k >> s;
// [0, k]
long long ans = 0;
for (int i = 0; i <= k; i++)
for (int j = 0; j <= k; j++)
if (0 <= s - i - j && s - i - j <= k)
ans++;
cout << ans << endl;
} | a.cc:1:10: fatal error: bits/std++.h: No such file or directory
1 | #include <bits/std++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s895369545 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int K, S;
int x, y, z;
int cnt = 0;
cin >> K >> S;
for (x = 0; x <= K; ++i){
for (y = 0; y <= K; ++y){
for (z = 0; z <= K; ++z){
if (x + y + z == S){
cnt += 1;
}
}
}
}
cout << cnt << "\n";
} | a.cc: In function 'int main()':
a.cc:14:27: error: 'i' was not declared in this scope
14 | for (x = 0; x <= K; ++i){
| ^
|
s991951005 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
}
#include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
} | a.cc:24:5: error: redefinition of 'int main()'
24 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
|
s307153113 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
}
#include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
} | a.cc:24:5: error: redefinition of 'int main()'
24 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
|
s024746239 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
}
#include <iostream>
using namespace std;
int main(){
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl;
}
提出情報 | a.cc:24:5: error: redefinition of 'int main()'
24 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
a.cc:39:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
39 | 提出情報
| ^~~~~~~~
|
s400579864 | p03835 | C++ | #include <iostream>
using namespace std;
int k, s;
int counter = 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){
counter += 1;
}
}
}
}
cout << counter << endl; | a.cc:7:1: error: 'cin' does not name a type
7 | cin >> k >> s;
| ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for (int x = 0; x <= k; x++){
| ^~~
a.cc:8:17: error: 'x' does not name a type
8 | for (int x = 0; x <= k; x++){
| ^
a.cc:8:25: error: 'x' does not name a type
8 | for (int x = 0; x <= k; x++){
| ^
a.cc:17:1: error: 'cout' does not name a type
17 | cout << counter << endl;
| ^~~~
|
s245542762 | p03835 | C++ | # frozen_string_literal: true
k, s = gets.chomp.split(" ").map(&:to_i)
cnt = 0
(0 .. k).each do |x|
(0 .. k).each do |y|
c = s - x - y
if c >= 0 && c <= k
cnt += 1
end
end
end
puts cnt
| a.cc:1:3: error: invalid preprocessing directive #frozen_string_literal
1 | # frozen_string_literal: true
| ^~~~~~~~~~~~~~~~~~~~~
a.cc:3:1: error: 'k' does not name a type
3 | k, s = gets.chomp.split(" ").map(&:to_i)
| ^
|
s794049335 | p03835 | C++ | 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 (Z < 0 || Z > K) continue;
ans++;
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> K >> S;
| ^~~
a.cc:12:3: error: 'cout' was not declared in this scope
12 | cout << ans << endl;
| ^~~~
a.cc:12:18: error: 'endl' was not declared in this scope
12 | cout << ans << endl;
| ^~~~
|
s098986458 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int sum=0;
for(int i=0;i<=min(K,S);i++){
for(int j=0;j<=min(K,S);j++){
if(S-i-j<=min(K)){
sum++;
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:10:20: error: no matching function for call to 'min(int&)'
10 | if(S-i-j<=min(K)){
| ~~~^~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed:
a.cc:10:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
10 | if(S-i-j<=min(K)){
| ~~~^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided
|
s334906019 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int sum=0;
for(int i=0;i<=min(K,S)){
for(int j=0;j<=min(K,S)){
if(3*K-i-j<=min(K,S)){
sum++;
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before ')' token
8 | for(int i=0;i<=min(K,S)){
| ^
| ;
a.cc:9:28: error: expected ';' before ')' token
9 | for(int j=0;j<=min(K,S)){
| ^
| ;
|
s139855415 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin>>K>>S;
int sum=0;
for(int i=0;i<=min(K,S)){
for(int j=0;j<=min(K,S){
if(3*K-i-j<=min(K,S)){
sum++;
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before ')' token
8 | for(int i=0;i<=min(K,S)){
| ^
| ;
a.cc:9:28: error: expected ';' before '{' token
9 | for(int j=0;j<=min(K,S){
| ^
| ;
a.cc:9:28: error: expected primary-expression before '{' token
a.cc:9:28: error: expected ')' before '{' token
9 | for(int j=0;j<=min(K,S){
| ~ ^
| )
|
s077603927 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S
cin>>K>>S;
int sum=0;
for(int i=0;i<=min(K,S){
for(int j=0;j<=min(K,S){
if(3*K-i-j<=min(K,S)){
sum++;
}
}
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
6 | cin>>K>>S;
| ^~~
a.cc:8:24: error: 'S' was not declared in this scope
8 | for(int i=0;i<=min(K,S){
| ^
a.cc:8:26: error: expected ';' before '{' token
8 | for(int i=0;i<=min(K,S){
| ^
| ;
a.cc:8:26: error: expected primary-expression before '{' token
a.cc:8:26: error: expected ')' before '{' token
8 | for(int i=0;i<=min(K,S){
| ~ ^
| )
a.cc:9:28: error: expected ';' before '{' token
9 | for(int j=0;j<=min(K,S){
| ^
| ;
a.cc:9:28: error: expected primary-expression before '{' token
a.cc:9:28: error: expected ')' before '{' token
9 | for(int j=0;j<=min(K,S){
| ~ ^
| )
|
s844371100 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K;
int S;
int tempZ;
int count = 0;
cin >> K >> S;
// not < , but <= .
for (int i = 0; i <= K; i++) {
for (int j = 0; j <= K; j++) {
tempZ = S - i - j;
if ( 0 <= tempZ && tempZ <= K ) count++;
}
cout << count << endl;
return 0;
} | 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 | {
| ^
|
s717490818 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K;
int S;
int count = 0;
cin >> K >> S;
for (int i = 0; i < N; i++) {
cin >> x[i] >> y[i];
}
// not < , but <= .
for (int i = 0; i <= K; i++) {
for (int j = 0; j <= K; j++) {
for (int k = 0; k <= K; j++) {
if (i + j + k == S) count++;
}
}
}
cout << count << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:29: error: 'N' was not declared in this scope
12 | for (int i = 0; i < N; i++) {
| ^
a.cc:13:24: error: 'x' was not declared in this scope
13 | cin >> x[i] >> y[i];
| ^
a.cc:13:32: error: 'y' was not declared in this scope
13 | cin >> x[i] >> y[i];
| ^
|
s349961817 | p03835 | Java | import java.util.Scanner;
public class Day4H
{
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++)
{
if(i > s)
break;
if(i == s)
{
cnt++;
break;
}
for (int j = 0; j <= k; j++)
{
if (i + j > s)
break;
if(i + j == s)
{
cnt++;
break;
}
for (int l = 0; l <= k; l++)
{
if (i + j + l > s)
break;
if (i + j + l == s)
{
cnt++;
break;
}
}
}
}
System.out.println(cnt);
}
}
| Main.java:3: error: class Day4H is public, should be declared in a file named Day4H.java
public class Day4H
^
1 error
|
s400189101 | p03835 | Java | import java.util.Scanner;
public class Day4H
{
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++)
{
if(i > s)
break;
for (int j = 0; j <= k; j++)
{
if (i + j > s)
break;
for (int l = 0; l <= k; l++)
{
if (i + j + l > s)
break;
if (i + j + l == s)
cnt++;
}
}
}
System.out.println(cnt);
}
}
| Main.java:3: error: class Day4H is public, should be declared in a file named Day4H.java
public class Day4H
^
1 error
|
s881736010 | p03835 | Java | import java.util.Scanner;
public class Day4H
{
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 j = 0; j <= k; j++)
for(int l = 0; l <= k; l++)
if(i + j + l == s)
cnt++;
System.out.println(cnt);
}
}
| Main.java:3: error: class Day4H is public, should be declared in a file named Day4H.java
public class Day4H
^
1 error
|
s636443789 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k, s;
cin >> k >> s;;
int count;
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 << ret;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:15: error: lvalue required as left operand of assignment
11 | if(x+y+z = s){
| ~~~^~
a.cc:18:11: error: 'ret' was not declared in this scope
18 | cout << ret;
| ^~~
|
s673838003 | p03835 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <iomanip>
#include <time.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(){
int k, s;
double sum=0;
cin >> k >> s;
rep(i, k + 1){
rep(j, k + 1){
int z = s - x -y;
if(0 <= z && z <= k){
sum++;
}
}
}
cout << sum << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:19: error: 'x' was not declared in this scope
20 | int z = s - x -y;
| ^
a.cc:20:22: error: 'y' was not declared in this scope
20 | int z = s - x -y;
| ^
|
s177375664 | p03835 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <iomanip>
#include <time.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(){
int k, s;
double sum=0;
cin >> k >> s;
rep(i, k + 1){
rep(j, k + 1){
int z = s - x -y
if(0 <= z && z <= k){
sum++;
}
}
}
cout << sum << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:19: error: 'x' was not declared in this scope
20 | int z = s - x -y
| ^
a.cc:20:22: error: 'y' was not declared in this scope
20 | int z = s - x -y
| ^
|
s443364969 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main(){
int K, S;
cin >> K >> S;
//cout << "S-K: " << S-K << " S: " << S << endl;
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(x+y+z == S) ans++;
//}
z = S - (x+y);
if(S-K <= z && z <= S){
ans++; //zは 0~Kまでなので,S-(x+y)が0~Kに収まっていれば+1すればよい
//cout << "x: " << x << " y: " << y << endl;
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:17:7: error: 'z' was not declared in this scope
17 | z = S - (x+y);
| ^
|
s688982664 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;
int main(){
int k,s;
cin >> k >> s;
int res = 0;
int a, b, c;
int total = a + b +c;
rep(a,k+1){
rep(b,k+1){
rep(c,k+1){
if(total==s) rep++;
}
}
}
cout << res << endl;
}
| a.cc: In function 'int main()':
a.cc:20:46: error: 'rep' was not declared in this scope
20 | if(total==s) rep++;
| ^~~
|
s591246487 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;
int main(){
int k,s;
cin >> k >> s;
int res = 0;
int a, b, c;
int total = a + b +c;
reo(a,k+1){
rep(b,k+1){
rep(c,k+1){
if(total==s) rep++;
}
}
}
cout << res << endl;
}
| a.cc: In function 'int main()':
a.cc:17:9: error: 'reo' was not declared in this scope; did you mean 'res'?
17 | reo(a,k+1){
| ^~~
| res
|
s219816711 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;
int main(){
int k,s;
cin >> k >> s;
int res = 0;
for(int a=0; a<=k; a++){
for(int b=0; b<=k; b++){
for(int c=0; c<=k; c++){
int toal = a + b + c;
if(total==s) res++;
}
}
cout << res << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:36: error: 'total' was not declared in this scope; did you mean 'toal'?
19 | if(total==s) res++;
| ^~~~~
| toal
|
s602322996 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#define rep(i,n) for(int i=0; i< int(n); i++)
using namespace std;
int main(){
int k,s;
cin >> k >> s;
int res = 0;
for(int a=0; a<=k, a++){
for(int b=0; b<=k, b++){
for(int c=0; c<=k, c++){
int toal = a + b + c;
if(total==s) res++;
}
}
cout << res << endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:31: error: expected ';' before ')' token
15 | for(int a=0; a<=k, a++){
| ^
| ;
a.cc:16:39: error: expected ';' before ')' token
16 | for(int b=0; b<=k, b++){
| ^
| ;
a.cc:17:47: error: expected ';' before ')' token
17 | for(int c=0; c<=k, c++){
| ^
| ;
a.cc:19:36: error: 'total' was not declared in this scope; did you mean 'toal'?
19 | if(total==s) res++;
| ^~~~~
| toal
|
s344584459 | p03835 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
cout << fixed << setprecision(10);
int main(){
ll k,s;
cin>>k>>s;
ll ans=0;
rep(i,k+1){
rep(j,k+1){
if(s-i-j<=k&&s-i-j>=0){
ans++;
}
}
}
COUT(ans);
}
| a.cc:36:1: error: 'cout' does not name a type
36 | cout << fixed << setprecision(10);
| ^~~~
|
s677003790 | 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;x++)
{
for(int y=0;y<=K;y++)
{
z=S-x-y;
if(z<=K&&z>=0)
{
ans++;
}
}
}
System.out.println(ans);
}
} | Main.java:12: error: cannot find symbol
z=S-x-y;
^
symbol: variable z
location: class Main
Main.java:13: error: cannot find symbol
if(z<=K&&z>=0)
^
symbol: variable z
location: class Main
Main.java:13: error: cannot find symbol
if(z<=K&&z>=0)
^
symbol: variable z
location: class Main
3 errors
|
s811556244 | p03835 | C++ | #include<stdio.h>
int main(){
int K, S;
int br=0;
scanf("%d%d", &K, &S);
for(int x=0; x<=K; x++){
for(int y=0; y<=K; y++){
int z = S - x - y;
if(z>=0 && z<=K){
br++;
}
}
}
}
printf("%d", br);
return 0;
}
| a.cc:16:11: error: expected constructor, destructor, or type conversion before '(' token
16 | printf("%d", br);
| ^
a.cc:17:5: error: expected unqualified-id before 'return'
17 | return 0;
| ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s464947596 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int bemiho,katoshi = 0;
cin >> bemiho >> katoshi;
int kosakana = 0;
for(int i = 0; i < bemiho + 1; i++) {
for(int j = 0; j < bemiho + 1; j++) {
for(int k = 0; k < bemiho + 1; k++ {
int nibuchan = i + j + k;
if(nibuchan == katoshi) {
kosakana++;
}
}
}
}
cout << kosakana << endl;
}
| a.cc: In function 'int main()':
a.cc:10:41: error: expected ')' before '{' token
10 | for(int k = 0; k < bemiho + 1; k++ {
| ~ ^~
| )
|
s300075462 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int bemiho,katoshi = 0;
cin >> bemiho >> katoshi;
int kosakana = 0;
for(int i = 0; i < bemiho + 1; i++) {
for(int j = 0; j < bemiho + 1; j++) {
for(int k = 0; k < bemiho + 1; k++ {
int nibuchan = i + j + k;
if(nibuchan == katoshi) {
kosakana++;
}
}
}
}
} | a.cc: In function 'int main()':
a.cc:10:41: error: expected ')' before '{' token
10 | for(int k = 0; k < bemiho + 1; k++ {
| ~ ^~
| )
|
s388387881 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
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 = k - x - y;
if(0 <= z && z <= k){
count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:11:21: error: expected primary-expression before '<' token
11 | for(int x = 0; x =< k; x++){
| ^
a.cc:12:23: error: expected primary-expression before '<' token
12 | for(int y = 0; y =< k; y++){
| ^
|
s574154354 | p03835 | Java | package ABC.ABC051;
import java.util.Scanner;
/**
* B - Sum of Three Integers<br>
* https://qiita.com/drken/items/e77685614f3c6bf86f44
*/
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int K = in.nextInt();
int S = in.nextInt();
int answer = 0;
if (S > K*3) {
System.out.println(0);
return;
}
// Z を一定の値に固定した場合で考慮
for(int i = K; i >= 0; i--) {
int tmp1 = S - i;
if (tmp1 > K + K) {
break;
}
for(int j = K; j >= 0; j--) {
int tmp2 = tmp1 - j;
if (tmp2 < 0) {
continue;
}else if(tmp2 > K) {
break;
}
answer++;
}
}
System.out.println(answer);
}
}
| Main.java:9: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s467553159 | p03835 | Java | import java.util.Scanner;
/**
* TITLE : Sum of Three Integers
* URL : https://atcoder.jp/contests/abc051/tasks/abc051_b
*/
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int count = 0;
for (int x = 0; x <= k; x++) {
for (int y = 0; y <= k; y++) {
int temp = s - x - y;
if (temp >= 0 && temp <= k) count++;
}
}
System.out.println(count);
sc.close();
} | Main.java:23: error: reached end of file while parsing
}
^
1 error
|
s982827492 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
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){
for(int z = o;z<=k;++z){
if(x+y+z == s) ++cnt;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:11:19: error: 'o' was not declared in this scope
11 | for(int z = o;z<=k;++z){
| ^
|
s697852570 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int k, s;
cin>>k>>s;
int res = 0;
for(int x = 0; i <= k; x++)
{
for(int y = 0; y <= k; y++)
{
int z = s-x-y;
if(z >= 0 && z <= k)
res++;
}
}
cout<<res<<"\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:24: error: 'i' was not declared in this scope
9 | for(int x = 0; i <= k; x++)
| ^
|
s459944690 | p03835 | Java | import java.io.*;
import java.util.*;
public class TaskB{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
br = new BufferedReader(new InputStreamReader(System.in));
}
public String next(){
try{
while(st==null||!st.hasMoreElements()){
st = new StringTokenizer(br.readLine());
}
}catch(Exception e){
e.printStackTrace();
}
return st.nextToken();
}
public int nextInt(){
return Integer.parseInt(next());
}
public long nextLong(){
return Long.parseLong(next());
}
public double nextDouble(){
return Double.parseDouble(next());
}
public String nextLine(){
String s = "";
try{
s = br.readLine();
}catch(Exception e){
e.printStackTrace();
}
return s;
}
}
public static void main(String[] args){
FastReader in = new FastReader();
PrintWriter out = new PrintWriter(System.out);
int k = in.nextInt();
int s = in.nextInt();
int cnt=0;
for(int i =0 ; i <=k ; i++){
for(int j = 0; j <= k ;j++){
for(int m = 0; m<=k;m++){
if(i+j+m==s)cnt++;
}
}
}
out.println(cnt);
out.flush();
out.close();
}
}
| Main.java:4: error: class TaskB is public, should be declared in a file named TaskB.java
public class TaskB{
^
1 error
|
s076993327 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K,S;
int counter = 0;
cin >> K >> S;
for (int x = 1; x < K + 1; x++) {
for (int y = 1; y < K + 1; y++) {
if ((x + y) <= S) {
counter++
}
}
}
cout << counter << endl;
}
| a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
11 | counter++
| ^
| ;
12 | }
| ~
|
s418209082 | p03835 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
void solve(){
int K,S;
cin>>K>>S;
int count=0;
rep(i,K+1){
if (S-i>K) || (i>S) continue;
rep(j,K+1){
if (S-(i+j)>K) || ((i+j)>S) continue;
rep(k,K+1){
if ((i+j+k)==S){
count++;
break;
}
}
}
}
cout<<count;
}
int main(){
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:14:16: error: expected primary-expression before '||' token
14 | if (S-i>K) || (i>S) continue;
| ^~
a.cc:16:22: error: expected primary-expression before '||' token
16 | if (S-(i+j)>K) || ((i+j)>S) continue;
| ^~
|
s470982147 | p03835 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
#include<math.h>
using namespace std;
void solve(){
int K,S;
cin>>K>>S;
int count=0;
rep(i,K+1){
rep(j,K+1){
rep(k,K+1){
if ((i+j+k)==S)count++;
}
}
}
cout<<count;
}
int main(){
solve();
return 0;
} | a.cc: In function 'void solve()':
a.cc:12:7: error: 'i' was not declared in this scope
12 | rep(i,K+1){
| ^
a.cc:12:3: error: 'rep' was not declared in this scope; did you mean 'frexp'?
12 | rep(i,K+1){
| ^~~
| frexp
|
s148953278 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
long int ans;
for(int x=2;x<K+1;x++){
for(int y=2;y<K+1;y++){
for(int xz2;z<K+1;z++){
if(x+y+z == S){
ans++;
}
}
}
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:10:19: error: 'z' was not declared in this scope
10 | for(int xz2;z<K+1;z++){
| ^
|
s770826703 | p03835 | C++ | int main()
{
using namespace std;
int K;
int 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 && S-x-y>=0){
count++;
}
}
}
cout << count <<endl;
return count;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
8 | 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 | int main()
a.cc:31:5: error: 'cout' was not declared in this scope
31 | cout << count <<endl;
| ^~~~
a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:21: error: 'endl' was not declared in this scope
31 | 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 | int main()
|
s619831690 | p03835 | C | #inlcude <stdio.h>
int main()
{
int S, K, counter = 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)
++counter;
}
}
}
printf("%d\n", counter);
return 0;
} | main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%d %d", &K, &S);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #inlcude <stdio.h>
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | scanf("%d %d", &K, &S);
| ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:19: error: expected expression before ',' token
7 | for(int y = 0;, y <= K; ++y){
| ^
main.c:14:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
14 | printf("%d\n", counter);
| ^~~~~~
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s307624358 | p03835 | C++ | #include <string>
using namespace std;
int main() {
int t = 0, k, s;
cin >> k >> s;
for(int x=0; x<k; x++) {
for(int y=0; y<k; y++) {
if(s-x-y >= 0 && s-x-y <= k) {
t += 1
}
}
}
cout << t << endl;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin >> k >> s;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <string>
+++ |+#include <iostream>
2 |
a.cc:11:22: error: expected ';' before '}' token
11 | t += 1
| ^
| ;
12 | }
| ~
a.cc:15:5: error: 'cout' was not declared in this scope
15 | cout << t << endl;
| ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
15 | cout << t << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include <string>
+++ |+#include <ostream>
2 |
|
s433714417 | p03835 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
int main(){
int n,k,s;
ll tmp;
cin>>k>>s;
int ct=0;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++)
for(int x=0;x<=k;x++)
if(i+j+x == s) ct++;
cout<<ct;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:5: error: 'll' was not declared in this scope
14 | ll tmp;
| ^~
|
s490891040 | p03835 | C++ | int main()
{
int k, s;
cin >> k >> s;
int output = 0;
for (int z = 0; z <= k; z++)
{
if (z < (s - 2 * k))
continue;
if (z < (s - k))
{
output += 2 * k - s + z + 1;
}
else
{
output += s - z + 1;
}
}
cout << output << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> k >> s;
| ^~~
a.cc:22:5: error: 'cout' was not declared in this scope
22 | cout << output << endl;
| ^~~~
a.cc:22:23: error: 'endl' was not declared in this scope
22 | cout << output << endl;
| ^~~~
|
s721435125 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
IOS;
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;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'IOS' was not declared in this scope
4 | IOS;
| ^~~
|
s815163497 | p03835 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main(){
int k,s,cont=0;
scanf("%d%d",&k,&s);
for(int x=0;x<=k;x++){
if((x+y+z)==s){
cont++;
break;
}
for(int y=0;y<=k;y++){
if((x+y+z)==s){
cont++;
break;
}
for(int z=0;z<=k;z++){
if((x+y+z)==s)
cont++;
}
}
}
printf("%d\n",cont);
return 0;
}
| main.c: In function 'main':
main.c:13:11: error: 'y' undeclared (first use in this function)
13 | if((x+y+z)==s){
| ^
main.c:13:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:13: error: 'z' undeclared (first use in this function)
13 | if((x+y+z)==s){
| ^
|
s330150767 | 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(0 <= z && z <= K) 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 | }
| ^
|
s374935458 | p03835 | C++ | #include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
int k, s;
cin >> k >> s;
int cnt = 0;
REP(i, 0, k + 1) {
REP(j, 0, k + 1) {
REP(l, 0, k + 1) {i
if (i + j + l == s) cnt++;
}
}
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:32: error: expected ';' before 'if'
13 | REP(l, 0, k + 1) {i
| ^
| ;
14 | if (i + j + l == s) cnt++;
| ~~
|
s820663927 | p03835 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define int int64_t
#define double long double
#define rep(i, N) for(int i=0; i<N; i++)
#define repr(i, N) for(int i=N-1; i>=0; --i)
#define all(v) v.begin(),v.end()
using namespace std;
//using pr = pair<int, int>;
using tup = tuple<int, int, int>;
using vec = vector<int>;
using vvec = vector<vec>;
//プロトタイプ宣言
bool has_divisor(int, int);
//グローバル変数
//const int MAX_N;
//const int MAX_M;
//vvec data(N, vec(M));
//const int INF = ;
//const int mod = ;
//関数:
/* yにxをn回乗じmodで割った余りを返す。
(素数pに対して x**p = x (mod p) が成り立つ。)*/
int mod_pow(int y, int x, int n, int mod) {
int ans = y;
rep(i, n) {
ans *= x;
ans %= mod;
}
return ans;
}
/* ユークリッドの互除法(mx > mn) */
int gcd(int mx, int mn) {
if(mn == 0) return(mx);
else gcd(mn, mx%mn);
}
/* 素数判定関数 */
bool is_prime(int n) {
if (n == 1) return false;
else if (n == 2) return true;
else {
return !has_divisor(n, 2);
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int k, s; cin >> k >> s;
int n = min(k, s);
int ct = 0;
rep(x, n)rep(y, n) {
int z = s - x - y;
if(z >=0 && z <= k) c++;
}
cout << ct << endl;
return 0;
}
// 以下の関数等は気にしない。
bool has_divisor(int n, int i) {
//base case 1:
if (i == n) return false;
//base case 2:
if (n % i == 0) return true;
return has_divisor(n, i+1);
}
//std::string str;
//str = std::to_string(int i);
//bitset<3> s(N);
//int ans = (char)grid - '0';
//int id = lower_bound(all(arr), x) - arr.begin();
/*struct data {
char *name;
int age;
int height;
double weight;
};*/
/*string ans = w;
string &ref = ans;
rep(i, N) {
ref[i] = arr[i];
}*/
| a.cc: In function 'int main()':
a.cc:61:37: error: 'c' was not declared in this scope
61 | if(z >=0 && z <= k) c++;
| ^
a.cc: In function 'int64_t gcd(int64_t, int64_t)':
a.cc:39:17: warning: control reaches end of non-void function [-Wreturn-type]
39 | else gcd(mn, mx%mn);
| ~~~^~~~~~~~~~~
|
s881781124 | p03835 | Java | import java.util.*;
public class SumOfThreeIntegers{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
sc.close();
int x = 0;
int y = 0;
int z = 0;
int count = 0;
for(x = 0; x <= k; x++) {
for(y = 0; y <= k; y++){
z = s - (x+y);
if (z <= k && z >= 0) {
count++;
}
}
}
System.out.println(count);
}
} | Main.java:4: error: class SumOfThreeIntegers is public, should be declared in a file named SumOfThreeIntegers.java
public class SumOfThreeIntegers{
^
1 error
|
s501825576 | p03835 | Java | import java.util.*;
public class SumOfThreeIntegers{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
sc.close();
int x = 0;
int y = 0;
int z = 0;
int count = 0;
for(x = 0; x <= k; x++) {
for(y = 0; y <= k; y++){
z = s - (x+y);
if (z <= k && z >= 0) {
count++;
}
}
}
System.out.println(count);
}
} | Main.java:4: error: class SumOfThreeIntegers is public, should be declared in a file named SumOfThreeIntegers.java
public class SumOfThreeIntegers{
^
1 error
|
s855918345 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
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&&z<=k) ans++
}
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:27: error: expected ';' before '}' token
12 | if(0<=z&&z<=k) ans++
| ^
| ;
13 | }
| ~
|
s348484805 | p03835 | C++ | #include<iostream>
using namespace std;
int main(void){
int k,s;
cin >> k>>s;
int cnt = 0;
for (int i = 0; i <= k; i++)
{
for (int j = 0; j <= K;j++){
if(0<=s-i-j&&s-i-j<=k){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:9:26: error: 'K' was not declared in this scope
9 | for (int j = 0; j <= K;j++){
| ^
|
s650637750 | p03835 | C++ | #include<iostream>
using namespace std;
int main(void){
int k,s;
cin >> k>>s;
int cnt = 0;
for (int i = 0; i <= K; i++)
{
for (int j = 0; j <= K;j++){
if(0<=s-i-j&&s-i-j<=k){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:7:24: error: 'K' was not declared in this scope
7 | for (int i = 0; i <= K; i++)
| ^
|
s208831799 | p03835 | C++ | #include<iostream>
using namespace std;
int main(void){
int K,S;
cin >> K>>S;
int cnt = 0;
for (int i = 0; i <= K; i++)
{
for (int j = 0; j <= K;j++){
if(0<=s-i-j&&s-i-j<=k){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:10:15: error: 's' was not declared in this scope
10 | if(0<=s-i-j&&s-i-j<=k){
| ^
a.cc:10:29: error: 'k' was not declared in this scope
10 | if(0<=s-i-j&&s-i-j<=k){
| ^
|
s053701117 | p03835 | C++ | #include<iostream>
using namespace std;
int main(void){
int K,S;
cin >> K>>S;
int cnt = 0;
Pe data;
int q = 0;
for (int i = 0; i <= K; i++)
{
for (int j = 0; j <= K;j++){
for (int l = 0; l <= K;l++){
if(0<=s-i-j&&s-i-j<=k){
cnt++;
}
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'Pe' was not declared in this scope
7 | Pe data;
| ^~
a.cc:13:15: error: 's' was not declared in this scope
13 | if(0<=s-i-j&&s-i-j<=k){
| ^
a.cc:13:29: error: 'k' was not declared in this scope
13 | if(0<=s-i-j&&s-i-j<=k){
| ^
|
s287499215 | p03835 | C | #inlcude <stdio.h>
int main(void)
{
int x,y,z,k,s,cnt=0;
scanf("%d", &k);
scanf("%d", &s);
for(x=0; x<k+1; x++) {
for(y=0; y<k+1; y++) {
for(z=0; z<k+1; z++) {
if(x+y+z==s) {
cnt++;
break;
}
}
}
}
printf("%d\n", cnt);
} | main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%d", &k);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #inlcude <stdio.h>
main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | scanf("%d", &k);
| ^~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
17 | printf("%d\n", cnt);
| ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s578024749 | p03835 | C++ | 5 15 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 15
| ^
|
s773024311 | p03835 | C | #include<stdio.h>
main(){
int k,s,x,y,z,t;
scanf("%d%d",&K,&s);
for(x=0;x<=k;x++){
for(y=0;y<=k;k++){
for(z=0;z<=k;z++){
if(x+y+z==s)
t++;
}
}
}
printf("%d",t);
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:23: error: 'K' undeclared (first use in this function)
4 | scanf("%d%d",&K,&s);
| ^
main.c:4:23: note: each undeclared identifier is reported only once for each function it appears in
|
s968486838 | p03835 | Java | import java.util.Scanner;
public class abc051 {
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:3: error: class abc051 is public, should be declared in a file named abc051.java
public class abc051 {
^
1 error
|
s929649541 | p03835 | Java | import java.util.Scanner;
public class abc051 {
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 k=0; k<=K; k++) {
if(i + j + k == S) {
ans++;
}
}
}
}
System.out.println(ans);
}
} | Main.java:3: error: class abc051 is public, should be declared in a file named abc051.java
public class abc051 {
^
1 error
|
s046744233 | p03835 | C | # coding: utf-8
K, S = map(int, input().split())
ans = 0;
for x in range(K+1):
for y in range(K+1):
z = S - x - y
if z >= 0 and z <= K:
ans += 1
print(ans) | main.c:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
main.c:2:1: warning: data definition has no type or storage class
2 | K, S = map(int, input().split())
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'K' [-Wimplicit-int]
main.c:2:4: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
2 | K, S = map(int, input().split())
| ^
main.c:2:8: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
2 | K, S = map(int, input().split())
| ^~~
main.c:2:12: error: expected expression before 'int'
2 | K, S = map(int, input().split())
| ^~~
main.c:3:1: error: expected ',' or ';' before 'ans'
3 | ans = 0;
| ^~~
main.c:5:1: error: expected identifier or '(' before 'for'
5 | for x in range(K+1):
| ^~~
|
s142124768 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
int k, s;
int ans;
cin >> k;
cin >> s;
ans = 0;
for (int x = 0; x<k; x++){
for (int y = 0; y<k; y++){
int z = s - x -y;
if (z >= 0 and z <= K){
ans += 1;
}
}
}
} | a.cc: In function 'int main()':
a.cc:12:27: error: 'K' was not declared in this scope
12 | if (z >= 0 and z <= K){
| ^
|
s481873983 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
int k, s;
int ans;
cin >> k;
cin >> s;
if (s<=k) {
ans = (s+2)*(s+1)/2
} else if (s <= 2*k){
ans = (2*k-s+2)*(2*k-s+1)/2
} else if (s <= 3*k){
ans = (3*k-s +1) *3
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before '}' token
9 | ans = (s+2)*(s+1)/2
| ^
| ;
10 | } else if (s <= 2*k){
| ~
a.cc:11:32: error: expected ';' before '}' token
11 | ans = (2*k-s+2)*(2*k-s+1)/2
| ^
| ;
12 | } else if (s <= 3*k){
| ~
a.cc:13:24: error: expected ';' before '}' token
13 | ans = (3*k-s +1) *3
| ^
| ;
14 | }
| ~
|
s476185576 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
int k, s;
int ans;
cin >> k;
cin >> s;
if (s<=k) {
ans = (s+2)*(s+1)/2
} else if (s <= 2k){
ans = (2*k-s+2)*(2*k-s+1)/2
} else if (s <= 3k){
ans = (3*k-s +1) *3
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before '}' token
9 | ans = (s+2)*(s+1)/2
| ^
| ;
10 | } else if (s <= 2k){
| ~
a.cc:10:19: error: fixed-point types not supported in C++
10 | } else if (s <= 2k){
| ^~
a.cc:11:32: error: expected ';' before '}' token
11 | ans = (2*k-s+2)*(2*k-s+1)/2
| ^
| ;
12 | } else if (s <= 3k){
| ~
a.cc:12:19: error: fixed-point types not supported in C++
12 | } else if (s <= 3k){
| ^~
a.cc:13:24: error: expected ';' before '}' token
13 | ans = (3*k-s +1) *3
| ^
| ;
14 | }
| ~
|
s946119473 | p03835 | C++ | #include <iostream>
using namespace std;
int main(void){
int k, s;
cin >> k;
cin >> s;
if (s<=k) {
ans = (s+2)*(s+1)/2
} else if (s <= 2k){
ans = (2*k-s+2)*(2*k-s+1)/2
} else if (s <= 3k){
ans = (3*k-s +1) *3
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | ans = (s+2)*(s+1)/2
| ^~~
| abs
a.cc:9:19: error: fixed-point types not supported in C++
9 | } else if (s <= 2k){
| ^~
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans = (2*k-s+2)*(2*k-s+1)/2
| ^~~
| abs
a.cc:11:19: error: fixed-point types not supported in C++
11 | } else if (s <= 3k){
| ^~
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans = (3*k-s +1) *3
| ^~~
| abs
a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | cout << ans << endl;
| ^~~
| abs
|
s703606268 | p03835 | C++ | #include <iostreaam>
using namespace std;
int main(void){
int k, s;
cin >> k;
cin >> s;
if (s<=k) {
ans = (s+2)*(s+1)/2
} else if (s <= 2k){
ans = (2*k-s+2)*(2*k-s+1)/2
} else if (s <= 3k){
ans = (3*k-s +1) *3
}
cout << ans << endl;
return 0;
} | a.cc:1:10: fatal error: iostreaam: No such file or directory
1 | #include <iostreaam>
| ^~~~~~~~~~~
compilation terminated.
|
s189025838 | p03835 | C++ | #include<iostream>
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; i++){
for(int k = 0; k <= K; i++){
if(i + j + k = S){
count++;
}
}
}
}
cout << count;
} | a.cc: In function 'int main()':
a.cc:15:42: error: lvalue required as left operand of assignment
15 | if(i + j + k = S){
| ~~~~~~^~~
|
s586175291 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int k,s,c=0;
cin>>k>>s;
for(int i=0; i<=k; i++){
for(int j=0; j<=k; j++)
{
int x;
if(s-(i+j)>=0)
x=s-(i+j);
if(i+j+x==s&&x<=k.)
c++;
}
}
cout<<c<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:27: error: expected unqualified-id before ')' token
17 | if(i+j+x==s&&x<=k.)
| ^
|
s966941073 | 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++;
}
else continue;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:12:7: error: expected ',' or ';' before 'if'
12 | if(z>=0 && z<=k) {
| ^~
a.cc:15:7: error: 'else' without a previous 'if'
15 | else continue;
| ^~~~
|
s807097405 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin>>K>>S;
vector<int> k(K+1);
for(int i=0; i<K+1, i++) cin>>k(i);
int cnt=0;
for(int i, i<K+1, i++){
for(int j, j<K+1, j++){
if(binary_search(k.begin(), k.end(), S-i-j)) cnt++;
}
}
cout<<cnt<<endl;
} | a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before ')' token
9 | for(int i=0; i<K+1, i++) cin>>k(i);
| ^
| ;
a.cc:9:36: error: no match for call to '(std::vector<int>) (int&)'
9 | for(int i=0; i<K+1, i++) cin>>k(i);
| ~^~~
a.cc:13:17: error: expected ';' before '<' token
13 | for(int i, i<K+1, i++){
| ^
| ;
a.cc:13:17: error: expected primary-expression before '<' token
a.cc:13:26: error: expected ';' before ')' token
13 | for(int i, i<K+1, i++){
| ^
| ;
a.cc:14:21: error: expected ';' before '<' token
14 | for(int j, j<K+1, j++){
| ^
| ;
a.cc:14:21: error: expected primary-expression before '<' token
a.cc:14:30: error: expected ';' before ')' token
14 | for(int j, j<K+1, j++){
| ^
| ;
|
s733609796 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin>>K>>S;
vector<int> k(K+1)
for(int i=0; i<K+1, i++) cin>>k(i);
int cnt=0;
for(int i, i<K+1, i++){
for(int j, j<K+1, j++){
if(binary_search(k.begin(), k.end(), S-i-j)) cnt++;
}
}
cout<<cnt<<endl;
} | a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
9 | for(int i=0; i<K+1, i++) cin>>k(i);
| ^~~
a.cc:9:18: error: 'i' was not declared in this scope
9 | for(int i=0; i<K+1, i++) cin>>k(i);
| ^
a.cc:13:17: error: expected ';' before '<' token
13 | for(int i, i<K+1, i++){
| ^
| ;
a.cc:13:17: error: expected primary-expression before '<' token
a.cc:13:26: error: expected ';' before ')' token
13 | for(int i, i<K+1, i++){
| ^
| ;
a.cc:14:21: error: expected ';' before '<' token
14 | for(int j, j<K+1, j++){
| ^
| ;
a.cc:14:21: error: expected primary-expression before '<' token
a.cc:14:30: error: expected ';' before ')' token
14 | for(int j, j<K+1, j++){
| ^
| ;
|
s530177313 | 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:15:24: error: expected ';' before '}' token
15 | count++
| ^
| ;
16 | }
| ~
|
s817961093 | p03835 | C++ | #include <bits/stdc++.h>
typedef unsigned long long int ull;
typedef long double ldb;
typedef long long int ll;
#define for01(k,n) for (ll i=k; i<n; i++)
#define for02(k,n) for (ll j=k; j<n; j++)
#define for03(k,n) for (ll k=k; k<n; k++)
#define for11(k,n) for (ll i=k; i<=n; i++)
#define for12(k,n) for (ll j=k; j<=n; j++)
#define for13(k,n) for (ll k=k; k<=n; k++)
#define pb push_back
#define mp make_pair
#define pf push_front
#define popf pop_front
#define popb pop_back
#define vll vector<ll>
#define F first
#define S second
#define pp pair <ll, ll>
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define si size()
#define bk back()
#define deci(n) fixed<<setprecision(n)
#define p0(a) cout << a << " "
#define p1(a) cout << a << "\n"
#define mem(a,n) memset(a, n, sizeof(a)); // n = 0 OR -1 only
#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define MOD 1000000007
#define MOD2 998244353
#include <boost/algorithm/string/replace.hpp>
using namespace std;
int fast_pow(ll base, ll n, ll M = 1) // calculate the value of base^p in O(log p)
{
if(n==0)
return 1;
if(n==1)
return base;
ll halfn = fast_pow(base, n/2, M);
if(n%2==0)
return ( halfn * halfn ) % M;
else
return ( ( ( halfn * halfn ) % M ) * base ) % M;
}
int main()
{
ll k1,s;
cin >> k1 >> s;
ll ct = 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)
ct++;
}
}
}
p1(ct);
return 0;
}
| a.cc:42:10: fatal error: boost/algorithm/string/replace.hpp: No such file or directory
42 | #include <boost/algorithm/string/replace.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s219923935 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S ;
cin >> K >> S ;
int c,d,e;
int f =0;
for(int c =0; c<=K; c++){
for(int d = 0; d<=K; d++){
if((S -(c+d) >= 0) &&((S-(c+d) <= K))
f++;
}
}
cout << f << endl;
}
| a.cc: In function 'int main()':
a.cc:12:44: error: expected ';' before 'f'
12 | if((S -(c+d) >= 0) &&((S-(c+d) <= K))
| ^
| ;
13 | f++;
| ~
a.cc:15:8: error: expected primary-expression before '}' token
15 | }
| ^
a.cc:13:16: error: expected ')' before '}' token
13 | f++;
| ^
| )
14 |
15 | }
| ~
a.cc:12:9: note: to match this '('
12 | if((S -(c+d) >= 0) &&((S-(c+d) <= K))
| ^
a.cc:15:8: error: expected primary-expression before '}' token
15 | }
| ^
|
s162211276 | p03835 | C++ | int main() {
int K, S ;
cin >> K >> S ;
int c,d,e;
int f =0;
for(int c =0; c<K; c++){
for(int d = 0; d<K; d++){
for(int e = 0; e<K ;e++){
int sum = e+d+c;
if(sum == S)
f++;
}
}
}
cout << f << endl;
} | a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
3 | cin >> K >> S ;
| ^~~
a.cc:16:3: error: 'cout' was not declared in this scope
16 | cout << f << endl;
| ^~~~
a.cc:16:16: error: 'endl' was not declared in this scope
16 | cout << f << endl;
| ^~~~
|
s256417380 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int mine(){
int k,s,ans=0;
cin>>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) ans++;
}
}
}
cout<<ans;
}
| a.cc: In function 'int mine()':
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 status
|
s211279207 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s;xin >> 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(x+y+z == s)ans += 1;
}
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:11: error: 'xin' was not declared in this scope; did you mean 'sin'?
5 | int k,s;xin >> k >> s;
| ^~~
| sin
|
s372342815 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int K, S;
cin >> K >> S;
int cnt;
for (int x = K; x >= 0; x--){
if (x + 2 * K < S) {
break;
}
for (int y = K; y >= 0; y--){
if (x + y + K < S){
break;
}
else {
cnt++
}
}
}
cout << cnt << endl;
}
| a.cc: In function 'int main()':
a.cc:20:22: error: expected ';' before '}' token
20 | cnt++
| ^
| ;
21 | }
| ~
|
s301576994 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int K, S;
cin >> K >> S;
int cnt;
for (int x = K; x >= 0; x--){
if (x + 2 * K < S) {
break;
}
for (int y = K; y >= 0; y--){
if (x + y + K < S){
breakl;
}
for (int z = K; z >= 0; z--){
if (x + y + z == S){
cnt++;
}
else if (x + y + z < S){
break;
}
}
}
}
cout << cnt << endl;
}
| a.cc: In function 'int main()':
a.cc:17:17: error: 'breakl' was not declared in this scope
17 | breakl;
| ^~~~~~
|
s058845573 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int K, S;
cin >> K >> S;
int cnt;
for (int x = K; x >= 0; x--){
for (int y = K; y >= 0; y--){
for (int z = K; z >= 0; z--){
if (x + y + z == S){
cnt++;
}
else if (x + y + z < S){
break;
}
}
if (x + y + z < S){
break;
}
}
cout << cnt << endl;
}
| a.cc: In function 'int main()':
a.cc:21:25: error: 'z' was not declared in this scope
21 | if (x + y + z < S){
| ^
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s648199036 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
int main() {
int K, S;
cin >> K >> S;
int cnt;
for (int x <= K; x >= 0; x--){
for (int y <= K; y >= 0; y--){
for (int z <= K; z >= 0; z--){
if (x + y + z == S){
cnt++;
}
else if (x + y + z < S){
break;
}
}
}
}
cout << cnt << endl;
}
| a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before '<=' token
11 | for (int x <= K; x >= 0; x--){
| ^~~
| ;
a.cc:11:16: error: expected primary-expression before '<=' token
11 | for (int x <= K; x >= 0; x--){
| ^~
a.cc:11:28: error: expected ')' before ';' token
11 | for (int x <= K; x >= 0; x--){
| ~ ^
| )
a.cc:11:30: error: 'x' was not declared in this scope
11 | for (int x <= K; x >= 0; x--){
| ^
|
s975805154 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b, num = 0, z;
cin >> a >> b;
for(int x = 0; x <= a; x++) {
for(int y = 0; y <= a; y++) {
z = b - x - y;
if(z => 0 && z <= b) {
num += 1;
}
}
}
cout << num << endl;
} | a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before '>' token
11 | if(z => 0 && z <= b) {
| ^
|
s524194011 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int input_a, result;
cin >> input_a;
cin >> result;
int answer = 0;
for(int i = 0; i <= input_a; i++) {
for(int b = 0; b <= input_a; b++) {
int c = result - i - b;
if(0 <= c && result == (i + b + c)) {
answer++;
}
}
}
cout << answer << endl; | a.cc: In function 'int main()':
a.cc:17:28: error: expected '}' at end of input
17 | cout << answer << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s223947842 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
double pi = 3.141592653589793;
ll mod = 1000000007;
ll INF = 1000000001;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int main(){
int k, s, ans = 0;
cin >> k >> s;
rep(x,k+1){
rep(y,k+1){
z == s - x - y;
if (z>=0&&z<=k){
ans++;
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:35:13: error: 'z' was not declared in this scope
35 | z == s - x - y;
| ^
|
s634069552 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K,S;
int count;
cin >> K >> S;
for(int X = 0;X<=K;X++){
for(int Y = 0;Y<=K;Y++){
if(S-X=Y>=0 && S-X-Y <= K){count++;}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:12:17: error: lvalue required as left operand of assignment
12 | if(S-X=Y>=0 && S-X-Y <= K){count++;}
| ~^~
|
s885720917 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K,S;
int X,Y,Z;
int count;
cin >> K >> S;
while(total <= S){
for(int i = K;i>=0;i--){
X = i;
for(int ii = K;ii>=0;ii--){
Y = ii;
for(int iii = K;iii>=0;iii--){
Z = iii;
if(X + Y + Z == S){count++;}
}
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'total' was not declared in this scope
11 | while(total <= S){
| ^~~~~
|
s885174763 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int counter;
counter = 0;
for (int i=0; i<=K; i++){
for (int j=i; j<=K; j++){
for (int k=j; k<=K; k++){
if(i+j+k == S){
if(i==j && j==k){
counter++;
}else(i==j || j==k){
counter = counter+2;
}else{
counter = counter+3;
}
}
}
}
}
cout << counter << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '{' token
17 | }else(i==j || j==k){
| ^
| ;
a.cc:19:12: error: expected '}' before 'else'
19 | }else{
| ^~~~
a.cc:14:23: note: to match this '{'
14 | if(i+j+k == S){
| ^
a.cc: At global scope:
a.cc:27:3: error: 'cout' does not name a type
27 | cout << counter << endl;
| ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
28 | return 0;
| ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
s573100619 | p03835 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int k,
s,
x,
y,
z,
res,
cin>>k>>s;
for(x = k; x == 0; x--){
for( y = k; y == 0; y--){
if( (x + y) > s){
continue;
}else{
if( (s - x) == (y + z) )
res++;
}
}
}
cout<<res;
} | a.cc: In function 'int main()':
a.cc:12:6: error: expected initializer before '>>' token
12 | cin>>k>>s;
| ^~
|
s176468298 | 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;j++){
if(s-i-j<=k){
ans++;
}
}
}
}
cout<<ans<<endl;
} | a.cc:14:3: error: 'cout' does not name a type
14 | cout<<ans<<endl;
| ^~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s893430258 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s,ans=0;
cin>>k>>s;
for(int p=0;p<=k;p++){
for(int q=0;q<=k;q++){
for(int r=0;r<=k;r++){
if(p+q+r==n){
ans++;
}
}
}
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:19: error: 'n' was not declared in this scope
9 | if(p+q+r==n){
| ^
|
s583024737 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K , S , i , j , k, cnt=0;
cin >> 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 ){
cnt++
break;
}
}
}
}
cout << cnt << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before 'break'
13 | cnt++
| ^
| ;
14 | break;
| ~~~~~
|
s402212568 | p03835 | C++ | #include<bits/stc++.h>
using namespace std;
int K, S;
int main () {
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) && ((S-x-y) >= 0)) {
count++;
}
}
}
} | a.cc:1:9: fatal error: bits/stc++.h: No such file or directory
1 | #include<bits/stc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.