submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s576217400
p03835
C++
#include <iostream> using namespace std; int main() { int K, S; cin >> K >> S; int count = 0; for (int X = 0; X <= K; X ++){ for (int Y = 0; Y <= K; Y ++){ for (int Z = 0; Z <= K; Z ++){ if (X + Y + Z = S){ count ++; } } } } cout << count << '\n'; }
a.cc: In function 'int main()': a.cc:11:19: error: lvalue required as left operand of assignment 11 | if (X + Y + Z = S){ | ~~~~~~^~~
s928284892
p03835
C++
int main(void) { int K, S, t, z; cin >> K >> S; t = 0; for(int x = 0; x <= K; x++){ for(int y = 0; y <= K; y++){ z = S - x - y; if(0 <= z &&z <= K){ t++; } } } cout << t << endl; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> K >> S; | ^~~ a.cc:14:3: error: 'cout' was not declared in this scope 14 | cout << t << endl; | ^~~~ a.cc:14:16: error: 'endl' was not declared in this scope 14 | cout << t << end...
s759136072
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin >> K >> S; int count=0; for(int i=0; i<=K; i++;){ for(int j=0; j<=K; j++;){ if(S-K <= (i+j) && (i+j)<= S){ count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:10:25: error: expected ')' before ';' token 10 | for(int i=0; i<=K; i++;){ | ~ ^ | ) a.cc:10:26: error: expected primary-expression before ')' token 10 | for(int i=0; i<=K; i++;){ | ^
s167084020
p03835
C++
#include <iostream> using namespace std; int main(void){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; x++) { for(int y = 0; y <= K; y++S) { int z = S - x - y; if(0 <= z and z <= K) { ans = ans + 1; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:30: error: expected ')' before 'S' 14 | for(int y = 0; y <= K; y++S) | ~ ^ | ) a.cc:14:31: error: expected ';' before ')' token 14 | for(int y = 0; y <= K; y++S) | ...
s005831145
p03835
C++
#include <iostream> using namespace std; int main(void){ 2 int K,S; 3 cin >> K >> S; 4 1 5 int ans = 0; 6 7 for(int x = 0; x <= K; ++x){ 8 for(int y = 0; y <= K; ++y){ 9 int z = S - x - y; 10 if(0 <= z and z <= K){ 11 ans = ans + 1; 12 } 13 } 14 } 15 16 cout << ans << endl; 17 18 }
a.cc: In function 'int main()': a.cc:6:2: error: expected ';' before 'int' 6 | 2 int K,S; | ^~~~ | ; a.cc:7:2: error: expected ';' before 'cin' 7 | 3 cin >> K >> S; | ^~~~ | ; a.cc:8:2: error: expected ';' before numeric constant 8 | 4 | ^ | ; 9 | 1 | ~ a...
s731441144
p03835
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int ans = 0; for (int i = 0; i <= k; i++) { for (int j = 0; j <= k; j++) { for ...
Main.java:17: error: reached end of file while parsing } ^ 1 error
s284920454
p03835
C++
#include<bits/stdc++.h> using namespace std; #define sz(x) (int)x.size() #define pb push_back #define mp make_pair #define ll long long #define mod 1000000007 void setIO(string name) { ios_base::sync_with_stdio(0); cin.tie(0); freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout); } ...
a.cc: In function 'int main()': a.cc:25:14: error: 'i' was not declared in this scope 25 | for(int x=i;x<=min(s,k);x++){ | ^
s530491176
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K,S; cin >> K >> S; int count = 0; for(int x = 0; x <= K; x++){ for(int y = 0; y <= K; y++){ int z = S - x - y; if(z >= 0 && z <= K){ count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s512242660
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K,S; cin >> K >> S; int count = 0; for(int x = 0; x <= K; x++){ for(int y = 0; y <= K; y++){ for(int z = 0; z <= K; z++){ if( (x + y + z) == S){ count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s452011675
p03835
C++
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで #include <bits/stdc++.h> #define mod 1000000007 #define INF 1001001001 #define int long long #define ln cout<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define rep(i,n) REP(i,0,n)...
cc1plus: error: '::main' must return 'int'
s779423837
p03835
C++
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで #include <bits/stdc++.h> #define mod 1000000007 #define INF 1001001001 #define ll long long #define ln cout<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rep(i,n) REP(i,0,n) usi...
a.cc: In function 'int main()': a.cc:37:23: error: expected primary-expression before ')' token 37 | rep(i,(k+1)*(k+1))){ | ^
s856559319
p03835
C++
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで #include <bits/stdc++.h> #define mod 1000000007 #define INF 1001001001 #define ll long long #define ln cout<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rep(i,n) REP(i,0,n) usi...
a.cc: In function 'int main()': a.cc:29:13: error: request for member 'size' in 'v', which is of non-class type 'long long int [(n + 1)]' 29 | rep(i,v.size()){ | ^~~~ a.cc:10:44: note: in definition of macro 'REP' 10 | #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) | ...
s225522453
p03835
C++
#include <vector> #include <algorithm> #include <cmath> typedef long long ll; #define rep(i,n) for(int i = 0;i<n;++i) #define repi(itr,vec) for(auto itr = vec.begin();itr!=vec.end();++itr) using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll k, s; cin >> k >> s; ll a...
a.cc: In function 'int main()': a.cc:9:9: error: 'ios' has not been declared 9 | ios::sync_with_stdio(false); | ^~~ a.cc:10:9: error: 'cin' was not declared in this scope 10 | cin.tie(nullptr); | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is...
s390272336
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K,S cin >> K >> S; int C = 0 for (int i = 0; i < K; i++) { for (int j = 0; j < K; j++){ for(int k = 0; k < K; k++){ if(i+j+k == S){ C++; } } } } cout << C << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: expected initializer before 'cin' 6 | cin >> K >> S; | ^~~ a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for (int i = 0; i < K; i++) { | ^~~ a.cc:8:19: error: 'i' was not declared in this scope 8 | for (int i = 0; i < K; i++) { ...
s318311036
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { cin >> K >> S; int C = 0 for (int i = 0; i < K; i++) { for (int j = 0; i < K; j++){ for(int k = 0; i < K; k++){ if(i+j+k == S){ C++; } } } } cout << C << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: 'K' was not declared in this scope 5 | cin >> K >> S; | ^ a.cc:5:15: error: 'S' was not declared in this scope 5 | cin >> K >> S; | ^ a.cc:7:3: error: expected ',' or ';' before 'for' 7 | for (int i = 0; i < K; i++) {...
s849135618
p03835
C++
#include<iostream> using namespace std; int main() { int n,s; cin>>n>>s; long int cnt=0; for(int i=0;i<=n;i++) { int t1=s-i; if(t1>2*n) continue; for(int j=0;j<=n;j++) { int t2=t1-j; if(t2>n) coninue; for(int k=0;k<=n;k++) { if(i+j+k==s) cnt++; } ...
a.cc: In function 'int main()': a.cc:14:12: error: 'coninue' was not declared in this scope 14 | coninue; | ^~~~~~~
s824745832
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k,s,ans=0; cin >> k >> s; for ( int i=0 ; i<=k ; i++){ for (int j=0 ; j<=k ; i++){ for (int l=0 ; l<=k ; l++){ if ( i+j+l==s){ ans++; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s435008624
p03835
C++
#include<iostream> using namespace std; int main() { int a,b,ans=0; cin>>a>>b; for(int i=1;i<=a-2;i++) for(int k=1;k<=a-2;k++) for(int j=1;j<=a-2;j++) if(i+k+j==s) ans++; cout<<ans; }
a.cc: In function 'int main()': a.cc:10:19: error: 's' was not declared in this scope 10 | if(i+k+j==s) ans++; | ^
s434363972
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(void){ int k,s; int ans = 0; cin >> k >> s; for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int k=0;k<=n;k++) if(i+j+k==s) ans++; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: 'n' was not declared in this scope 7 | for(int i=0;i<=n;i++) for(int j=0;j<=n;j++) for(int k=0;k<=n;k++) if(i+j+k==s) ans++; | ^
s509987343
p03835
C++
#include <math.h> #include <algorithm> #include <iostream> using namespace std; int main() { // int n; // cin >> n; // int a[n]; // sort(a, a + n); // int len = 0; // for (int i = 0; i < n; i++) cin >> a[i]; // for (int i = 0; i < n; i++) { // for (int j = i + 1; j < n; j++) { ...
a.cc: In function 'int main()': a.cc:42:9: error: expected primary-expression before '}' token 42 | } | ^
s680207726
p03835
C++
#include<iostream> using namespace std; int main(){ cin >> K >> S; int ans =0; int num = 0; for(int i=0;i<K;i++){ for(int j=0;j<K;j++){ for(int k=0;k<K;k++){ num = i + j + k; if (num == S){ ans +=1; } }...
a.cc: In function 'int main()': a.cc:5:12: error: 'K' was not declared in this scope 5 | cin >> K >> S; | ^ a.cc:5:17: error: 'S' was not declared in this scope 5 | cin >> K >> S; | ^
s604437005
p03835
C++
#include<iostream> using namepsace std; int main(){ cin >> K >> S; int ans =0; int num = 0; for(int i=0;i<K;i++){ for(int j=0;j<K;j++){ for(int k=0;k<K;k++){ num = i + j + k; if (num == S){ ans +=1; } }...
a.cc:2:7: error: expected nested-name-specifier before 'namepsace' 2 | using namepsace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> K >> S; | ^~~ | std::cin In file included from a....
s943398337
p03835
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; int main(){ int k,s; int ans = 0; cin >> k >> s >> endl; for(x=0;x<=k;x++){ for(y=0,y<=k;y++){ for(z=0;z<=k;z++){ if(x+y+z==s) ans++; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 8 | cin >> k >> s >> endl; | ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/...
s259727427
p03835
C
#include <stdio.h> int main(void){ long long K,S,i,j,k; long long count = 0; scanf("%lld %lld",&K,&S); for(i=0;i<K;i++){ for(j=0;j<K;j++){ for(k=0;k<K;k++){ if(i+j+k==S){ count++; } } } } prinyf("%d",count); return 0; }
main.c: In function 'main': main.c:19:3: error: implicit declaration of function 'prinyf'; did you mean 'printf'? [-Wimplicit-function-declaration] 19 | prinyf("%d",count); | ^~~~~~ | printf
s771566825
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, s, sum=0; cin >> k >> s; for(int x=0; x <= k; x++){ if(x > s) break; for(int y=0; y <= k; y++){ if((x+y) > s) break; if((s-x+y) <= k)) sum++; } } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:23: error: expected primary-expression before ')' token 12 | if((s-x+y) <= k)) sum++; | ^
s105185332
p03835
C++
#include <bits/stdc++.h> int main() { int S,K,sum=0; cin>>K>>S; for(int i=0; i<=K; i++) for(int j=0; j<=K; j++) { if(0 <= S-i-j && S-i-j <= K) sum++; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:4:18: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int S,K,sum=0; cin>>K>>S; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: ...
s764037125
p03835
C++
#include <bits/stdc++/h> int main() { int S,K,sum=0; cin>>K>>S; for(int i=0; i<=K; i++) for(int j=0; j<=K; j++) { if(0 <= S-i-j && S-i-j <= K) sum++; } cout<<sum<<endl; }
a.cc:1:10: fatal error: bits/stdc++/h: No such file or directory 1 | #include <bits/stdc++/h> | ^~~~~~~~~~~~~~~ compilation terminated.
s546021791
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, s, sum=0; cin >> k >> s; for(int x=0; x < s; x++){ if((x+y+z) > s) break; for(int y=0; y < s; y++){ if((x+y+z) > s) break; for(int z=0; z < s; z++){ if((x+y+z) > s) break; if((x+y+z) == z) sum++; } }...
a.cc: In function 'int main()': a.cc:9:11: error: 'y' was not declared in this scope 9 | if((x+y+z) > s) break; | ^ a.cc:9:13: error: 'z' was not declared in this scope 9 | if((x+y+z) > s) break; | ^ a.cc:11:15: error: 'z' was not declared in this scope 11 | if...
s105386437
p03835
C++
k, s = map(int, input().split()) #. ans = 0 #. for x in range(k+1): for y in range(k+1): #. des_v = s - x - y #. if des_v >= 0 and des_v <= k: ans += 1 print(ans)
a.cc:3:2: error: invalid preprocessing directive #. 3 | #. | ^ a.cc:6:2: error: invalid preprocessing directive #. 6 | #. | ^ a.cc:9:10: error: invalid preprocessing directive #. 9 | #. | ^ a.cc:12:10: error: invalid preprocessing directive #. 12 | #. | ...
s586333039
p03835
C++
#include <bits/stdc++.h> #include <algorithm> #include <utility> typedef long long int lli; using namespace std; int main(){ int w,h,n; cin >> w >> h >> n; int max_x=w; int min_x=0; int max_y=h; int min_y=0; for(LL i=0; i<n; i++){ cin >> x >> y >> a; if(a==1){ ...
a.cc: In function 'int main()': a.cc:14:9: error: 'LL' was not declared in this scope 14 | for(LL i=0; i<n; i++){ | ^~ a.cc:14:17: error: 'i' was not declared in this scope 14 | for(LL i=0; i<n; i++){ | ^ a.cc:15:16: error: 'x' was not declared in this scope 15 | ...
s541021001
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int k = scn.nextInt(); int s = scn.nextInt(); int count = 0; for(int x=0; x<=k; ++x){ for(int y=0; y<=K; ++y){ if(s>=x+y && s-(x+y)<=k){ ...
Main.java:10: error: cannot find symbol for(int y=0; y<=K; ++y){ ^ symbol: variable K location: class Main 1 error
s627545245
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int k = scn.nextInt(); int s = scn.nextInt(); int count = 0; for(int x=0; x<=k; ++x){ for(int y=0; y<=K; ++y){ if(s>=x+y && s-(x+y)<=k){ ...
Main.java:12: error: ';' expected count = count + 1 ^ 1 error
s233012985
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); int k = scn.nextInt(); int s = scn.nextInt(); int count = 0; for(int x=0; x<=k; ++x){ for(int y=0; y<=K; ++y){ if(s>=x+y && s-(x+y)<=k){ ...
Main.java:12: error: ';' expected count = count + 1 ^ 1 error
s425652046
p03835
C++
#include<bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") int main(){ int K,S; cin >> K >> S; int ans = 0; for(int i = 0;i < K+1;i++){ for(int j = 0;j < K + 1;j++){ if(S-i-j >= 0 && S-i-j <=K){ ans++; } }...
a.cc:23:3: error: 'cin' does not name a type 23 | cin >> K >> S; | ^~~ a.cc:25:3: error: expected unqualified-id before 'for' 25 | for(int i = 0;i < K+1;i++){ | ^~~ a.cc:25:17: error: 'i' does not name a type 25 | for(int i = 0;i < K+1;i++){ | ^ a.cc:25:25: error: 'i...
s499855250
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; int count = 0; for(int i=0;i<=a;i++){ for(int j=0;j<=a;j++){ if(i+j>b) break; if else(i+j+a>=b){ count++; break; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:10:8: error: expected '(' before 'else' 10 | if else(i+j+a>=b){ | ^~~~ | (
s311946066
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; int count = 0; for(int i=0;i<=a;i++){ for(int j=0;j<=a;j++){ if(i+j+a>=b){ count++; break; } } } } cout << count << endl; }
a.cc:16:3: error: 'cout' does not name a type 16 | cout << count << endl; | ^~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s356480645
p03835
C
#include <bits/stdc++.h> using namespace std; int three_dist(int x, int y ,int z) { int r=0; if(x != y) r++; if(x != z) r++; if(z != y) r++; return r; } int main() { double c=0; int k ,s; cin >> k >> s; if (k>=s) for (int i=0 ,j=s; i<s; --j ,i++) { c += 3;...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s384730464
p03835
C++
//3重ループだと2500^3=1.5625*10^10で間に合わない //2つの文字の値が決まれば残りの文字の値が1つに決まる //2500^2=6.25*10^6で間に合う #include <bits/stdc++.h> using namespace std; int main(){ int k , s; cin >> k >> s; int count =0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ if((3k-i-j)>=0&&(3k-i-j)<=k) count++; } } cout << cou...
a.cc: In function 'int main()': a.cc:15:11: error: fixed-point types not supported in C++ 15 | if((3k-i-j)>=0&&(3k-i-j)<=k) count++; | ^~ a.cc:15:24: error: fixed-point types not supported in C++ 15 | if((3k-i-j)>=0&&(3k-i-j)<=k) count++; | ^~
s753530589
p03835
C
#include<stdio.h> int main(){ int K, S, Sum = 0; scanf("%d%d",&K,&S); for(int i=0; i<=K; i++){ for(int j=0; j<=K; j++){ if(S-i-j<=K && S-i-j >= 0) Sum++; } } pritnf("%d¥n", Sum); return 0; }
main.c: In function 'main': main.c:13:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration] 13 | pritnf("%d¥n", Sum); | ^~~~~~ | printf
s787096302
p03835
C
#include<stdio.h> int main(){ int K, S, Sum = 0; scanf("%d%d",&K,&S); for(int i=0; i<=K; i++){ for(int j=0; j<=K; j++){ if(S-i-j<=K && S-i-j >= 0) Sum++; } } cout << Sum << endl; return 0; }
main.c: In function 'main': main.c:13:3: error: 'cout' undeclared (first use in this function) 13 | cout << Sum << endl; | ^~~~ main.c:13:3: note: each undeclared identifier is reported only once for each function it appears in main.c:13:18: error: 'endl' undeclared (first use in this function) 13 | c...
s960817659
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin>>K>>S; int i = 0; int j = 0; for(int x = 0;x <= K;x++){ for(int y = 0;y <= K;y++){ for(int z = 0;z <= K;z++){ j = x + y + z; if(j == S){ i++; break; } j = 0; } } cout<<i<<...
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s759116771
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,S; cin >> K >> S; int cnt =0,s=S; for(int i=0;i<=K;i++){ S=s; if(S>3*K){ break; } S -=i; if(S>2*K){ continue; } if(S>K){ cnt +=2*K-S+1; } if(S<=K){ cnt +=S+1; } cout << cnt <<en...
a.cc: In function 'int main()': a.cc:25:4: error: expected '}' at end of input 25 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s198569669
p03835
C++
#include<iostream> using namespace std; int main(){ int K, S, count = 0; cin >> K >> S; for(int X = 0; X <= K; X++){ for(int Y = 0; Y <= K ; Y++){ Z = S - X - Y; if(Z <= K) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:13: error: 'Z' was not declared in this scope 8 | Z = S - X - Y; | ^
s695720561
p03835
C++
#include <iostream> using namespace std; int main() { int k, s; cin >> k >> s; int count = 0; for (int x = 0; x <= k; x++) for (int y = 0; y <= k; y++) { int z = s - x - y; if (z >= 0 && z <= k) { count++; } } cout << count << endl; return 0;
a.cc: In function 'int main()': a.cc:17:12: error: expected '}' at end of input 17 | return 0; | ^ a.cc:5:17: note: to match this '{' 5 | int main() { | ^
s184599293
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k,s; cin >> k>>s; int count=0; for(int x=0; x<k+1; x++){ for(int y=0; y<k+1; y++){ if (s-x-y>=0 && S-x-y<=K) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:13:23: error: 'S' was not declared in this scope 13 | if (s-x-y>=0 && S-x-y<=K) count++; | ^ a.cc:13:30: error: 'K' was not declared in this scope 13 | if (s-x-y>=0 && S-x-y<=K) count++; | ^
s748259945
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k,s; cin >> k>>s; int count=0; for(int x=0; x<k+1; x++){ for(int y=0; y<k+1; y++){ if (s-sum>=0 && S-sum<=K) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:13:13: error: 'sum' was not declared in this scope 13 | if (s-sum>=0 && S-sum<=K) count++; | ^~~ a.cc:13:23: error: 'S' was not declared in this scope 13 | if (s-sum>=0 && S-sum<=K) count++; | ^ a.cc:13:30: error: 'K' w...
s557756608
p03835
C++
int main() { int K, S; cin >> K; cin >> S; int cont = 0; for (int i=0;i<=K;i++){ for (int j = 0; j<=K; j++) { int z = S - i - j; if (z>= 0 && z <= K) { ++cont; } } } cout << cont << endl; return 0; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> K; | ^~~ a.cc:18:9: error: 'cout' was not declared in this scope; did you mean 'cont'? 18 | cout << cont << endl; | ^~~~ | cont a.cc:18:25: error: 'endl' was ...
s769443074
p03835
C++
#include<bits/stdc++.h> #define PI acos(-1.0) #define eps 1e-67 #define pf printf #define sf scanf #define sd(n) scanf("%d",&n) #define sd2(n1,n2) scanf("%d %d",&n1,&n2) #define slf(n) scanf("%lf",&n) #define slf2(n1,n2) scanf("%lf %lf",&n1,&n2) #define sLf(n1) scanf("%Lf",&n1) #define sLf2(n1,n2) scanf("%Lf %Lf",&n1,&...
a.cc: In function 'int main()': a.cc:65:14: error: 'o' was not declared in this scope 65 | rep(j,o,k) | ^ a.cc:14:40: note: in definition of macro 'rep' 14 | #define rep(i,a,b) for(long long int i=a;i<b;i++) | ^
s793082333
p03835
C++
#include<iostream> using namespace std; int main() { long long int n,m,count=0; cin>>n>>m; int i,j,k; for(i=0;i<=n;i++) { for(j=0;j<n;j++) { for(k=0;k<n;k++) { if(i+j+k==m) count++; } } } cin>>count>>endl; }
a.cc: In function 'int main()': a.cc:19:13: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 19 | cin>>count>>endl; | ~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostre...
s071896056
p03835
C++
#include <bits/stdc++.h> using namespace std; void solve(long long K, long long S) { long long cnt = 0; vector<long long> S_Z(K, 0); for (long long i = 0; i <= K; i++) { for (long long j = i; j <= K; j++) { for (long long k = j; k <= K; k++) { if...
a.cc: In function 'void solve(long long int, long long int)': a.cc:22:33: error: expected ';' before 'break' 22 | cnt += 6 | ^ | ; 23 | 24 | break; | ...
s595390435
p03835
C++
#include <bits\stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int k,s; cin >> k >> s; int ans{}; for(int i{}; i<=k; ++i){ for(int j{}; j<=k; ++j){ int z = s-i-j; if(0<=z && z<=k){ ans+=1; } } } cout << ans << "\n"; return 0; }
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s692403060
p03835
C++
//三重ループはTLEでした。 #include <bits/stdc++.h> using namespace std; int main() { int k,s; cin >>k>>s; int count=0; for(int i=0;i <=k;i++){ for(int j=0;j <=k;j++){ int m=s-i-j; if(i+j+m==s && i <=k &&i >=0){ count++;} } } } cout <<count <<endl; }
a.cc:18:3: error: 'cout' does not name a type 18 | cout <<count <<endl; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s099207217
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,s; cin >> k >> s; int count=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ if(0<=s-i-j<=k)count++; } } } cout << count << endl; }
a.cc:13:3: error: 'cout' does not name a type 13 | cout << count << endl; | ^~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s398634592
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> k >> s; int count=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ for(int h=0;h<=k;h++){ if(s==i+j+h){ count++; } } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: 'k' was not declared in this scope 5 | cin >> k >> s; | ^ a.cc:5:15: error: 's' was not declared in this scope 5 | cin >> k >> s; | ^
s176704952
p03835
C++
#include<bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<n;i++) int main(){ ll K,S; cin>>K>>S; int cnt=0; rep(x,K+1){ rep(y,K+1){ ll z=S-x-y; // cout<<x<<" "<<y<<" "<<z<<"\n"; if(z>=0 && z<=K) cnt++; } } co...
a.cc:13:19: error: extended character   is not valid in an identifier 13 | if(z>=0 && z<=K) cnt++; | ^ a.cc: In function 'int main()': a.cc:13:19: error: unable to find numeric literal operator 'operator""\U00003000' 13 | if(z>=0 && z<=K) cnt++; | ...
s503359343
p03835
C++
#include<bits/stdc++.h> using namespace std; using ll=long long; #define rep(i,n) for(int i=0;i<n;i++) int main(){ ll K,S; cin>>K>>S; int cnt=0; rep(x,K+1){ rep(y,K+1){ ll z=S-x-y; // cout<<x<<" "<<y<<" "<<z<<"\n"; if(z>=0 && z<=K) cnt++; } } co...
a.cc:13:19: error: extended character   is not valid in an identifier 13 | if(z>=0 && z<=K) cnt++; | ^ a.cc: In function 'int main()': a.cc:13:19: error: unable to find numeric literal operator 'operator""\U00003000' 13 | if(z>=0 && z<=K) cnt++; | ...
s234431531
p03835
C++
#include <iostream> using namespace std; int main() { ll K, S; cin >> K >> S; ll sum = 0; for (ll i = 0; i <= K; i++) { for (ll j = 0; j <= K; j++) { for (ll k = 0; k <= K; k++) { if (S - i - j <=K) { sum += 1; } }...
a.cc: In function 'int main()': a.cc:5:5: error: 'll' was not declared in this scope 5 | ll K, S; | ^~ a.cc:6:12: error: 'K' was not declared in this scope 6 | cin >> K >> S; | ^ a.cc:6:17: error: 'S' was not declared in this scope 6 | cin >> K >> S; | ...
s308371094
p03835
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++); using namespace std; using ll = long long; using P = pair<int, int>; int main() { int k, s; cin >> k >> s; int cnt = 0; for (int x = 0; x <= k; ++x) { for (int y = 0; y <= k; ++y) { int z = s - (x + y); ...
a.cc: In function 'int main()': a.cc:18:25: error: expected '}' at end of input 18 | cout << cnt << endl; | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s735214588
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,s; cin>>k>>s; int ans=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ if((i+j+(s-i-j))==s){ ans++; } } } } cout<<ans<<endl; }
a.cc:16:3: error: 'cout' does not name a type 16 | cout<<ans<<endl; | ^~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s994533254
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int count=0; for (int i=0; i<=K; i++){ for (int j=0; j<=K; j++){ if (S-i-j<=K && i+j<=2K) count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:10:38: error: fixed-point types not supported in C++ 10 | if (S-i-j<=K && i+j<=2K) count++; | ^~ a.cc: At global scope: a.cc:14:5: error: 'cout' does not name a type 14 | cout << count << endl; | ^~~~ a.c...
s003547746
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin>>K>>S; int64_t l=0; for(int i=0;i<=K && i<=S;i++) for(int j=i;K-(i+j)>=j && S-(i+j)>=j;j++){ k=K-(i+j); if(i==j && j==k) l++; else if(i==j||j==k||k==i) l+=3; else l+=6; } cout<<l<<en...
a.cc: In function 'int main()': a.cc:10:7: error: 'k' was not declared in this scope 10 | k=K-(i+j); | ^
s024606736
p03835
Java
import java.util.Scanner; public class main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int k=sc.nextInt(); int s=sc.nextInt(); int ans=0; for(int x=0;x<k+1;x++){ for(int y=0;x<k+1;x++){ for(int z=0;x<k+1;x++){ if(x+y+z==s){ ans++; ...
Main.java:2: error: class main is public, should be declared in a file named main.java public class main{ ^ 1 error
s692770930
p03835
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <iterator> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <set> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(obj) (obj).begin()...
a.cc: In function 'int main()': a.cc:34:14: error: expected ';' before '}' token 34 | ++ans | ^ | ; 35 | } | ~
s900171011
p03835
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <iterator> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <set> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(obj) (obj).begin()...
a.cc: In function 'int main()': a.cc:25:10: error: 'K' was not declared in this scope 25 | cin >> K >> S; | ^ a.cc:25:15: error: 'S' was not declared in this scope 25 | cin >> K >> S; | ^ a.cc:33:14: error: expected ';' before '}' token 33 | ++ans | ...
s118275235
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k, s; cin >> k >> s; int count = 0; for(int i = 0; i<=k, i++){ for(int j = 0; j<=k, j++){ if(s-(i+j) <= k) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:9:27: error: expected ';' before ')' token 9 | for(int i = 0; i<=k, i++){ | ^ | ; a.cc:10:29: error: expected ';' before ')' token 10 | for(int j = 0; j<=k, j++){ | ^ ...
s710053793
p03835
C++
#include <bits/stdc++.h> #include <vector> using namespace std; int main(){ int k,s; cin>>k>>s; int cnt=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ int len = sum-i-j; if(i+j+len == sum && len > 0) cnt++; } } cout<<cnt<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:19: error: 'sum' was not declared in this scope 14 | int len = sum-i-j; | ^~~
s676560649
p03835
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,srt,end) for(ll i=(ll)(srt); i<(ll)(end); i++) int main(){ ll K,S; cin>>K>>S; ll z; ll ans=0; rep(x,0,K+1){ rep(y,0,K+1)){ z = S-x-y; if(0<=z&&z<=K)ans++; } } cout<<ans<...
a.cc: In function 'int main()': a.cc:12:21: error: expected primary-expression before ')' token 12 | rep(y,0,K+1)){ | ^
s622797341
p03835
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++) int main(){ ll K,S; cin>>K>>S; ll z; ll ans=0; rep(x,0,K+1){ rep(y,0,K+1)){ z = S-x-y; if(0<=z&&z<=K)ans++; } } cout<<ans<<endl...
a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before 'K' 11 | rep(x,0,K+1){ | ^ a.cc:4:46: note: in definition of macro 'rep' 4 | #define rep(i,srt,end) for(ll i=(srt); i<(ll end); i++) | ^~~ a.cc:11:13: err...
s535466088
p03835
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++) int main(){ ll K,S; cin>>K>>S; ll z; ll ans=0; rep(x,0,K+1){ rep(y,0,K+1)){ z = S-x-y; if(0<=z&&z<=K)ans++; } } cout<<ans<<e...
a.cc: In function 'int main()': a.cc:11:11: error: expected primary-expression before numeric constant 11 | rep(x,0,K+1){ | ^ a.cc:4:37: note: in definition of macro 'rep' 4 | #define rep(i,srt,end) for(ll i=(ll srt); i<(ll end); i++) | ^~~ a.cc:11:11...
s903725324
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, s, total; cin >> n >> s; int count = 0; for(int i = 0; i<=n; i++){ for(int j = 0; j<=n; j++){ total = s-i-j; if(0 <= total && toatal <= n) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:12:24: error: 'toatal' was not declared in this scope; did you mean 'total'? 12 | if(0 <= total && toatal <= n) | ^~~~~~ | total
s674602483
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, s, total; cin >> n >> s; int count = 0; for(int i = 0; i<=n; i++){ for(int j = 0; j<=n; j++){ total = s-i+j; if(0 <= total && toatal <= n) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:12:24: error: 'toatal' was not declared in this scope; did you mean 'total'? 12 | if(0 <= total && toatal <= n) | ^~~~~~ | total
s506514397
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, s, total; cin >> n >> s; int count = 0; for(int i = 0; i<=n; i++){ for(int j = 0; j<=n; j++){ total = i+j; if(0 <= && s-total <=n) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:12:19: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 12 | if(0 <= && s-total <=n) | ~~~~^~~~~~ a.cc:12:12: error: ordered comparison of pointer with integer zero ('int' and 'void*') 12 | if(0 <= && s-total <=n) | ...
s568379005
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, s, total; cin >> n >> s; int count = 0; for(int i = 0; i<=n; i++){ for(int j = 0; j<=n; j++){ total = i+j; if(total == s-k) count++; if(j>s) break; } if(i>s) break; } cout << count << endl...
a.cc: In function 'int main()': a.cc:12:21: error: 'k' was not declared in this scope 12 | if(total == s-k) | ^
s331800155
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, s, total; cin >> n >> s; int count = 0; for(int i = 0; i<=n; i++){ for(int j = 0; j<=n; j++){ total = i+j; if(total == s-k) count++; } if(j>s) break; } if(i>s) break; } cout << count << en...
a.cc: In function 'int main()': a.cc:12:21: error: 'k' was not declared in this scope 12 | if(total == s-k) | ^ a.cc:15:8: error: 'j' was not declared in this scope 15 | if(j>s) | ^ a.cc:18:8: error: 'i' was not declared in this scope 18 | if(i>s) | ...
s892208007
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int i,j; int K,S; int count=0; cin>>K>>S; for(i=0;i<=K&&i<=S;i++){ for(j=0;i+j<=S&&j<=K;j++){ int x=S-i-j; if(x<=K)count++; } } cout<<count;
a.cc: In function 'int main()': a.cc:15:13: error: expected '}' at end of input 15 | cout<<count; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s673519908
p03835
C++
using namespace std; int main(){ int i,j; int K,S; int count=0; cin>>K>>S; for(i=0;i<=K&&i<=S;i++){ for(j=0;i+j<=S&&j<=K;j++){ int x=S-i-j; if(x<=K)count++; } } cout<<count; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin>>K>>S; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:14:1: error: '...
s080967046
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k, s; cin >> k >> s; int res = 0; for (int i = 0; i <= k; i++) { for (int j = 0; j <= k; j++) { if (s - x - y >= 0 && s - x - y <= k) { res++; } } } cout << res << endl; }
a.cc: In function 'int main()': a.cc:10:15: error: 'x' was not declared in this scope 10 | if (s - x - y >= 0 && s - x - y <= k) { | ^ a.cc:10:19: error: 'y' was not declared in this scope 10 | if (s - x - y >= 0 && s - x - y <= k) { | ^
s122891416
p03835
C
#include <iostream> using namespace std; int main(void) { int k, s; cin >> k >> s; int ans = 0; for (int i = 0; i <= k; i++) { for (int j = 0; j < k; j++) { if (s - i - j <= k) { ans++; cout << i << " " << j; } } } cout << ans << endl; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s573794481
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k,s; cin >> k >> s; int ans=0; for(int x=0;x<=k; x++){ for(int y=0;y<=k; y++){ int z=s-x-y; if(0 <= z && z <= K){ ans++; } } } cout << ans; }
a.cc: In function 'int main()': a.cc:10:25: error: 'K' was not declared in this scope 10 | if(0 <= z && z <= K){ | ^
s376459287
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k,s; cin >> k >> s; int ans=0; for(int x=0;x<=k; x++;){ for(int y=0;y<=k; y++;){ for(int z=0;z<=k; z++;){ if(s==x+y+z){ ans++; } } } } cout << ans; }
a.cc: In function 'int main()': a.cc:7:24: error: expected ')' before ';' token 7 | for(int x=0;x<=k; x++;){ | ~ ^ | ) a.cc:7:25: error: expected primary-expression before ')' token 7 | for(int x=0;x<=k; x++;){ | ^
s402827379
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S, X, Y, Z, Sum = 0; cin >> K >> S; for (int i = 0; i <= K; i++) { for (int a = 0; a <= K; a++) { X = i; Y = a; Z = S - X - Y; if (Z <= K && 0 <= Z) { ...
a.cc: In function 'int main()': a.cc:25:17: error: expected '}' at end of input 25 | cout << Sum; | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s343181802
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int num, Max; int count; cin >> num >> Max; for (int i = 0; i <= num; i++) { for (int j = 0; J <= num; j++) { for (int k = 0; k <= num; k++) { if (i + j + k == Max) { count++; } } } } return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: 'J' was not declared in this scope 9 | for (int j = 0; J <= num; j++) { | ^
s025162294
p03835
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i=0; i<(n); ++i) #define rrep(i,n) for(int i=1; i<=(n); ++i) #define drep(i,n) for(int i=(n)-1; i>=0; --i) #define srep(i,s,t) for (int i=s; i<t; ++i) #define pb push_back using namespace std; using P = pair<int,int>; typedef long long ll; typedef vector<int> vi; typed...
a.cc: In function 'int main()': a.cc:24:14: error: 'z' was not declared in this scope 24 | if(x+y+z==S){ | ^
s385895582
p03835
C++
#include <iostream> using namespace std; int main() { int k,s; cin>>k>>s; int ans = 0; for(int x = 0; x <= K; ++x){ for(int y = 0; y <= K; ++y){ int z = S - x - y; if(0 <= z and z <= K){ ans = ans + 1; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:29: error: 'K' was not declared in this scope 8 | for(int x = 0; x <= K; ++x){ | ^ a.cc:10:33: error: 'S' was not declared in this scope 10 | int z = S - x - y; | ^
s165927341
p03835
C++
int main() { int sum = 0; int num, ans; cin >> num >> ans; for (int i = 0; i < num + 1; i++) { for (int j = 0; j < num + 1; j++) { for (int k = 0; k < num + 1; k++) { if (i + j + k == ans) sum++; } } } cout << sum; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> num >> ans; | ^~~ a.cc:17:3: error: 'cout' was not declared in this scope 17 | cout << sum; | ^~~~
s484449820
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s,count,time,z; cin>>k>>s; count=0; for(int x=0;x<=k;x++){ for(int y=x;y<=k;y++){ z=s-x-y; if(!(y<=z and z<=k ))break; if(x==y and x==z and y==z )count+=1; else if(x==y or x==z or y==z )count+=3; else count+=6...
a.cc:20:3: error: 'cout' does not name a type 20 | cout<<count<<endl; | ^~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s229679612
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s,count,time; cin>>k>>s; count=0; for(int x=0;x<=k;x++){ time=x if(time>s){ break; } for(int y=0;y<=k;y++){ time+=y; if(time>s){ break; } for(int z=0;z<=k;z++){ if(time+z==s){ ...
a.cc: In function 'int main()': a.cc:9:11: error: expected ';' before 'if' 9 | time=x | ^ | ; 10 | if(time>s){ | ~~
s924957260
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K.S;cin>>K>>S; long long count=0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ if(S-(i+j)<=K&&S-(i+j)>=0){ count++; } } } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:4:8: error: expected initializer before '.' token 4 | int K.S;cin>>K>>S; | ^ a.cc:4:16: error: 'K' was not declared in this scope 4 | int K.S;cin>>K>>S; | ^ a.cc:4:19: error: 'S' was not declared in this scope 4 | int K.S;cin>>K>>S...
s133294226
p03835
C++
#include <iostream> using namespace std; int main() { int K, S, cnt = 0, z_init = 0; scanf_s("%d %d", &K, &S); if (S > 2 * K) z_init = S - 2 * K; for (int z = z_init; z <= K; ++z) { if (S - z < 0) break; if (S - z > K) cnt += (2 * K - S + z + 1); else cnt += (S - z + 1); } printf("%d\n", cnt); retur...
a.cc: In function 'int main()': a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 8 | scanf_s("%d %d", &K, &S); | ^~~~~~~ | scanf
s826254579
p03835
C++
//#define _USE_MATH_DEFINES #include <iostream> //#include <vector> #include <algorithm> //#include <numeric> //#include <string> //#include <array> //#include <set> //#include <sstream> //#include <cstdio> //#include <cmath> using namespace std; int main() { int K, S, cnt = 0, z_init = 0; scanf_s("%d %d", &K, &S...
a.cc: In function 'int main()': a.cc:19:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 19 | scanf_s("%d %d", &K, &S); | ^~~~~~~ | scanf
s839868786
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k, s; cin >> k >> s; int count = 0; for (int x = 0; i <= k; i++) { for (int y = 0; j <= k; j++) { int z = s - x - y; if (0 <= z && z <= k) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:9:19: error: 'i' was not declared in this scope 9 | for (int x = 0; i <= k; i++) { | ^ a.cc:10:21: error: 'j' was not declared in this scope 10 | for (int y = 0; j <= k; j++) { | ^
s929113145
p03835
C++
using namespace std; #define ALL(obj) obj.begin(),obj.end() #define pb(obj) push_back(obj) #define REP(i,N) for(int i=0;i<N;i++) typedef long long ll; ll const MOD=1e9+7; using ll = long long; int main(){ int k,s; cin>>k>>s; int count=0; REP(a,k+1){ REP(b,k+1){ if(0<=s-a-b&&s-a-b<=k){ count+...
a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin>>k>>s; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:21:3: error: 'cout' was not declared ...
s818960643
p03835
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);++i) using namespace std; int main() { int k,s; cin >> k >> s; int ans=0; rep(i,k+1) { rep(int j=i,k+1) { rep(int l=i,k+1) { if(i+j+l==s) ans++; }}} cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:2:22: error: two or more data types in declaration of 'j' 2 | #define rep(i,n) for(int i=0;i<(n);++i) | ^~~ a.cc:9:5: note: in expansion of macro 'rep' 9 | rep(int j=i,k+1) { | ^~~ a.cc:9:9: error: expected primary-expression before '...
s016197403
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S, n=0; cin >> K >> S; for (int X=0; X<=K; X++) { for (int Y=0; Y<=K; Y++) { Z=S-X-Y; if (Z>=0&&Z<=K) n++; } } cout << n << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'Z' was not declared in this scope 8 | Z=S-X-Y; | ^
s144463871
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S, n=0; cin >> K >> S; for (int X=0; X<=K; X++) { for (int Y=0; Y<=K; Y++) { for (int Z=0; Z<=K; Z;;) { if (X+Y+Z==S) n++; } } } cout << n << endl; }
a.cc: In function 'int main()': a.cc:8:28: error: expected ')' before ';' token 8 | for (int Z=0; Z<=K; Z;;) { | ~ ^ | ) a.cc:8:30: error: expected primary-expression before ')' token 8 | for (int Z=0; Z<=K; Z;;) { | ...
s816817235
p03835
C++
#include <iostream> #include <string> using namespace std; int main() { int K, S, count; cin >> K >> S ; for(int i = 0; i <= K; i++){ for(int j = 0; j <= K; j++){ int z = S - i - j; if(z => 0 && z <= K){ count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:11:15: error: expected primary-expression before '>' token 11 | if(z => 0 && z <= K){ | ^
s534504944
p03835
C++
ll func(ll K,ll S) { ll count = 0; for (int x = 0; x < K, ++x) { for (int y = 0; y < K; ++y) { for (int z=0;z<K;z++) { if (x + y + z == S) { ++count; } } } } return count; } int main() { ll K,S; std::cin >> K >> S; std::cout<<func(K,S); return 0; }
a.cc:1:1: error: 'll' does not name a type 1 | ll func(ll K,ll S) | ^~ a.cc: In function 'int main()': a.cc:24:9: error: 'll' was not declared in this scope 24 | ll K,S; | ^~ a.cc:25:14: error: 'cin' is not a member of 'std' 25 | std::cin >> K >> S; | ^~~...
s719250932
p03835
C++
#include <iostream> #include <cmath> #include <vector> #include <map> #include <iomanip> #include <algorithm> #include <sstream> #include <string> #include <math.h> #include <set> using namespace std; int main() { ios::sync_with_stdio(false); int k,s; cin >> k >> s; int a=0; for (int i=0;i<=k;i++) { for (int j...
a.cc: In function 'int main()': a.cc:21:43: error: 'aA' was not declared in this scope; did you mean 'a'? 21 | if (0<=b && b<=k) aA++; | ^~ | a
s803679878
p03835
C++
clude <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i, n) for(int i = 0; i < n; i++) #define sort(v) sort((v).begin(), (v).end()) using vi = vector<int>; const int MOD = 1e9+7; int main() { int K,S; cin >> K >> S; int sum = 0; rep(x,K+1){ rep(y,K+1){ if(x+y >= S...
a.cc:1:1: error: 'clude' does not name a type 1 | clude <bits/stdc++.h> | ^~~~~ a.cc:7:12: error: 'vector' does not name a type 7 | using vi = vector<int>; | ^~~~~~ a.cc: In function 'int main()': a.cc:13:9: error: 'cin' was not declared in this scope 13 | cin >> K >> S; ...
s614915617
p03835
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i, n) for(int i = 0; i < n; i++) #define sort(v) sort((v).begin(), (v).end()) using vi = vector<int>; const int MOD = 1e9+7; int main() { int K,S; int sum = 0; rep(x,K){ rep(y,K){ if(x+y >= S-K &&x+y =< S) sum = ...
a.cc: In function 'int main()': a.cc:16:38: error: expected primary-expression before '<' token 16 | if(x+y >= S-K &&x+y =< S) sum = sum+1; | ^