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; ...
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 | ...
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 ...
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; ...
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 ++;...
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 ++; ...
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)){ coun...
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...
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> ex...
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: 'cou...
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.m...
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++; } } ...
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++ } } ...
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 | } | ~ ...
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 << coun...
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'...
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 ...
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; constex...
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 no...
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; ...
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; v...
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++...
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 ...
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_classe...
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 scop...
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){ su...
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: ...
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+...
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 ...
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++) ...
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 de...
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.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 '>>...
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...
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]; | ...
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; ...
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; } el...
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...
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...
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++; } } }...
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 '<iost...
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 '<iost...
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++ } } ...
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 << co...
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, cla...
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: ...
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: ...
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 <<...
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++...
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 ++; } } } ...
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; ret...
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 '}...
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 ...
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 i...
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...
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) | ...
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++){ | ...
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 ...
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...
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) { ...
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...
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++; ...
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++; } } } }...
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){ ...
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{ | ^ ...
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){ ...
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{ | ^ ...
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++;} c...
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{ | ^ ...
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 ...
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 ...
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 ...
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]); } } } r...
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 ...
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; | ^