submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s588608482 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int s,k, ans=0;
cin>>k>>s;
for(int i=k; i>=0; i--){
for(int j=k; j>=0; j--){
int lala = s-ij;
if(lala<=k and lala>=0) ans++;
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:22: error: 'ij' was not declared in this scope; did you mean 'j'?
8 | int lala = s-ij;
| ^~
| j
|
s411144107 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int res = 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){
++res;
}
}
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:23: error: expected ')' before '$$'
11 | if (Z >= 0 $$ Z <= K){
| ~ ^~~
| )
|
s204563886 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int res = 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) ++res;
}
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:25: error: '$$' was not declared in this scope
11 | if (Z >= 0) $$ (Z <= K) ++res;
| ^~
|
s047585160 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int res = 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) ++res;
}
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:23: error: expected ')' before '$$'
11 | if (Z >= 0 $$ Z <= K) ++res;
| ~ ^~~
| )
|
s714410278 | 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:14:9: error: 'cout' was not declared in this scope
14 | cout << ans << endl;
| ^~~~
a.cc:14:24: error: 'endl' was not declared in this scope
14 | cout << ans << endl;
| ^~~~
|
s527917407 | 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++){
if(s-i+j<=k) c++
}
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:41: error: expected ';' before '}' token
10 | if(s-i+j<=k) c++
| ^
| ;
11 | }
| ~
|
s032983723 | 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++){
if(s-i+j<=k) c++
}
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:41: error: expected ';' before '}' token
10 | if(s-i+j<=k) c++
| ^
| ;
11 | }
| ~
|
s139673859 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for(int i=0;i<k;i++{
for(int j=0;j<k;j++){
int z=s-i-k;
if(z>=0&&z<=k){
ans++;
}
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:7:22: error: expected ')' before '{' token
7 | for(int i=0;i<k;i++{
| ~ ^
| )
|
s296759462 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((int)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define root sqrt
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vs = vector<string>;
using ll = long long;
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
for (T &x : vec)
is >> x;
return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
// os << '{';
for (int i = 0; i < vec.size(); i++)
{
os << vec[i] << (i + 1 == vec.size() ? '' : ' ');
}
// os << '}';
return os;
}
int main()
{
ll k, s, ans = 0LL;
cin >> k >> s;
rep(i, k)
{
rep(j, k)
{
ll z = s - (i + j);
if (0 <= z && z <= k)
ans++;
}
}
cout << ans << endl;
} | a.cc:30:44: error: empty character constant
30 | os << vec[i] << (i + 1 == vec.size() ? '' : ' ');
| ^~
|
s916250185 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K , S;
cin >> K >> S;
int count = 0;
for(int X = 0;X <= K;X++){
for(int Y = 0;Y <= K;Y++){
for(int Z = 0;Z <= K;Z++){
if(X + Y + Z == S) {
count++;
break;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s209299924 | p03835 | Java | import java.util.*;
class Main{
public static void main(Stinrg[] 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 z = s-x-y;
if((z<=k)&&(z=0)){
count ++;
}
}
}
System.out.println(count);
}
}
| Main.java:4: error: cannot find symbol
public static void main(Stinrg[] args){
^
symbol: class Stinrg
location: class Main
Main.java:13: error: bad operand types for binary operator '&&'
if((z<=k)&&(z=0)){
^
first type: boolean
second type: int
2 errors
|
s959478839 | p03835 | Java | import java.util.*;
class Main{
public static void main(Stinrg[] 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 z = s-x-y;
if((z<=k)&&(z=0)){
count ++;
}
}
}
System.out.println(count);
}
}
import java.util.*;
public class Main{
public static void main(Stinrg[] 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 z = s-x-y;
if((z<=k)&&(z=0)){
count ++;
}
}
}
System.out.println(count);
}
}
提出情報 | Main.java:22: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:42: error: reached end of file while parsing
????
^
2 errors
|
s224966575 | p03835 | Java | import java.util.*;
public class Main{
public static void main(Stinrg[] 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 z = s-x-y;
if((z<=k)&&(z=0)){
count ++;
}
}
}
System.out.println(count);
}
}
| Main.java:3: error: cannot find symbol
public static void main(Stinrg[] args){
^
symbol: class Stinrg
location: class Main
Main.java:12: error: bad operand types for binary operator '&&'
if((z<=k)&&(z=0)){
^
first type: boolean
second type: int
2 errors
|
s995519393 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ll k,s,h=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)h++;
}
}
cout << h;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll k,s,h=0;
| ^~
a.cc:5:10: error: 'k' was not declared in this scope
5 | cin >> k >> s;
| ^
a.cc:5:15: error: 's' was not declared in this scope
5 | cin >> k >> s;
| ^
a.cc:8:29: error: 'h' was not declared in this scope
8 | if(0<=s-i-j&&s-i-j<=k)h++;
| ^
a.cc:11:11: error: 'h' was not declared in this scope
11 | cout << h;
| ^
|
s387778620 | p03835 | C | #include<stdio.h>
int main(){
int K,S,X,Y,count = 0 ;
scanf("%d %d",&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 ){
count ++;
}else{
}
}
}
printf("%d",count);
return 0;
} | main.c: In function 'main':
main.c:11:45: error: expected identifier before '(' token
11 | if( (S-i-j) >= 0 )&&( (S-i-j) <= K ){
| ^
|
s841814741 | p03835 | Java | import java.util.*;
class Main
{
public static void main(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int sum = 0;
for(int x=0 ; x<=k ; x++){
for(int y=0 ; y<=k ; y++){
int x = s-(x+y);
if( (x<=k)&&(x>=0)){
sum++;
}
}
}
}
| Main.java:4: error: <identifier> expected
public static void main(System.in);
^
Main.java:11: error: illegal start of type
for(int x=0 ; x<=k ; x++){
^
Main.java:11: error: <identifier> expected
for(int x=0 ; x<=k ; x++){
^
Main.java:11: error: <identifier> expected
for(int x=0 ; x<=k ; x++){
^
Main.java:11: error: <identifier> expected
for(int x=0 ; x<=k ; x++){
^
5 errors
|
s489383729 | p03835 | C++ | v#include <bits/stdc++.h>
using namespace std;
int main(){
int k,s;
cin >> k >> s;
long long ans = 0;
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:1:2: error: stray '#' in program
1 | v#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
6 | cin >> k >> s;
| ^~~
a.cc:15:5: error: 'cout' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
15 | cout << ans << endl;
| ^~~~
|
s429434817 | p03835 | Java | import java.io.*;
import java.util.*;
final class Solver {
static final Solver INSTANCE = new Solver();
void solve(Iterator<String> sc) {
int K = Integer.parseInt(sc.next());
int S = Integer.parseInt(sc.next());
int sum = 0;
for (int x = 0; x <= K && x <= S; x++) {
int remaining = S - x;
sum += Math.max(Math.min(remaining, K) - Math.max(remaining - K, 0) + 1, 0);
}
System.out.println(sum);
}
}
class Main {
public static void main(String... args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)))
Iterator<String> tokens = reader.lines().map(s -> s.split(" ")).flatMap(Arrays::stream).iterator();
Solver.INSTANCE.solve(tokens);
}
} | Main.java:21: error: ';' expected
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)))
^
1 error
|
s302439379 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){int K,S;
cin>>K>>S;
for(int X=0;X<=K;X++){
for(int Y=0;Y<=K;Y++){
for(int Z=0;Z<=K;Z++){
int rt=0;
if(S==X+Y+Z){
rt++;
}
}
}
}
cout<<rt<<endl;} | a.cc: In function 'int main()':
a.cc:18:17: error: 'rt' was not declared in this scope
18 | cout<<rt<<endl;}
| ^~
|
s598652567 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){int K,S;
cin>>N>>S;
for(int X=0;X<=K;X++){
for(int Y=0;Y<=K;Y++){
for(int Z=0;Z<=K;Z++){
int rt=0;
if(S==X+Y+Z){
rt++
}
}
}
cout<<rt<<endl;} | a.cc: In function 'int main()':
a.cc:4:17: error: 'N' was not declared in this scope
4 | cin>>N>>S;
| ^
a.cc:12:18: error: expected ';' before '}' token
12 | rt++
| ^
| ;
13 | }
| ~
a.cc:17:18: error: 'rt' was not declared in this scope
17 | cout<<rt<<endl;}
| ^~
a.cc:17:28: error: expected '}' at end of input
17 | cout<<rt<<endl;}
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){int K,S;
| ^
|
s183795260 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main){
int K,S;
cin >> K >> S;
int ans = 0;
for(int x = 0; x <= K; ++x){
for(int y = 0; y <= K; ++y){
int z = S - x - y;
if(0 <= z && z <= K) ans++;
}
}
cout << ans << endl;
return 0;
} | a.cc:4:9: error: expected initializer before ')' token
4 | int main){
| ^
|
s452025077 | p03835 | C++ | k, s = map(int,input().split())
ans = 0
for i in range(k+1):
yz = s - i
for j in range(k+1):
if k >= yz - j >= 0:
ans += 1
print(ans) | a.cc:1:1: error: 'k' does not name a type
1 | k, s = map(int,input().split())
| ^
|
s718064929 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K , S;
cin >> K >> S;
int result = 0;
for(int i = 0; i < ; i++){
for(int j = 0; j <= K; j++){
int z = S-(i+j);
if(z >= 0 and z <= K) result++;
}
}
cout << result << endl;
} | a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before ';' token
8 | for(int i = 0; i < ; i++){
| ^
|
s985303151 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int count = 0;
for (int x = 0; x < K+1; i++) {
if ((S - x >=0) && (S - x <= K)) {
for (int y = 0; y < S-X; y++) {
int z = S-x-y;
if (z >= 0 && Z <= K)
count += 1;
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:9:28: error: 'i' was not declared in this scope
9 | for (int x = 0; x < K+1; i++) {
| ^
a.cc:11:27: error: 'X' was not declared in this scope
11 | for (int y = 0; y < S-X; y++) {
| ^
a.cc:13:21: error: 'Z' was not declared in this scope
13 | if (z >= 0 && Z <= K)
| ^
|
s890851070 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int count = 0;
for (x = 0; x < K+1; i++) {
if (S - x >=0) {
for (y = 0; y < S-X; y++) {
int z = S-x-y;
if (z >= 0 && Z <= K)
count += 1;
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:9:8: error: 'x' was not declared in this scope
9 | for (x = 0; x < K+1; i++) {
| ^
a.cc:9:24: error: 'i' was not declared in this scope
9 | for (x = 0; x < K+1; i++) {
| ^
a.cc:11:10: error: 'y' was not declared in this scope
11 | for (y = 0; y < S-X; y++) {
| ^
a.cc:11:23: error: 'X' was not declared in this scope
11 | for (y = 0; y < S-X; y++) {
| ^
a.cc:13:21: error: 'Z' was not declared in this scope
13 | if (z >= 0 && Z <= K)
| ^
|
s177262441 | p03835 | C++ | /#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<pair<int, int>> vpii;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
constexpr auto INF = 4000000000; //4*10^9;
constexpr auto MOD = 1000000007; //10^9+7;
int main()
{
int k,s;
cin >>k>>s;
int ans = 0;
rep(x, k + 1)rep(y, k + 1) {
int z = s - x - y;
if (z < 0 || k < z) continue;
if (x < y&&y < z) { ans += 6;}
if (x == y && y != z) { ans += 3;}
if (x == y && y == z) { ans++;}
}
cout << ans << endl;
} | a.cc:1:2: error: stray '#' in program
1 | /#include <bits/stdc++.h>
| ^
a.cc:1:1: error: expected unqualified-id before '/' token
1 | /#include <bits/stdc++.h>
| ^
a.cc:5:9: error: 'pair' does not name a type
5 | typedef pair<int, int> pii;
| ^~~~
a.cc:6:9: error: 'vector' does not name a type
6 | typedef vector<int> vi;
| ^~~~~~
a.cc:7:9: error: 'vector' does not name a type
7 | typedef vector<vector<int>> vii;
| ^~~~~~
a.cc:8:9: error: 'vector' does not name a type
8 | typedef vector<pair<int, int>> vpii;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:18:5: error: 'cin' was not declared in this scope
18 | cin >>k>>s;
| ^~~
a.cc:32:5: error: 'cout' was not declared in this scope
32 | cout << ans << endl;
| ^~~~
a.cc:32:20: error: 'endl' was not declared in this scope
32 | cout << ans << endl;
| ^~~~
|
s772194021 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++){
int ij=s-i-j;
if(ij<=k&&ij>=0)ans++;
}
}
cout<<ans<<endl;
} | a.cc:13:5: error: 'cout' does not name a type
13 | cout<<ans<<endl;
| ^~~~
a.cc:14:1: error: expected declaration before '}' token
14 | }
| ^
|
s006848618 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int k,s,ans=0;
cin>>k>>s;
int ans=0;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++){
int ij=s-i-j;
if(ij<=k && ij >=0)ans++;
}
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:6:9: error: redeclaration of 'int ans'
6 | int ans=0;
| ^~~
a.cc:4:13: note: 'int ans' previously declared here
4 | int k,s,ans=0;
| ^~~
a.cc: At global scope:
a.cc:13:5: error: 'cout' does not name a type
13 | cout<<ans<<endl;
| ^~~~
a.cc:14:1: error: expected declaration before '}' token
14 | }
| ^
|
s983442309 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for(int i=0;i<=k;i++)
for(int j=0;j<=k;j++){
int ij=s-i-j;
if(ij<=k && ij >=0)ans++;
}
}
cout<<ans<<endl;
} | a.cc:13:5: error: 'cout' does not name a type
13 | cout<<ans<<endl;
| ^~~~
a.cc:14:1: error: expected declaration before '}' token
14 | }
| ^
|
s278785649 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for(int x=0;x<=k;x++){
for(int y=0;y<=k;y++){
int z = s-x-y;
if(z>=0 && z<=k){
ans++:
}
}
}
cout<<ans;
} | a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before ':' token
11 | ans++:
| ^
| ;
|
s554309235 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
int main() {
int k,s,cnt;
cin >> k >> s;
for(int i=0;i<=K;i++){
for(int j=0;j<=K;j++){
int t=s-i-j;
if(0<=t&&t<=K){
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:10:18: error: 'K' was not declared in this scope
10 | for(int i=0;i<=K;i++){
| ^
|
s613917999 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>
using namespace std;
typedef long long llint;
typedef long double ld;
#define inf 1e18
priority_queue<int,vector<int>,greater<int>> que;
llint k,s;
void solve(){
cin >> k >> s;
int ans=0;
for(int x=0;x<=k;x++){
for(int y=0;y<=k;y++){
int z=s-a-b;
if(z>=0 && z<=k)ans++;
}
}
cout << ans << endl;
}
int main(int argc, char *argv[]) {
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:28:33: error: 'a' was not declared in this scope
28 | int z=s-a-b;
| ^
a.cc:28:35: error: 'b' was not declared in this scope
28 | int z=s-a-b;
| ^
|
s641538922 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
using namespace std;
void solve(){
int k, s, ans = 0; cin >> k >> s;
for(int x = 0; x <= k; x++){
for(int y = 0; y <= min(s - x, k); y++){
for(int z = 0; z <= min(s - x - y, k); z++)
if(x + y + z == s) ans++;
if(x + y + z > s) break;
}
}
cout << ans << endl;
return;
}
int main(){
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:15:18: error: 'z' was not declared in this scope
15 | if(x + y + z > s) break;
| ^
|
s687170212 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
using namespace std;
void solve(){
long long int k, s, ans = 0; cin >> k >> s;
for(int i = 0; i <= min(s - k, k); i++){
ans += max(2 * k - (s - i) + 1, 0);
}
for(int i = s - k + 1; i <= k; i++){
ans += s - i + 1;
}
cout << ans << endl;
return;
}
int main(){
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:12:15: error: no matching function for call to 'max(long long int, int)'
12 | ans += max(2 * k - (s - i) + 1, 0);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:12:15: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
12 | ans += max(2 * k - (s - i) + 1, 0);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:12:15: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
12 | ans += max(2 * k - (s - i) + 1, 0);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
|
s320290255 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S; cin >> K >> S;
int ans = 0;
for (int x=0; x<=K; x++) {
for (int y=0; y<=K; y++) {
z = S - x - y;
if (z <= K) ans++;
}
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: 'z' was not declared in this scope
10 | z = S - x - y;
| ^
|
s927878362 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int count = 0;;
for (x = 0; x <= K; x++){
for (y = 0; y <= K; y++){
for (z = 0; z <= K; z++){
if (S == (x + y + z)) count++;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:8:14: error: 'x' was not declared in this scope
8 | for (x = 0; x <= K; x++){
| ^
a.cc:9:14: error: 'y' was not declared in this scope
9 | for (y = 0; y <= K; y++){
| ^
a.cc:10:22: error: 'z' was not declared in this scope
10 | for (z = 0; z <= K; z++){
| ^
|
s105686262 | p03835 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scnnaer(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int sum = 0;
for(int i = 0; i <= k; i++){
for(int j = 0;j <= s - i; j++){
if(n - i - j <= k && n - j - k >= 0){
sum++;
}
}
}
System.out.println(sum);
}
} | Main.java:4: error: cannot find symbol
Scanner sc = new Scnnaer(System.in);
^
symbol: class Scnnaer
location: class Main
Main.java:10: error: cannot find symbol
if(n - i - j <= k && n - j - k >= 0){
^
symbol: variable n
location: class Main
Main.java:10: error: cannot find symbol
if(n - i - j <= k && n - j - k >= 0){
^
symbol: variable n
location: class Main
3 errors
|
s092817600 | p03835 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scnnaer(System.in);
int k + sc.nextInt();
int s = sc.nextInt();
int sum = 0;
for(int i = 0; i < k; i++){
for(int j = 0;j < s - i; j++){
if(n - i - j <= k && n - j - k >= 0){
sum++;
}
}
}
System.out.println(sum);
}
} | Main.java:5: error: ';' expected
int k + sc.nextInt();
^
1 error
|
s716398892 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K,S:
cin >> K >> S;
int count = 0;
for (int x = 0;x <=K;x++){
for (int y = 0;y <=K;y++){
for (int z = 0;z <=K;z++){
if (x+y+z == S){
count++;
}
}
}
}
cout << count;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:10: error: found ':' in nested-name-specifier, expected '::'
5 | int K,S:
| ^
| ::
a.cc:5:9: error: 'S' has not been declared
5 | int K,S:
| ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
6 | cin >> K >> S;
| ^~
a.cc:11:22: error: 'S' was not declared in this scope
11 | if (x+y+z == S){
| ^
|
s136620931 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K, S:
cin >> K >>S ;
int x,y,z;
int a=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++;
}
}
}
}
cout << a ;
} | a.cc: In function 'int main()':
a.cc:5:19: error: found ':' in nested-name-specifier, expected '::'
5 | int K, S:
| ^
| ::
a.cc:5:18: error: 'S' has not been declared
5 | int K, S:
| ^
a.cc:6:15: error: qualified-id in declaration before '>>' token
6 | cin >> K >>S ;
| ^~
a.cc:8:18: error: expected ',' or ';' before ':' token
8 | int a=0:
| ^
|
s426202699 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K, S:
cin >> K >>S ;
int x,y,z;
int a=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++;
}
}
}
}
cout << a ;
} | a.cc: In function 'int main()':
a.cc:5:15: error: found ':' in nested-name-specifier, expected '::'
5 | int K, S:
| ^
| ::
a.cc:5:14: error: 'S' has not been declared
5 | int K, S:
| ^
a.cc:6:11: error: qualified-id in declaration before '>>' token
6 | cin >> K >>S ;
| ^~
a.cc:8:14: error: expected ',' or ';' before ':' token
8 | int a=0:
| ^
a.cc:10:25: error: expected ';' before ')' token
10 | for(x=0 ; x<K ;x++)
| ^
| ;
|
s805138419 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int K, S:
cin >> K >>S ;
int x,y,z;
int a=0:
for(x=0,y=0,z=0; x<K,y<K,z<K ; x++,y++,z++)
{
if(x+y+z == S)
{
a++;
}
}
cout << a ;
} | a.cc: In function 'int main()':
a.cc:5:11: error: found ':' in nested-name-specifier, expected '::'
5 | int K, S:
| ^
| ::
a.cc:5:10: error: 'S' has not been declared
5 | int K, S:
| ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
6 | cin >> K >>S ;
| ^~
a.cc:8:10: error: expected ',' or ';' before ':' token
8 | int a=0:
| ^
a.cc:10:45: error: expected ';' before ')' token
10 | for(x=0,y=0,z=0; x<K,y<K,z<K ; x++,y++,z++)
| ^
| ;
|
s891560075 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std ;
int main()
{
string s ;
cin >> s ;
cout << s[0]<<s[1] <<s[2] << s[3] <<s[4] << " " <<s[6]<<s[7]<<s[8]<<s[9]<<[10]<<s[11]<<s[12]<<" "<<s[14]<<s[15]<<s[16]<<s[17]<<s[18];
} | a.cc: In function 'int main()':
a.cc:9:78: error: expected identifier before numeric constant
9 | cout << s[0]<<s[1] <<s[2] << s[3] <<s[4] << " " <<s[6]<<s[7]<<s[8]<<s[9]<<[10]<<s[11]<<s[12]<<" "<<s[14]<<s[15]<<s[16]<<s[17]<<s[18];
| ^~
a.cc: In lambda function:
a.cc:9:81: error: expected '{' before '<<' token
9 | cout << s[0]<<s[1] <<s[2] << s[3] <<s[4] << " " <<s[6]<<s[7]<<s[8]<<s[9]<<[10]<<s[11]<<s[12]<<" "<<s[14]<<s[15]<<s[16]<<s[17]<<s[18];
| ^~
|
s462252098 | p03835 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int ans=0;
for (int i = 0; i <= k; i++){
for (int j = 0; j <= k; j++){
if(s-i-j<=k){ans+=1}
}
}
cout<<ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:32: error: expected ';' before '}' token
13 | if(s-i-j<=k){ans+=1}
| ^
| ;
|
s376308292 | p03835 | C++ | #include <iostream>
using namespace std;
int main(){
int k,s;
cin>>k>>s;
int cnt;
for(int x=0;x<=k;x++){
for(int y=0;y<=k;y++){
if(x+y>s){
continue;
}
for(int z=0;z<=k;z++){
if(s==x+y+z){
cnt++;
break;
}
}
}
cout<<cnt;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s685569569 | p03835 | C++ | int k,s;
int count {0};
cin >> k;
cin >> s;
for(x=0; x<=k && x<=s; x++) {
for(y=x; y<=k && y<=s; y++) {
for(z=y; z<=k && z<=s; z++) {
if (x+y+z == s) {
if (x == y == x) {
count += 1;
} else if (x == y || x == z || y == z) {
count += 2;
} else {
count += 3;
}
}
}
}
}
cout << count << endl;
return 0;
} | a.cc:4:3: error: 'cin' does not name a type
4 | cin >> k;
| ^~~
a.cc:5:3: error: 'cin' does not name a type
5 | cin >> s;
| ^~~
a.cc:6:3: error: expected unqualified-id before 'for'
6 | for(x=0; x<=k && x<=s; x++) {
| ^~~
a.cc:6:12: error: 'x' does not name a type
6 | for(x=0; x<=k && x<=s; x++) {
| ^
a.cc:6:26: error: 'x' does not name a type
6 | for(x=0; x<=k && x<=s; x++) {
| ^
a.cc:21:3: error: 'cout' does not name a type
21 | cout << count << endl;
| ^~~~
a.cc:22:3: error: expected unqualified-id before 'return'
22 | return 0;
| ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s492882948 | p03835 | C++ | return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
int k,s;
cin>>k>>s;
//simple brute force approach whereas i was struck in finding a better soultion that works for even bigger value of x y and z
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)ans++;
}
}
cout<<ans<<endl;
return 0;
} | a.cc:1:5: error: expected unqualified-id before 'return'
1 | return 0;
| ^~~~~~
a.cc:2:1: error: expected declaration before '}' token
2 | }
| ^
|
s167832457 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, s;
cin >> k >> s;
if (s / k == 3)
cout << "1"
if (s / k == 1)
cout << 3 * k;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'if'
8 | cout << "1"
| ^
| ;
9 | if (s / k == 1)
| ~~
|
s563787428 | p03835 | C++ | #include <iostream>
using namespace std;
int main() {
int K, S;
int count = 0;
int z = 0;
cin >> K >> S;
for (int x = 0; x <= K; x++) {
for (int y = 0; y <= K; y++) {
int z = S - x - y;
if (x + y + z = S) {
count++;
}
}
}
cout << count << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:23: error: lvalue required as left operand of assignment
14 | if (x + y + z = S) {
| ~~~~~~^~~
|
s397458082 | 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:16:1: error: 'cout' was not declared in this scope
16 | cout << ans << endl;
| ^~~~
a.cc:16:16: error: 'endl' was not declared in this scope
16 | cout << ans << endl;
| ^~~~
|
s347184974 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int ans = 0;
for (int a = 0; a <= K; a++) {
for (int b = 0; b <= K; b++) {
if (S <= a + b + K) {
sum += K - a - b;
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:11: error: 'sum' was not declared in this scope
10 | sum += K - a - b;
| ^~~
|
s062334205 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int K, S;
cin >> K >> S;
int ans = 0;
for (int a = 0; a <= K; a++) {
for (int b = 0; b <= K; b++) {
if (S <= a + b + K) {
sum += K - a - b;
}
}
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:9: error: 'sum' was not declared in this scope
10 | sum += K - a - b;
| ^~~
a.cc: At global scope:
a.cc:15:3: error: 'cout' does not name a type
15 | cout << ans << endl;
| ^~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s258117401 | p03835 | C++ | #nclude <iostream>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
int res=0;
for(int x=0;x<=K;x++){
for(int y=0;y<=K;y++){
int z=S-x-y;
if(z<=K){
int sum=x+y+z;
if(sum==S){
res++;
}
}
}
}
cout << res << endl;
} | a.cc:1:2: error: invalid preprocessing directive #nclude; did you mean #include?
1 | #nclude <iostream>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | 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 | #nclude <iostream>
a.cc:21:3: error: 'cout' was not declared in this scope
21 | cout << res << endl;
| ^~~~
a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:18: error: 'endl' was not declared in this scope
21 | cout << res << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #nclude <iostream>
|
s241547753 | p03835 | C++ | #nclude <iostream>
using namespace std;
int main(){
int K,S;
cin >> K >> S;
int res=0;
for(int x=0;x<=K;x++){
for(int y=0;y<=K;y++){
int z=S-x-y;
if(s<=K){
int sum=x+y+z;
if(sum==S){
res++;
}
}
}
}
return res;
} | a.cc:1:2: error: invalid preprocessing directive #nclude; did you mean #include?
1 | #nclude <iostream>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | 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 | #nclude <iostream>
a.cc:12:10: error: 's' was not declared in this scope
12 | if(s<=K){
| ^
|
s431797970 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int K;
int S;
int main(){
int count = 0;
cin >> K >> S;
for(int x; x<=K; x++){
for(int y; y<=K; y++){
int z = S - x - y;
int total = x + y + z;
if(0<=z and z<=K){
count++
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:17:16: error: expected ';' before '}' token
17 | count++
| ^
| ;
18 | }
| ~
|
s799202662 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int K;
int S, count;
int main(){
count = 0;
cin >> K >> S;
for(int x; x<=K; x++){
for(int y; y<=K; y++){
int z = S - x - y;
int total = x + y + z;
if(total == S) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:10:3: error: reference to 'count' is ambiguous
10 | count = 0;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count;
| ^~~~~
a.cc:16:22: error: reference to 'count' is ambiguous
16 | if(total == S) count++;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count;
| ^~~~~
a.cc:19:11: error: reference to 'count' is ambiguous
19 | cout << count << endl;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count;
| ^~~~~
|
s559447751 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int K;
int S, count=0;
int main(){
cin >> K >> S;
for(int x; x<=K; x++){
for(int y; y<=K; y++){
int z = S - x - y;
int total = x + y + z;
if(total == S) count++;
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:15:22: error: reference to 'count' is ambiguous
15 | if(total == S) count++;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count=0;
| ^~~~~
a.cc:18:11: error: reference to 'count' is ambiguous
18 | cout << count << endl;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count=0;
| ^~~~~
|
s409215121 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int K;
int S, count;
int main(){
cin >> K >> S;
for(int x; x<=K; x++){
for(int y; y<=K; y++){
int z = S - x - y;
int total = x + y + z;
if(total == S) count++;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:15:22: error: reference to 'count' is ambiguous
15 | if(total == S) count++;
| ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count;
| ^~~~~
a.cc:18:11: error: reference to 'count' is ambiguous
18 | cout << count << endl;
| ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
4025 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
| ^~~~~
a.cc:8:8: note: 'int count'
8 | int S, count;
| ^~~~~
|
s069118313 | p03835 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int K;
int S, count;
int main(){
cin >> K >> S >> endl;
for(int x; x<=K; x++){
for(int y; y<=K; y++){
int z = S - x - y;
int total = x + y + z;
if(total == S) count++;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:10:17: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin >> K >> S >> endl;
| ~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
| |
s498446412 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int K, S;
cin >> K >> S;
int count = 0;
for (int i = 0; i <= K; i++) {
for (int j = 0; j <= K; j++) {
int val = S-i-j;
if (val >= 0 || val <= K) count ++;
}
}
}
cout << count << endl;
return 0;
} | a.cc:16:5: error: 'cout' does not name a type
16 | cout << count << endl;
| ^~~~
a.cc:17:5: error: expected unqualified-id before 'return'
17 | return 0;
| ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s873853475 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main()
{
int K,S;
cin >> K>>S;
int cnt=0;
REP(i,K+1){
REP(j,K+1){
if(S<=(i+j+K)) cnt++;
}
}
}
cout << cnt << endl;
return 0;
} | a.cc:23:5: error: 'cout' does not name a type
23 | cout << cnt << endl;
| ^~~~
a.cc:24:5: error: expected unqualified-id before 'return'
24 | return 0;
| ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
25 | }
| ^
|
s326679645 | p03835 | C++ | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k,s ;
cin >> k >> s;
int count=0;
for(int x=0;x<s;++x){
for(int y=0;y+i<s;++y){
int z=s-x+y;
if((x+y+z)==s)
count++;
}
}
cout << count << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:19: error: 'i' was not declared in this scope
10 | for(int y=0;y+i<s;++y){
| ^
|
s211502295 | p03835 | C++ | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k,s ;
cin >> k >> s;
int count=0;
for(int x=0;x<s;++i){
for(int y=0;y+i<s;++j){
int z=s-x+y;
if((x+y+z)==s)
count++;
}
}
cout << count << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:21: error: 'i' was not declared in this scope
9 | for(int x=0;x<s;++i){
| ^
a.cc:10:25: error: 'j' was not declared in this scope
10 | for(int y=0;y+i<s;++j){
| ^
|
s020014525 | p03835 | C++ | K,S=map(int,input().split())
ans=0
for a in range(K+1):
for b in range(K+1):
if K>=S-a-b and 0<=S-a-b:
ans+=1
print(ans)
| a.cc:1:1: error: 'K' does not name a type
1 | K,S=map(int,input().split())
| ^
|
s924035067 | p03835 | C++ | K,S=map(int,input().split())
ans=0
for a in range(K+1):
for b in range(K+1):
if K>=S-a-b and 0<=S-a-b:
ans+=1
print(ans)
| a.cc:1:1: error: 'K' does not name a type
1 | K,S=map(int,input().split())
| ^
|
s037407957 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std
int main(void){
int K, S;
int i,j,k,count=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){
count++;
}
}
}
}
cout << count;
}
| a.cc:3:20: error: expected ';' before 'int'
3 | using namespace std
| ^
| ;
4 |
5 | int main(void){
| ~~~
|
s666692660 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K, S, count;
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){
cout++
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:11:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
11 | cout++
| ~~~~^~
|
s546223950 | p03835 | C++ | #include<iostream>
using namespace std;
int main()
{
int K, S, count;
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){
cout++
}
}
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:11:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
11 | cout++
| ~~~~^~
a.cc: At global scope:
a.cc:18:3: error: 'cout' does not name a type
18 | cout << count << endl;
| ^~~~
a.cc:19:3: error: expected declaration before '}' token
19 | }
| ^
|
s925236696 | p03835 | C++ | #include <iostream>
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
int main(){
int K,S; cin >> K >> S;
int count = 0;
REP(x,K){
REP(y,K){
int z = S - x - y;
if (z >= 0 && z <= K) {
++count;
}
}
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:5:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | int K,S; cin >> K >> S;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << count << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout << count << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s858357596 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int counter = 0;
for (int i = 0; i <= K; i++){
for (int j = 0; j <= K - i; j++){
if(3*K - i - j >= 0){
if (S - i - j <= K){
counter++;
}
}
}
cout << counter << endl;
} | a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
19 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s407607715 | p03835 | C | #include <stdio.h>
//Compiler version gcc 6.3.0
int main()
{
int k,s;
int ans=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){
ans++;
}
}
}
}
printf("%d¥n",ans);
return 0;
} | main.c: In function 'main':
main.c:13:21: error: expected expression before '<' token
13 | for(int z=0;z=<k;z++){
| ^
|
s374951394 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep_1(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define rep_2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
int main(){
int k,s;cin >> k >> s;
int count = 0;
rep_1(x,k){
rep_1(y,k){
if(x+y+z == s) count++;
else{x+y+z>s}break;
}
}
cout << count <<endl;
}
| a.cc: In function 'int main()':
a.cc:19:20: error: 'z' was not declared in this scope
19 | if(x+y+z == s) count++;
| ^
|
s725217798 | 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=0;y<=k;++y){
for(int z=0;z<=0;++z){
if( x + y + z == s) ++cnt;
}
}
}
cout << cnt << endl;
} | a.cc:1:10: fatal error: bits/stdc++h: No such file or directory
1 | #include <bits/stdc++h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s942406608 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define lli(n) long long int n = 0;
#define ld long double
#define MAX_L lli max = 9000000000000000000;
#define MIN_L lli min = 9000000000000000000;
#define MAX_D ld max = 4500;
#define MIN_D ld min = -4500;
#define LLI(n) \
lli n; \
cin >> n;
#define LD(n) \
ld n; \
cin > n;
#define LLIV(a, n) \
vector<lli> a(n); \
for (lli i = 0; i < n; i++) \
{ \
cin >> a.at(i); \
};
#define LLIV2(a, b, n) \
vector<lli> a(n), b(n); \
for (lli i = 0; i < n; i++) \
{ \
cin >> a.at(i) >> b.at(i); \
};
#define LDV(a, n) \
vector<ld> a(n); \
for (lli i = 0; i < n; i++) \
{ \
cin >> a.at(i); \
};
#define STR(n) \
string n; \
cin >> n;
#define sum(n) accumulate(n.begin(), n.end(), 0);
#define Sort(n) sort(n.begin(), n.end());
#define Reve(n) reverse(n.begin(), n.end());
#define yes cout << "Yes" << endl; return 0;
#define no cout << "No" << endl; return 0;
#define C45(n) (n + 1) / 2
#define OUT(n) cout << n << endl;
#define SRC(n, c) \
for (lli i = 0; i < s.size(); i++) \
{ \
if (s.at(i) == c) \
{ \
n++; \
} \
};
//こぴー
/*#define ZISYO(s, S) \
for (lli i = 0; i < s.size(); i++) \
{ \
S.at(i) = s.at(i); \
} \
Sort(S) Reve(S) for (lli i = 0; i < s.size(); i++) { s.at(i) = S.at(i); };
*/
//素数
bool IsPrime(lli num)
{
if (num < 2)
return false;
else if (num == 2)
return true;
else if (num % 2 == 0)
return false;
long double sqrtNum = sqrt(num);
for (lli i = 3; i <= sqrtNum; i += 2)
{
if (num % i == 0)
return false;
}
return true;
}
//各桁の和
lli KSum(lli n)
{
lli sum = 0;
if (n < 0)
return 0;
while (n > 0)
{
sum += n % 10;
n /= 10;
}
return sum;
}
int main(void)
{
ios::sync_with_stdio(false);
LLI(K)LLI(S)lli(flag)
for(lli i = 0;i <= K;i++) {
for(lli u = 0;u <= K;u++) {
if(i + u - S <= K) {
flag++;
}
}
}
OUT(flag)
}
| a.cc:5:9: warning: "lli" redefined
5 | #define lli(n) long long int n = 0;
| ^~~
a.cc:4:9: note: this is the location of the previous definition
4 | #define lli long long int
| ^~~
a.cc:63:14: error: 'lli' was not declared in this scope
63 | bool IsPrime(lli num)
| ^~~
a.cc:80:1: error: 'lli' does not name a type
80 | lli KSum(lli n)
| ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'lli' was not declared in this scope
12 | lli n; \
| ^~~
a.cc:96:3: note: in expansion of macro 'LLI'
96 | LLI(K)LLI(S)lli(flag)
| ^~~
a.cc:96:7: error: 'K' was not declared in this scope
96 | LLI(K)LLI(S)lli(flag)
| ^
a.cc:13:10: note: in definition of macro 'LLI'
13 | cin >> n;
| ^
a.cc:96:13: error: expected ';' before 'S'
96 | LLI(K)LLI(S)lli(flag)
| ^
a.cc:12:7: note: in definition of macro 'LLI'
12 | lli n; \
| ^
a.cc:96:13: error: 'S' was not declared in this scope
96 | LLI(K)LLI(S)lli(flag)
| ^
a.cc:13:10: note: in definition of macro 'LLI'
13 | cin >> n;
| ^
a.cc:97:10: error: expected ';' before 'i'
97 | for(lli i = 0;i <= K;i++) {
| ^~
| ;
a.cc:97:17: error: 'i' was not declared in this scope
97 | for(lli i = 0;i <= K;i++) {
| ^
a.cc:98:12: error: expected ';' before 'u'
98 | for(lli u = 0;u <= K;u++) {
| ^~
| ;
a.cc:98:19: error: 'u' was not declared in this scope
98 | for(lli u = 0;u <= K;u++) {
| ^
|
s496961974 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int count = 0;
for(int i = 0; i <= K; i++){
for(int j = 0; j <= K; j++){
if(S - i - j == k) count++;
}
}
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:10:23: error: 'k' was not declared in this scope
10 | if(S - i - j == k) count++;
| ^
|
s310611649 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int K, S;
cin >> K >> S;
int count = 0;
for(int i = 0; i <= K; i++){
for(int j = 0; j <= K; j++){
if(S - i - j == k) count++;
cout << count << endl;
}
| a.cc: In function 'int main()':
a.cc:10:23: error: 'k' was not declared in this scope
10 | if(S - i - j == k) count++;
| ^
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:8:30: note: to match this '{'
8 | for(int i = 0; i <= K; i++){
| ^
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s541855787 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, s;
cin >> k >> s;
int ans;
for(int x=0; x<=k; x++) {
for(int y=0; y<=k; y++) {
int z = s - (x + y);
if(0 <= z && z <= k) {
ans++;
}
}
cout << ans;
}
| a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s548175679 | 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 count = 0;
//K以下の自然数X,Y,Zの合計が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) count++;
}
}
System.out.println(count);
}
} | Main.java:12: error: ';' expected
int z = S - (x + y)
^
1 error
|
s293165015 | 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:3:1: error: extended character is not valid in an identifier
3 | cin >> K >> S;
| ^
a.cc: In function 'int main()':
a.cc:3:1: error: '\U00003000cin' 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;
| ^~~~
|
s352580702 | p03835 | C++ | #include<bits/stdc++>
using namespace std;
int main(){
int a,b;
cin >> a >> b;
int count = 0;
for(int q=0;i<a;i++){
for(int w=0;j<a;j++){
for(int e=0;e<a<e++){
if(q+w+e == b)
count++;
}
}
}
cout << count << endl;
} | a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s278621809 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int k,s,count=0;
cin>>k>>s;
for(int i=0;i<=k;i++){
for(int j=0;j<=k;j++){
int z=s-i-j;
if(z>=0 && z<=k){
count++;
}
}
cout<<count<<'\n';
return(0);
} | a.cc: In function 'int main()':
a.cc:15:4: error: expected '}' at end of input
15 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s818711716 | p03835 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int k,s,m=0;
cin>>k>>s;
for(int x=0;x<=k;x++)
{
if(z>k||y>k||x>k)
{
break;
}
for(int y=0;y<=k;y++)
{
for(int z=0;z<=k;z++)
{
if(x+y+z==s)
{
m++;
}
}
}
}
cout<<m<<endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: 'z' was not declared in this scope
9 | if(z>k||y>k||x>k)
| ^
a.cc:9:17: error: 'y' was not declared in this scope
9 | if(z>k||y>k||x>k)
| ^
|
s117774463 | p03835 | C | #include<stdio.h>
int main() {
int k, s,count=0;
scanf("%d", &k);
scanf("%d", &s);
for (int x = 0; x <= k; x++) {
for (int y = 0; y <= k; y++) {
for (int z = 0; z <= k; z++) {
if (s == (x + y + z)) {
count++;
}
}
}
}
printf("%d\n", count);
return 0;
} | main.c: In function 'main':
main.c:16:15: error: stray '\343' in program
16 | return<U+3000>0;
| ^~~~~~~~
|
s136667785 | p03835 | C++ | int main() {
int k, s;
cin>>k>>s;
int res=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) res++;
}
}
}
cout<<res<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin>>k>>s;
| ^~~
a.cc:8:15: error: lvalue required as left operand of assignment
8 | if(x+y+z=s) res++;
| ~~~^~
a.cc:12:3: error: 'cout' was not declared in this scope
12 | cout<<res<<endl;
| ^~~~
a.cc:12:14: error: 'endl' was not declared in this scope
12 | cout<<res<<endl;
| ^~~~
|
s592716090 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
// Your code here!
int k,s,ans=0;
cin>>k>>s;
iF(k>s){
k=s;
}
for(int i=0; i<=k; i++){
for(int j=0; j<=k; j++){
for(int t=0; t<=k; t++){
if(s==i+j+t){
ans++;
}
}
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:7:5: error: 'iF' was not declared in this scope
7 | iF(k>s){
| ^~
|
s058494724 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
// Your code here!
int k,s,ans=0;
cin>>k>>s;
for(int i=0; i<=k; i++){
for(int j=0; j<=k; j++){
for(int t=0; t<=k; t++){
if(s=i+j+t){
ans++;
}
}
}
}
couT<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:16:5: error: 'couT' was not declared in this scope
16 | couT<<ans<<endl;
| ^~~~
|
s332117411 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll;
int main(){
int s,k;
cin >>s >>k;
int ans = 0;
fot(int x=0; x<=s;x++){
for(int y=0; y<=s;y++){
int z = k - x - y;
if(0<=z&&z<=s)ans++;}}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before 'int'
10 | fot(int x=0; x<=s;x++){
| ^~~
a.cc:10:22: error: 'x' was not declared in this scope
10 | fot(int x=0; x<=s;x++){
| ^
|
s683357983 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll;
int main(){
int s,k;
cin >>s >>k;
int ans = 0;
fot(int x=0; x<=s;x++){
for(int y=0; y<=s;y++){
int z = k - x - y;
if(0<=z&&z<=s)ans++;}}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before 'int'
10 | fot(int x=0; x<=s;x++){
| ^~~
a.cc:10:22: error: 'x' was not declared in this scope
10 | fot(int x=0; x<=s;x++){
| ^
|
s361162444 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll;
int main(){
int s,k;
cin >>s >>k;
int ans = 0;
fot(int x =0;x<=s;x++){
for(int y=0,y<=s;y++){
int z = k - x - y;
if(0<=z&&z<=s)ans++;}}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before 'int'
10 | fot(int x =0;x<=s;x++){
| ^~~
a.cc:10:22: error: 'x' was not declared in this scope
10 | fot(int x =0;x<=s;x++){
| ^
|
s068398706 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll;
int main(){
int s,k;
cin >>s >>k;
int ans = 0;
fot(int x =0;x<=s;x++){
for(int y=0,y<=s;y++){
int z = k - x - y;
if(0<=z&&z<=s)ans++;}}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before 'int'
10 | fot(int x =0;x<=s;x++){
| ^~~
a.cc:10:22: error: 'x' was not declared in this scope
10 | fot(int x =0;x<=s;x++){
| ^
|
s424929330 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll;
int main(){
int s,int k;
cin>>s>>k;
int ans =0;
rep(x,s)rep(y,s){
int z = k-x-y;
if(0<=z&&z<=s)ans++;}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:7:15: error: expected unqualified-id before 'int'
7 | int s,int k;
| ^~~
a.cc:8:17: error: 'k' was not declared in this scope
8 | cin>>s>>k;
| ^
|
s076769450 | p03835 | C++ | #include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
typedef long long ll;
int main{
int s,k;
cin>>s>>k;
int ans =0;
rep(x,s)rep(y,s)rep(z,s){
if(x+y+z == k) ans++;}
cout<<ans<<endl;
}
| a.cc:12:5: error: cannot declare '::main' to be a global variable
12 | int main{
| ^~~~
a.cc:13:9: error: expected primary-expression before 'int'
13 | int s,k;
| ^~~
a.cc:13:9: error: expected '}' before 'int'
a.cc:12:9: note: to match this '{'
12 | int main{
| ^
a.cc:14:9: error: 'cin' does not name a type
14 | cin>>s>>k;
| ^~~
a.cc:9:18: error: expected unqualified-id before 'for'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~~
a.cc:16:9: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:13: error: 'x' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:9: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:21: error: 'y' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:17: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:29: error: 'z' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:25: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:18:9: error: 'cout' does not name a type
18 | cout<<ans<<endl;
| ^~~~
a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s764433816 | p03835 | C++ | #include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
typedef long long ll;
int main{
int s,k;
cin>>s>>k;
int ans =0;
rep(x,s)rep(y,s)rep(z,s){
if(x+y+z == k) ans++;}
cout<<ans<<endl;
}
| a.cc:12:5: error: cannot declare '::main' to be a global variable
12 | int main{
| ^~~~
a.cc:13:9: error: expected primary-expression before 'int'
13 | int s,k;
| ^~~
a.cc:13:9: error: expected '}' before 'int'
a.cc:12:9: note: to match this '{'
12 | int main{
| ^
a.cc:14:9: error: 'cin' does not name a type
14 | cin>>s>>k;
| ^~~
a.cc:9:18: error: expected unqualified-id before 'for'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~~
a.cc:16:9: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:13: error: 'x' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:9: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:21: error: 'y' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:17: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:16:29: error: 'z' does not name a type
16 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:9:31: note: in definition of macro 'rep'
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:9:44: error: expected unqualified-id before '++' token
9 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:16:25: note: in expansion of macro 'rep'
16 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:18:9: error: 'cout' does not name a type
18 | cout<<ans<<endl;
| ^~~~
a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s325478278 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
typedef long long ll;
int main{
int s,k;
cin>>s>>k;
int ans =0;
rep(x,s)rep(y,s)rep(z,s){
if(x+y+z == k) ans++;}
cout<<ans<<endl;
} | a.cc:11:5: error: cannot declare '::main' to be a global variable
11 | int main{
| ^~~~
a.cc:12:9: error: expected primary-expression before 'int'
12 | int s,k;
| ^~~
a.cc:12:9: error: expected '}' before 'int'
a.cc:11:9: note: to match this '{'
11 | int main{
| ^
a.cc:13:9: error: 'cin' does not name a type
13 | cin>>s>>k;
| ^~~
a.cc:8:18: error: expected unqualified-id before 'for'
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~~
a.cc:15:9: note: in expansion of macro 'rep'
15 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:15:13: error: 'x' does not name a type
15 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:8:31: note: in definition of macro 'rep'
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:8:44: error: expected unqualified-id before '++' token
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:15:9: note: in expansion of macro 'rep'
15 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:15:21: error: 'y' does not name a type
15 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:8:31: note: in definition of macro 'rep'
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:8:44: error: expected unqualified-id before '++' token
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:15:17: note: in expansion of macro 'rep'
15 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:15:29: error: 'z' does not name a type
15 | rep(x,s)rep(y,s)rep(z,s){
| ^
a.cc:8:31: note: in definition of macro 'rep'
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^
a.cc:8:44: error: expected unqualified-id before '++' token
8 | #define rep(i,n) for(int i=0; i< (int)(n); ++i)
| ^~
a.cc:15:25: note: in expansion of macro 'rep'
15 | rep(x,s)rep(y,s)rep(z,s){
| ^~~
a.cc:17:9: error: 'cout' does not name a type
17 | cout<<ans<<endl;
| ^~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s109841012 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int k, s;
cin >> k >> s;
int ans;
for(int x=0; x <= k; ++x){
for(int y=0; (x+y) <= k; ++y){
int total = k - x - y;
if(0<=total and toal <=k) ans++;
}
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:23:33: error: 'toal' was not declared in this scope; did you mean 'total'?
23 | if(0<=total and toal <=k) ans++;
| ^~~~
| total
|
s607564664 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int k, s;
cin >> k >> s;
int ans;
for(int x=0; x <= k; ++x){
for(int y=0; (x+y) <= k; ++y){
int total = k - a - b;
if(total==s) ans++;
}
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:22:33: error: 'a' was not declared in this scope
22 | int total = k - a - b;
| ^
a.cc:22:37: error: 'b' was not declared in this scope
22 | int total = k - a - b;
| ^
|
s275390031 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <numeric>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int k, s;
cin >> k >> s;
int ans;
for(int x=0; x <= k; ++a){
for(int y=0; (a+b) <= k; ++b){
int total = k - a - b;
if(total==s) ans++;
}
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:20:28: error: 'a' was not declared in this scope
20 | for(int x=0; x <= k; ++a){
| ^
a.cc:21:25: error: 'b' was not declared in this scope
21 | for(int y=0; (a+b) <= k; ++b){
| ^
|
s011985587 | p03835 | C++ | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;
int main() {
int k, s, a = 0;
cin >> k >> s;
vector<vector<int>> v;
rep(i, k+1){
rep(j, k-i+1){
if(i*2+j+k >= s && i*3+j+2 <= s) v.push_back([i+1, i+j+1, s-2*i-j-2]);
}
}
}
rep(i, v.size()){
unordered_set<int> u;
u.insert(v[i][0]); u.insert(v[i][1]); u.insert(v[i][2]);
if(u.size() == 3) a += 6;
else if(u.size() == 2) a += 2;
else if(u.size() == 1) a += 1;
}
cout << a << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:54: error: expected ',' before '+' token
12 | if(i*2+j+k >= s && i*3+j+2 <= s) v.push_back([i+1, i+j+1, s-2*i-j-2]);
| ^
| ,
a.cc:12:54: error: expected identifier before '+' token
a.cc:12:56: error: expected ']' before ',' token
12 | if(i*2+j+k >= s && i*3+j+2 <= s) v.push_back([i+1, i+j+1, s-2*i-j-2]);
| ^
| ]
a.cc: In lambda function:
a.cc:12:56: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:12:74: error: expected ')' before ']' token
12 | if(i*2+j+k >= s && i*3+j+2 <= s) v.push_back([i+1, i+j+1, s-2*i-j-2]);
| ~ ^
| )
a.cc: At global scope:
a.cc:3:19: error: expected unqualified-id before 'for'
3 | #define rep(i, n) for(int64_t i = 0; i < n; ++i)
| ^~~
a.cc:16:3: note: in expansion of macro 'rep'
16 | rep(i, v.size()){
| ^~~
a.cc:16:7: error: 'i' does not name a type
16 | rep(i, v.size()){
| ^
a.cc:3:38: note: in definition of macro 'rep'
3 | #define rep(i, n) for(int64_t i = 0; i < n; ++i)
| ^
a.cc:3:45: error: expected unqualified-id before '++' token
3 | #define rep(i, n) for(int64_t i = 0; i < n; ++i)
| ^~
a.cc:16:3: note: in expansion of macro 'rep'
16 | rep(i, v.size()){
| ^~~
a.cc:23:3: error: 'cout' does not name a type
23 | cout << a << endl;
| ^~~~
a.cc:24:3: error: expected unqualified-id before 'return'
24 | return 0;
| ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
25 | }
| ^
|
s249020165 | 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 - x; y++) {
z = s - x - y;
if (z>=0 and z<=k) num++;
}
}
cout << num;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:7: error: 'z' was not declared in this scope
11 | z = s - x - y;
| ^
|
s395807112 | 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 - x; y++) {
z = S - x - y;
if (z>=0 and z<=k) num++;
}
}
cout << num;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:7: error: 'z' was not declared in this scope
11 | z = S - x - y;
| ^
a.cc:11:11: error: 'S' was not declared in this scope
11 | z = S - x - y;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.