submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s676369218
p03835
C++
#include <bits/stdc++.h> using namespace std; main(){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; ++x){ for(int y = 0; y <= K; ++y){ int z = S - x - y; if(0 <= z and z <= K){ ans = ans + 1; } }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:17:6: error: expected '}' at end of input 17 | } | ^ a.cc:8:30: note: to match this '{' 8 | for(int x = 0; x <= K; ++x){ | ^ a.cc:17:6: error: expected '}' at end of input 17 | } | ^ a.cc:4:7: note: to match this '{' 4 | main(){ | ^
s115736511
p03835
C++
#include <iostream> using namespace std; int K, S; int main() { cin >> K >> S; int ans = 0; for (int x = 0; x <= K; x++) { for (int y = 0; y <= S; y++) { int z = S-x-y; if (0 <= z && z <= K) ans++ } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:40: error: expected ';' before '}' token 13 | if (0 <= z && z <= K) ans++ | ^ | ; 14 | } | ~
s351221963
p03835
C++
#include<bits/stdc++.h> using namespace std; int min(){ int K,S; cin >> K >> S; int sum=0; for(int i=0;i<K;i++){ for(int j=0;j<K;j++){ if(S-(i+j) >= 0 && S-(i+j) <= K) sum++; } } cout << sum << endl; }
a.cc: In function 'int min()': a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s700878126
p03835
C++
#include<bits/stdc++.h> using namespace std; int min(){ int K,S; cin >> K >> S; int sum=0; for(int i=0;i<K;i++){ for(int j=0;j<K;j++){ for(int l=0;l<K;l++){ if(i+j+l == S)sum++; } } } cout << sum << endl; }
a.cc: In function 'int min()': a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s350794470
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K,S; cin >> K >> S; int ans=0; for(int i=0;i<=K;i++){ for(int i=0;j<=K;j++){ if(i+j>=K*2 && i+j<=S){ ans++; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:17: error: 'j' was not declared in this scope 11 | for(int i=0;j<=K;j++){ | ^
s248301602
p03835
C++
#include<bits/stdc++.h> constexpr long long INFL = 1LL << 60; constexpr int INF = 1 << 30; using namespace std; using ll = long long; using P = tuple<int, int>; using iarr = valarray<int>; int main() { int K,S; cin >> K >> S; ll cnt = 0; for(int i = 0; i <= K; ++i){ for(int j = 0; j <= K; ++j){ if(i+j > S) break; if(i+j+K >= S) cnt++; } } cout << cnt << endl; return 0;
a.cc: In function 'int main()': a.cc:23:14: error: expected '}' at end of input 23 | return 0; | ^ a.cc:12:1: note: to match this '{' 12 | { | ^
s303713297
p03835
C++
#include<iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int X,Y,Z,ans=0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ X=i; Y=j; Z=S-X-Y; if(0<=Z&&Z<=K){ ans++; } } } cout<<ans<<endl; return 0; }#include<iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int X,Y,Z,ans=0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ X=i; Y=j; Z=S-X-Y; if(0<=Z&&Z<=K){ ans++; } } } cout<<ans<<endl; return 0; }
a.cc:21:2: error: stray '#' in program 21 | }#include<iostream> | ^ a.cc:21:3: error: 'include' does not name a type 21 | }#include<iostream> | ^~~~~~~ a.cc:24:5: error: redefinition of 'int main()' 24 | int main(){ | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main(){ | ^~~~
s716487665
p03835
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int,int> #define vpii vector<pii> #define vll vector<ll> #define vi vector<int> #define pb push_back #define f first #define s second ll ncr(ll n,ll m){ if(m>n-m) m = n-m; ll ans =1; for(ll i=0;i<m;++i) ans = ans*(n-i)/(i+1); return ans; } int main() { int k,s; cin>>k>>s; int ct=0; for(int i=0;i<=k;++i) for(int j=0;j<=k;++k){ z = s-i-j; if(z>=0&&z<=k) ct++; } cout<<ct; return 0; }
a.cc: In function 'int main()': a.cc:34:7: error: 'z' was not declared in this scope 34 | z = s-i-j; | ^
s521508159
p03835
Java
#include <iostream> #include <vector> #include <deque> #include <cmath> #include <map> #include <set> #include <unordered_set> #include <algorithm> #include "iomanip" using namespace std; int main() { int k, s, count = 0; cin >> k >> s; for (int i = 0; i <= min(k, s); i++) { for (int j = 0; j <= min(s - j, k); j++) { for (int l = 0; l <= min(s - j - i, k); l++) { if (i + j + l == s) { count++; } } } } cout << count; return 0; }
Main.java:1: error: illegal character: '#' #include <iostream> ^ Main.java:2: error: illegal character: '#' #include <vector> ^ Main.java:3: error: illegal character: '#' #include <deque> ^ Main.java:4: error: illegal character: '#' #include <cmath> ^ Main.java:5: error: illegal character: '#' #include <map> ^ Main.java:6: error: illegal character: '#' #include <set> ^ Main.java:7: error: illegal character: '#' #include <unordered_set> ^ Main.java:8: error: illegal character: '#' #include <algorithm> ^ Main.java:9: error: illegal character: '#' #include "iomanip" ^ Main.java:15: error: not a statement cin >> k >> s; ^ Main.java:25: error: not a statement cout << count; ^ Main.java:13: error: unnamed classes are a preview feature and are disabled by default. int main() { ^ (use --enable-preview to enable unnamed classes) 12 errors
s083352011
p03835
C++
#include <iostream> #include <vector> #include <string> #include <cstdlib> #include <algorithm> #include <cstdio> #include <cstring> #include <stack> #include <math.h> #include <string.h> #include <map> #define Z class #define ln cout<<'\n' #define ll long long #define rep(i, n) for(int i = 0; i < (n); ++i) //ASCII a=97, A=65 // int H[N]; rep(i,N) scanf("%d", &H[i]); // int max_x = *std::max_element(x.begin(), x.end()); // int min_y = *std::min_element(y.begin(), y.end()); // sort(vec.begin(), vec.end()); std::greater<>() // reverse(vec.begin(), vec.end()); // scanf("%s",s); // printf("%d\n",end-start+1); using namespace std; 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;} template<Z A>void pr(A a){cout<<a;ln;} template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);} template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);} template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);} template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;} int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } const long long INF = 1LL << 60; 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){ int z = s - i - j; if(0 <= z && z <= k) res++; } } pr(res); }
a.cc: In function 'int main()': a.cc:37:27: error: expected ';' before 'int' 37 | int k,s; cin >> k >> s | ^ | ; 38 | int res=0; | ~~~ a.cc:43:34: error: 'res' was not declared in this scope; did you mean 'rep'? 43 | if(0 <= z && z <= k) res++; | ^~~ | rep a.cc:47:8: error: 'res' was not declared in this scope; did you mean 'rep'? 47 | pr(res); | ^~~ | rep
s260393363
p03835
C++
#include <iostream> #include <vector> #include <string> #include <cstdlib> #include <algorithm> #include <cstdio> #include <cstring> #include <stack> #include <math.h> #include <string.h> #include <map> #define Z class #define ln cout<<'\n' #define ll long long #define rep(i, n) for(int i = 0; i < (n); ++i) //ASCII a=97, A=65 // int H[N]; rep(i,N) scanf("%d", &H[i]); // int max_x = *std::max_element(x.begin(), x.end()); // int min_y = *std::min_element(y.begin(), y.end()); // sort(vec.begin(), vec.end()); std::greater<>() // reverse(vec.begin(), vec.end()); // scanf("%s",s); // printf("%d\n",end-start+1); using namespace std; 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;} template<Z A>void pr(A a){cout<<a;ln;} template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);} template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);} template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);} template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;} int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } const long long INF = 1LL << 60; int main(){ int k,s; cin >> k >> s; if(s==3*k) pr(1); else p(s*3); }
a.cc: In function 'int main()': a.cc:39:10: error: 'p' was not declared in this scope 39 | else p(s*3); | ^
s216373836
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int z; int result = 0; for(int x = 0; x < K; x++) { for(int y = 0; y < K; y++) { z = S - x - y if(z >= 0 && z <= K) { result++; } } } return 0; }
a.cc: In function 'int main()': a.cc:12:20: error: expected ';' before 'if' 12 | z = S - x - y | ^ | ; 13 | if(z >= 0 && z <= K) { | ~~
s309092918
p03835
C++
K, S = map(int, input().split()) cnt = 0 if K >= S: cnt+=3 def cnt2(k, s): if 2 * k >= s: if s - 1 <= k: return s-1 else: return k-(s-k)+1 else: return 0 cnt+=3*cnt2(K, S) for x in range(1, K+1): if S-x <=0: break cnt += cnt2(K, S-x) print(cnt)
a.cc:1:1: error: 'K' does not name a type 1 | K, S = map(int, input().split()) | ^
s764674072
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K, S; cin >> K >> S; int count = 0; for(int x=0; x<=K; x++){ int y_max = min(K, S-x); for(int y=0; y<=y_max; y++){ z = S - x - y; if(z<K) count++; } } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:7: error: 'z' was not declared in this scope 12 | z = S - x - y; | ^
s928344503
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S,sum=0; cin>>K>>S; for(int i=0;i<K+1;i++){ for(int j=0;j<K+1;j++){ int z=S-i-j; if(0<z && z<K+1){ sum++; } } } } cout<<sum<<endl; }
a.cc:15:1: error: 'cout' does not name a type 15 | cout<<sum<<endl; | ^~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s411593853
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S,sum=0; cin>>K>>S; for(int i=0;i<K+1;i++){ for(int j=0;j<K+1;j++){ int z=S-i-j if(0<z&&z<K+1){ sum++; } } } } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:9:17: error: expected ',' or ';' before 'if' 9 | if(0<z&&z<K+1){ | ^~ a.cc: At global scope: a.cc:15:1: error: 'cout' does not name a type 15 | cout<<sum<<endl; | ^~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s838203622
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S,sum=0; cin>>K>>S; for(int i=0;i<K+1;i++){ for(int j=0;j<K+1;j++){ int Z=S-i-j if(0<z&&z<K+1){ sum++; } } } } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:9:17: error: expected ',' or ';' before 'if' 9 | if(0<z&&z<K+1){ | ^~ a.cc: At global scope: a.cc:15:1: error: 'cout' does not name a type 15 | cout<<sum<<endl; | ^~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s515828151
p03835
C++
int main(void){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; ++x){ for(int y = 0; y <= K; ++y){ int z = S - x - y; if(0 <= z and z <= K){ ans = ans + 1; } } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> K >> S; | ^~~ a.cc:17:2: error: 'cout' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:17:17: error: 'endl' was not declared in this scope 17 | cout << ans << endl; | ^~~~
s984081536
p03835
C++
#include<iostream> #include<stdio.h> #include<vector> #include<string> #include <algorithm> #include<math.h> using namespace std; int main(){ int k,s; int ans=0; cin >> k >> s; for(int x = 0;x<=k;x++){ for(int y=0;y<=k;y++){ for(int z=0;z<=k;z++){ if(i+j+l == s)ans++; } } } printf("%d",ans); return 0; }
a.cc: In function 'int main()': a.cc:17:20: error: 'i' was not declared in this scope 17 | if(i+j+l == s)ans++; | ^ a.cc:17:22: error: 'j' was not declared in this scope 17 | if(i+j+l == s)ans++; | ^ a.cc:17:24: error: 'l' was not declared in this scope 17 | if(i+j+l == s)ans++; | ^
s604513841
p03835
C++
int main(){ int K, S; int counter = 0; cin >> K >> S; for (int i = 0; i <= K; i++){ for (int j = 0; j <= K; j++){ if((0 <= S - (i + j)) && (S - (i + j) <= K)){ //cout << 1 << endl; //cout << i << j << endl; counter++; } } } cout << counter << endl; } // 00 01 10 11 20 02
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> K >> S; | ^~~ a.cc:14:5: error: 'cout' was not declared in this scope 14 | cout << counter << endl; | ^~~~ a.cc:14:24: error: 'endl' was not declared in this scope 14 | cout << counter << endl; | ^~~~
s472391450
p03835
C++
#include <iostream> #include <bits/stdc++.h> int main(){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; x++){ for(int y = 0; y <= K; y++){ int z = S - x - y; if(0 <= z && z <= K){ ans = ans + 1; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> K >> S; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout << ans << 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:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 16 | cout << ans << 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) | ^~~~
s239673921
p03835
C++
int main(void){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; ++x){ for(int y = 0; y <= K; ++y){ int z = S - x - y; if(0 <= z and z <= K){ ans = ans + 1; } } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'cin' was not declared in this scope 3 | cin >> K >> S; | ^~~ a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:17:24: error: 'endl' was not declared in this scope 17 | cout << ans << endl; | ^~~~
s464018827
p03835
C++
int main(void){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; ++x){ for(int y = 0; y <= K; ++y){ int z = S - x - y; if(0 <= z and z <= K){ ans = ans + 1; } } } cout << ans << endl; return 0;
a.cc: In function 'int main()': a.cc:3:1: error: 'cin' was not declared in this scope 3 | cin >> K >> S; | ^~~ a.cc:17:1: error: 'cout' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:17:16: error: 'endl' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:18:10: error: expected '}' at end of input 18 | return 0; | ^ a.cc:1:15: note: to match this '{' 1 | int main(void){ | ^
s465824993
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin >>K >>S; int a=0; for(int h=0;h<=K,h++){ for(int i=0;i<=K,i++){ for(int j=0;j<=K,j++){ if(S==h+i+j) a++; } } } cout <<a <<endl; }
a.cc: In function 'int main()': a.cc:8:23: error: expected ';' before ')' token 8 | for(int h=0;h<=K,h++){ | ^ | ; a.cc:9:25: error: expected ';' before ')' token 9 | for(int i=0;i<=K,i++){ | ^ | ; a.cc:10:27: error: expected ';' before ')' token 10 | for(int j=0;j<=K,j++){ | ^ | ;
s746976304
p03835
Java
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int cnt = 0; for(int i = 0; i <= k; i++){ for(int h = 0; h <= k; h++){ if(s - x - y <= k && s >= x + y){ cnt++; } } } System.out.println(cnt); } }
Main.java:11: error: cannot find symbol if(s - x - y <= k && s >= x + y){ ^ symbol: variable x location: class Main Main.java:11: error: cannot find symbol if(s - x - y <= k && s >= x + y){ ^ symbol: variable y location: class Main Main.java:11: error: cannot find symbol if(s - x - y <= k && s >= x + y){ ^ symbol: variable x location: class Main Main.java:11: error: cannot find symbol if(s - x - y <= k && s >= x + y){ ^ symbol: variable y location: class Main 4 errors
s643602646
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,S,counter=0; cin>>K>>S; for(int x=0;x<=K;x++){ for(int y=0;y<=K;y++){ int z=S-(x+y); if(z<=K&&z>=0){ counter++; } } } cout<<counter<<endl;
a.cc: In function 'int main()': a.cc:15:23: error: expected '}' at end of input 15 | cout<<counter<<endl; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s943468083
p03835
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int k; int s; int main(){ cin >> k; cin >> s; int count = 0; for(int i=0; i<=k; i++){ for(int j=0; j<=k; j++{ if( 0<=((s - i) - j) && ((s - i) - j) <= k ) count++; } } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:27: error: expected ')' before '{' token 17 | for(int j=0; j<=k; j++{ | ~ ^ | )
s747424039
p03835
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int k; int s; cin >> k; cin >> s; int count = 0; int main(){ for(int i=0; i<=k; i++){ for(int j=0; j<=k; j++{ if( 0<=((s - i) - j) && ((s - i) - j) <= k ) count++; } } cout << count << endl; return 0; }
a.cc:9:1: error: 'cin' does not name a type 9 | cin >> k; | ^~~ a.cc:10:1: error: 'cin' does not name a type 10 | cin >> s; | ^~~ a.cc: In function 'int main()': a.cc:16:27: error: expected ')' before '{' token 16 | for(int j=0; j<=k; j++{ | ~ ^ | ) a.cc:17:52: error: reference to 'count' is ambiguous 17 | if( 0<=((s - i) - j) && ((s - i) - j) <= k ) 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:12:5: note: 'int count' 12 | int count = 0; | ^~~~~ a.cc:20:12: error: reference to 'count' is ambiguous 20 | 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:12:5: note: 'int count' 12 | int count = 0; | ^~~~~
s521320546
p03835
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long int main(int argc, char const *argv[]) { int k,s; int cnt = 0,z; scanf("%d%d",&k,&s); for (int x = 0; x <= k ; ++x) { for (int y = 0; y <= k; ++y){ z = s - x - y; if(0 <= z && z <= k) ++ans; } } printf("%d\n",cnt); return 0; }
main.c: In function 'main': main.c:19:51: error: 'ans' undeclared (first use in this function); did you mean 'abs'? 19 | if(0 <= z && z <= k) ++ans; | ^~~ | abs main.c:19:51: note: each undeclared identifier is reported only once for each function it appears in
s895371755
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k]
a.cc:3:27: error: too many decimal points in number 3 | print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k] | ^~~~ a.cc:3:40: error: too many decimal points in number 3 | print$length$[() | x <- [0..k], y <- [0..k], x+y<=s, s<=x+y+k] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s757687712
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]]
a.cc:3:22: error: too many decimal points in number 3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]] | ^~~~ a.cc:3:32: error: too many decimal points in number 3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-y-x,let i = [x,y]] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s398083657
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]]
a.cc:3:22: error: too many decimal points in number 3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]] | ^~~~ a.cc:3:32: error: too many decimal points in number 3 | print$length$[i|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y,let i = [x,y]] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s414321160
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
a.cc:3:27: error: too many decimal points in number 3 | print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | ^~~~ a.cc:3:37: error: too many decimal points in number 3 | print$length$[[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s493151839
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y]
a.cc:3:27: error: too many decimal points in number 3 | print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | ^~~~ a.cc:3:37: error: too many decimal points in number 3 | print$length [[x,y]|x<-[0..k],y<-[0..k],0<=s-x-y,k>=s-x-y] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s385305193
p03835
C++
main::IO() main=do [k,s]<-map read.words<$>getLine print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s]
a.cc:4:28: error: too many decimal points in number 4 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s] | ^~~~ a.cc:4:38: error: too many decimal points in number 4 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s] | ^~~~ a.cc:4:48: error: too many decimal points in number 4 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z==s] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main::IO() | ^~~~
s631061075
p03835
C++
main=do [k,s]<-map read.words<$>getLine print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s]
a.cc:3:28: error: too many decimal points in number 3 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s] | ^~~~ a.cc:3:38: error: too many decimal points in number 3 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s] | ^~~~ a.cc:3:48: error: too many decimal points in number 3 | print$length [[x,y,z]|x<-[0..k],y<-[0..k],z<-[0..k],x+y+z=s] | ^~~~ a.cc:1:1: error: 'main' does not name a type 1 | main=do | ^~~~
s915822616
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >>S; int a=0; for`(int x = 0;x<=K;x++) { for (int y=0;y<=K;y++) { for (int z=0;z<=K;z++) { if (x+y+z == S){ a +=1; } } } } cout << (a) <<endl; return 0; }
a.cc:8:8: error: stray '`' in program 8 | for`(int x = 0;x<=K;x++) | ^
s438705442
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >>S; int a=0; for(int x = 0;x<=K;x++) { for (int y=0;y<=K,y++) { for (int z=0;z<=K,z++) { if (x+y+z == S){ a +=1; } } } } cout << (a) <<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:26: error: expected ';' before ')' token 10 | for (int y=0;y<=K,y++) | ^ | ; a.cc:12:26: error: expected ';' before ')' token 12 | for (int z=0;z<=K,z++) | ^ | ;
s856077816
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >>S; int a=0; for`(int x = 0;x<=K;x++) { for (int y=0;y<=K,y++) { for (int z=0;z<=K,z++) { if (x+y+z == S){ a =a+1; } } } } cout << a <<endl; return 0; }
a.cc:8:8: error: stray '`' in program 8 | for`(int x = 0;x<=K;x++) | ^ a.cc: In function 'int main()': a.cc:10:26: error: expected ';' before ')' token 10 | for (int y=0;y<=K,y++) | ^ | ; a.cc:12:26: error: expected ';' before ')' token 12 | for (int z=0;z<=K,z++) | ^ | ;
s888132346
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >>S; int a=0; for`(int x = 0;x<=K;++x) { for (int y=0;y<=K,++y) { for (int z=0;z<=K,++z) { if (x+y+z == S){ a +=1; } } } } cout << (a) <<endl; return 0; }
a.cc:8:10: error: stray '`' in program 8 | for`(int x = 0;x<=K;++x) | ^ a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before ')' token 10 | for (int y=0;y<=K,++y) | ^ | ; a.cc:12:38: error: expected ';' before ')' token 12 | for (int z=0;z<=K,++z) | ^ | ;
s955520557
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >>S; int a=0; for`(int x = 0;x<=K;x++) { for (int y=0;y<=K,y++) { for (int z=0;z<=K,z++) { if (x+y+z == S){ a +=1; } } } } cout << (a) <<endl; return 0; }
a.cc:8:4: error: stray '`' in program 8 | for`(int x = 0;x<=K;x++) | ^ a.cc: In function 'int main()': a.cc:10:22: error: expected ';' before ')' token 10 | for (int y=0;y<=K,y++) | ^ | ; a.cc:12:22: error: expected ';' before ')' token 12 | for (int z=0;z<=K,z++) | ^ | ;
s534781951
p03835
C++
#include <iostream> using namespace std; int K, S; int main(){ cin >> K >> S; int res = 0; for(int i = 0; i <= K; i++){ for(int j = 0; j <= K; j++){ if(K >= S - i + j ){ res ++; } } } } cout << res << endl; }
a.cc:17:3: error: 'cout' does not name a type 17 | cout << res << endl; | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s789596866
p03835
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int S = sc.nextInt(); int count = 0; for (int i = 0; i < K; i++) { for (int j = 0; j < K; j++) { for (int l = 0; l < K; l++) { if(i + j + l == S) { count++; } } } } System.out.println(count); } } import java.util.Scanner; public class abc051b { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int S = sc.nextInt(); int count = 0; for (int i = 0; i < K; i++) { for (int j = 0; j < K; j++) { for (int l = 0; l < K; l++) { if(i + j + l == S) { count++; } } } } System.out.println(count); } }
Main.java:26: error: class, interface, enum, or record expected import java.util.Scanner; ^ 1 error
s363265918
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin >> K >> S; int answer = 0; for(int x = 0; x <= K; x++){ if(x > S) break; else{ for (int y = 0; y <= K; y++){ if (x + y > S) break; else{ for (int z = 0; z <= K; z++){ if (x + y + z > S) break; else if(x + y + z == S)answer++; } } } } } cout << answer;
a.cc: In function 'int main()': a.cc:24:16: error: expected '}' at end of input 24 | cout << answer; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s205184552
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, s, i, , c = 0; cin >> k >> s; for(i=0; i<=k; i++){ for(j=0; j<=k; j++){ if(s-i-j >=0 && s-i-j <= k){ c++; } } } cout << c; return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: expected unqualified-id before ',' token 5 | int k, s, i, , c = 0; | ^ a.cc:8:13: error: 'j' was not declared in this scope 8 | for(j=0; j<=k; j++){ | ^
s370262707
p03835
C++
#include<iostream> using namespace std; int main(){ int k,s; int count=0; cin>>k>>s; for(int i=0;i<=k;++i){ for(int j=0;j<=k;++j){ x=s-i-j; if(x<=k){ if(i==j&&j!=s)count+=3; else if(i!=j)count+=6; else count+=0; } } } cout<<count<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'x' was not declared in this scope 10 | x=s-i-j; | ^
s159283545
p03835
C++
#include<iostream> using namespace std; int main(){ int K,S,ans=0; cin >> K >> S; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ if(S-i-j>=0 && s-i-j<=K){++ans;} } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:24: error: 's' was not declared in this scope 10 | if(S-i-j>=0 && s-i-j<=K){++ans;} | ^
s229206373
p03835
C++
#include<cstdio> #include<iostream> using namespace std; int main(void) { int k, s, num = 0; cin >> k >> s; for (x = 0; x <= k; x++) { for (y = 0; y <= k; y++) { for (z = 0; z <= k; z++) { if (s == x + y + z)num++; } } } cout << num << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: 'x' was not declared in this scope 12 | for (x = 0; x <= k; x++) { | ^ a.cc:13:22: error: 'y' was not declared in this scope 13 | for (y = 0; y <= k; y++) { | ^ a.cc:14:30: error: 'z' was not declared in this scope 14 | for (z = 0; z <= k; z++) { | ^
s686925792
p03835
C++
#include<cstdio> #include<iostream> using namespace std; int main(void) { int k, s, num = 0; cin >> k >> s; if (x = 0; x <= k; x++) { if (y = 0; y <= k; y++) { if (z = 0; z <= k; z++) { if (s == x + y + z)num++; } } } cout << num << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: 'x' was not declared in this scope 12 | if (x = 0; x <= k; x++) { | ^ a.cc:12:26: error: expected ')' before ';' token 12 | if (x = 0; x <= k; x++) { | ~ ^ | ) a.cc:12:28: error: 'x' was not declared in this scope 12 | if (x = 0; x <= k; x++) { | ^
s154888900
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k,s; int ans = 0; cin >> k >> s; for(int x=0; x<=k; x++){ for(int y=0; y<=k; y++){ int z = s-x-y; if(0<=z<=k) ans ++; } } } cout << ans << endl; }
a.cc:17:3: error: 'cout' does not name a type 17 | cout << ans << endl; | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s257568256
p03835
C++
include <iostream> int main(){ int k,s; std::cin >> k >> s; long long res = 0; for(int i = 0; i <= k; i ++){ for(int j = 0; j <= k; j ++){ int tmp = s - i - j; if (tmp <= k && tmp >= 0) res ++; } } std::cout << res; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~
s210447394
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K. S; cin >> K >> S; int cnt = 0; for (int x = 0; x < K; x++){ for (int y = x; y < K; y++){ if (S - x - y >= y && S - x - y <= K){ cnt++; } } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: expected initializer before '.' token 5 | int K. S; | ^ a.cc:6:12: error: 'K' was not declared in this scope 6 | cin >> K >> S; | ^ a.cc:6:17: error: 'S' was not declared in this scope 6 | cin >> K >> S; | ^
s127130206
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K. S; cin >> K >> S; int cnt = 0; for (int x = 0; x < K; x++){ for (int y = x; y < K; y++){ if (S - x - y >= 0 && S - x - y <= K){ cnt++; } } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:5:10: error: expected initializer before '.' token 5 | int K. S; | ^ a.cc:6:12: error: 'K' was not declared in this scope 6 | cin >> K >> S; | ^ a.cc:6:17: error: 'S' was not declared in this scope 6 | cin >> K >> S; | ^
s932558051
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,S;cin>>K>>s; int res=0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ if(S-i-j>=0&s-i-j<=K)++res; } } cout<<res; }
a.cc: In function 'int main()': a.cc:4:19: error: 's' was not declared in this scope 4 | int K,S;cin>>K>>s; | ^
s620324528
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,S;cin>>K>>s; int res=0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ if(S-i-y>=0&s-i-j<=K)++res; } } cout<<res; }
a.cc: In function 'int main()': a.cc:4:19: error: 's' was not declared in this scope 4 | int K,S;cin>>K>>s; | ^ a.cc:8:14: error: 'y' was not declared in this scope 8 | if(S-i-y>=0&s-i-j<=K)++res; | ^
s285793107
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int k,s,ans = 0,z; cin >> k >> s; for(int i = 0; i <= K; ++i){ for(int j = 0; j <= K; ++j){ z = s - i - j; if(0 <= z && z <= k){ ans = ans + 1; } } } cout << ans << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:9:29: error: 'K' was not declared in this scope 9 | for(int i = 0; i <= K; ++i){ | ^
s398681796
p03835
C++
}
a.cc:1:3: error: expected declaration before '}' token 1 | } | ^
s024144611
p03835
C++
#include < bits/stdc++.h> using namespace std; int main(){ int k,s,ans=0; int z; for(int x=0;x<=k;x++){ for(int y=0;y<=k;y++){ z = s - x - y; if(0<=s && s <= k) ans++; } } cout << ans << endl; }
a.cc:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include < bits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s599663566
p03835
C++
#include<iostream> int main(){ int count = 0; int K, S; cin >> K >> S; for(int x = 0;x <= K;x ++){ if(x == S){ count ++; break; } for(int y = 0;y <= K;y ++){ if(x + y == S){ count ++; break; } for(int z = 0;z <= K;z ++){ if(x + y + z == S){ count ++; break; } } } } }
a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> K >> S; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~
s248218716
p03835
C++
#include<iostream> using namespace std; int main() { int k,s,i,k,l,sum=0; cin>>k>>s; for(i=0;i<=k;i++) { for(j=0;j<=k;j++) { for(l=0;l<=k;l++) { if(i+j+l==s) { sum++; } } } } return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: redeclaration of 'int k' 5 | int k,s,i,k,l,sum=0; | ^ a.cc:5:9: note: 'int k' previously declared here 5 | int k,s,i,k,l,sum=0; | ^ a.cc:9:13: error: 'j' was not declared in this scope 9 | for(j=0;j<=k;j++) | ^
s140926253
p03835
Java
public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int k=sc.nextInt(); int t=sc.nextInt(); int count=0; for(int i=0;i<=k;i++) { for(int j=0;j<=k;j++) { for(int l=0;l<=k;l++) { if(i+j+l==t)count++; } } } System.out.println(count); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s498508419
p03835
C
#include<stdio.h> int main(){ int x,y,z; int s,k; int cnt=0; int x=0,c=0; scanf("%d%d",&k,&s); if(k>s){ k=s; } for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ for(int n=0;n<=k;n++){ if(i+n+j==s){ cnt++; break; } } } } printf("%d",cnt); }
main.c: In function 'main': main.c:7:13: error: redeclaration of 'x' with no linkage 7 | int x=0,c=0; | ^ main.c:4:13: note: previous declaration of 'x' with type 'int' 4 | int x,y,z; | ^
s689312517
p03835
C++
#include<iostream> using namespace std; int s, k; int ans; void DFS(int n, int sum){ if (n == 3 && sum == 0){ ++ans; } else if (n > 3)return; for (int i = 0; i <= k; ++i){ num[n + 1] = i; DFS(n + 1, sum - i); } } int main(){ cin >> k >> s; DFS(0, s); cout << ans << endl; }
a.cc: In function 'void DFS(int, int)': a.cc:9:17: error: 'num' was not declared in this scope; did you mean 'sum'? 9 | num[n + 1] = i; | ^~~ | sum
s142546848
p03835
C
#include<iostream> using namespace std; int main(){ int x,y,z,k,s,num=0; cin>>k>>s; for(z=0;z<=k;z++){ for(y=0;y<=k;y++){ for(x=0;x<=k;x++){ if(x+y+z==s) num++; } } } cout<<num; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s874152792
p03835
C++
int main() { int K, S; cin >> K >> S; int ans = 0; for (int X = 0; X <= K; X++) { // if (S < X + 0 + 0) break; for (int Y = 0; Y <= K; Y++) { // if (S < X + Y + 0) break; if (S - (X + Y) >= 0 && S - (X + Y) <= K) ans++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> K >> S; | ^~~ a.cc:17:9: error: 'cout' was not declared in this scope 17 | cout << ans << endl; | ^~~~ a.cc:17:24: error: 'endl' was not declared in this scope 17 | cout << ans << endl; | ^~~~
s820232225
p03835
C++
25*25*25=#include<iostream> #include <bits/stdc++.h> #include<stdio.h> #include <stdlib.h> #include<string> #include<queue> #include<algorithm> #include<math.h> using namespace std; int main(){ int K,S,ans=0; cin>>K>>S; for(int i=0;i<=K;i++){ for(j=0;j<=K;j++){ if(S-i-j>=0&&S-i-j<=K){ ans++; } } } cout<<ans<<endl; }
a.cc:1:10: error: stray '#' in program 1 | 25*25*25=#include<iostream> | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 25*25*25=#include<iostream> | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initialize
s883500672
p03835
C++
#include<iostream> using namespace std; int main() { int a,b; long long cnt = 0; cin >> a >> b; //a1+a2+a3 == b for(int i = 0;i < a;i++){ for(int j = 0;j < a-i;j++){ for(int k = 0;k < a-i-j;k++){ if(i+j+k == s) cnt++; } } } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:29: error: 's' was not declared in this scope 14 | if(i+j+k == s) cnt++; | ^
s346179726
p03835
C++
#include <iostream> #include <vector> #include <algorithm> #include <bits/stdc++.h> #include <stdlib.h> #include <stdio.h> #include <functional> #include<math.h> using namespace std; int main(void){ // Your code here! int K,S; cin >> K >> S; int count = 0; for(int i = 0;i <= K;i++){ for(int j = 0;j <= K; j++){ if(S-i-j <= K){ count++ }; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:18:24: error: expected ';' before '}' token 18 | count++ | ^ | ; 19 | }; | ~
s126245911
p03835
C++
#include <iostream> using namespace std; int main{ int K, S, ans=0; int sum; cin >> K >> S; for(int i=0; i<=K && i<=S; i++){ for(int j=0; j<=K && j<=S; j++){ sum = i+j; if(S-sum>=0){ ans++; }else{ break; } } } cout << ans << endl; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:6:3: error: expected primary-expression before 'int' 6 | int K, S, ans=0; | ^~~ a.cc:6:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:8:3: error: 'cin' does not name a type 8 | cin >> K >> S; | ^~~ a.cc:10:3: error: expected unqualified-id before 'for' 10 | for(int i=0; i<=K && i<=S; i++){ | ^~~ a.cc:10:16: error: 'i' does not name a type 10 | for(int i=0; i<=K && i<=S; i++){ | ^ a.cc:10:30: error: 'i' does not name a type 10 | for(int i=0; i<=K && i<=S; i++){ | ^ a.cc:21:3: error: 'cout' does not name a type 21 | cout << ans << endl; | ^~~~ a.cc:23:3: error: expected unqualified-id before 'return' 23 | return 0; | ^~~~~~ a.cc:24:1: error: expected declaration before '}' token 24 | } | ^
s999975628
p03835
C
#include<stdio.h> int main(){ int K, S, i, j, k count = 0; scanf("%d %d", &K, &S); for (i = 0; i <= K; i++){ for (j = 0; j <= K; j++){ for (k = 0; k <= K; k++){ if(i + j + k == S){ count++; } } } } printf("%d\n", count); }
main.c: In function 'main': main.c:4:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'count' 4 | int K, S, i, j, k count = 0; | ^~~~~ main.c:8:12: error: 'k' undeclared (first use in this function) 8 | for (k = 0; k <= K; k++){ | ^ main.c:8:12: note: each undeclared identifier is reported only once for each function it appears in main.c:10:11: error: 'count' undeclared (first use in this function) 10 | count++; | ^~~~~
s995883806
p03835
C
#include <stdio.h> /*void sample1(int k,int s){ int x,y,z,res=0; for(x=0;x<=k;x++){ for(y=0;y<=k;y++){ z = s - x - y; if(0<=z && z<=k)res++; } } printf("%d\n",res); }*/ void sample2(int k,int s){ int z,res=0; if(k == s){ for(z=0;z<=s+1;z++)res += z; }else if(k > s){ for(z=0;z<=s;z++){ res += s-z+1; } }else{ for(z=0;z<=k;z++){ if(s-z <= 2*k){ res += (2*k) - (s-z) + 1; } } } printf("%d\n",res); } int main(void){ int k,s; scanf("%d %d",&k,&s); sample1(k,s); sample2(k,s); }
main.c: In function 'main': main.c:36:9: error: implicit declaration of function 'sample1'; did you mean 'sample2'? [-Wimplicit-function-declaration] 36 | sample1(k,s); | ^~~~~~~ | sample2
s981445169
p03835
C
#include<stdio.h> int main(){ int k,s,i,j,z,count=0; scanf("%d %d",&k,&s); for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ z = s - i - j; if(z>=0 && z<=k){ count++;2 } } } printf("%d",count); return 0; }
main.c: In function 'main': main.c:12:30: error: expected ';' before '}' token 12 | count++;2 | ^ | ; 13 | } | ~
s215335640
p03835
C++
#include<bits/stdc++.h> using namespace std; int sum; int main() { int a,b; cin>>a,b; int i,j; for(int i=0;i<=k;i++) for(int j=0;j<=k;j++) { if(s-i-j>=0&&(s-i-j)<=k)sum++; } cout<<sum<<endl; }
a.cc: In function 'int main()': a.cc:9:20: error: 'k' was not declared in this scope 9 | for(int i=0;i<=k;i++) | ^ a.cc:12:12: error: 's' was not declared in this scope 12 | if(s-i-j>=0&&(s-i-j)<=k)sum++; | ^
s962442496
p03835
C++
#include<bits/stdc++.h> using namespace std; int sum; int main() { int a,b; cin>>a,b; int i,j; for(int i=0;i<=k;i++) for(int j=0;j<=k;j++) { if(s-i-j>=0&&s-i-j<=k)ans++; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:20: error: 'k' was not declared in this scope 9 | for(int i=0;i<=k;i++) | ^ a.cc:12:12: error: 's' was not declared in this scope 12 | if(s-i-j>=0&&s-i-j<=k)ans++; | ^ a.cc:12:31: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | if(s-i-j>=0&&s-i-j<=k)ans++; | ^~~ | abs a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | cout<<ans<<endl; | ^~~ | abs
s931388273
p03835
C++
#include<bits/stdc++.h> using namespace std; int sum; int main() { int a,b; cin>>a,b; int i,j; for(int i=0;i<=k;i++) for(int j=0;j<=k;j++) { if(s-i-j>=0&&s-x-y<=k)ans++; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:20: error: 'k' was not declared in this scope 9 | for(int i=0;i<=k;i++) | ^ a.cc:12:12: error: 's' was not declared in this scope 12 | if(s-i-j>=0&&s-x-y<=k)ans++; | ^ a.cc:12:24: error: 'x' was not declared in this scope 12 | if(s-i-j>=0&&s-x-y<=k)ans++; | ^ a.cc:12:26: error: 'y' was not declared in this scope 12 | if(s-i-j>=0&&s-x-y<=k)ans++; | ^ a.cc:12:31: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | if(s-i-j>=0&&s-x-y<=k)ans++; | ^~~ | abs a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | cout<<ans<<endl; | ^~~ | abs
s523285286
p03835
C
#include <stdio.h> int max(int a, int b){return a > b ? a : b;} int main(void){ int k, s; int count = 0; scanf("%d %d", &k, &s); for(int x = max(s - 2 * k, 0); x <= k; x++) conut += k - max(s - x - k, 0) + 1; printf("%d\n", count); return 0; }
main.c: In function 'main': main.c:10:17: error: 'conut' undeclared (first use in this function); did you mean 'count'? 10 | conut += k - max(s - x - k, 0) + 1; | ^~~~~ | count main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
s885724434
p03835
C
#include <stdio.h> int min(a, b){return a > b ? b : a;} int max(a, b){return a > b ? a : b;} int main(void){ int k, s; int count = 0; scanf("%d %d", &k, &s); for(int x = max(s - 2 * k, 0); x <= k; x++) conut += k - max(s - x - k, 0) + 1; printf("%d\n", count); return 0; }
main.c: In function 'min': main.c:3:5: error: type of 'a' defaults to 'int' [-Wimplicit-int] 3 | int min(a, b){return a > b ? b : a;} | ^~~ main.c:3:5: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: In function 'max': main.c:4:5: error: type of 'a' defaults to 'int' [-Wimplicit-int] 4 | int max(a, b){return a > b ? a : b;} | ^~~ main.c:4:5: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: In function 'main': main.c:11:17: error: 'conut' undeclared (first use in this function); did you mean 'count'? 11 | conut += k - max(s - x - k, 0) + 1; | ^~~~~ | count main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
s879813119
p03835
C
#include<stdio.h> int main(){ int K, S; int X, Y, Z; int cnt=0; scanf("%d %d", K, S); for(X=0; X<=K; X++){ for(Y=0; Y<=K; Y++){ for(Z=0; Z<=K; Z++){ if(X+Y+Z===S) cnt++ } } } return 0; }
main.c: In function 'main': main.c:10:21: error: expected expression before '=' token 10 | if(X+Y+Z===S) | ^
s578239597
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S,X,Y,Z; int res=0; cin >> K >> S; for (X=0; X<K; ++X){ for (Y=0; y<K; ++Y){ Z = S-X-Y; if (0<=Z<=K) ++res; } } cout << res << endl; }
a.cc: In function 'int main()': a.cc:9:19: error: 'y' was not declared in this scope 9 | for (Y=0; y<K; ++Y){ | ^
s368232260
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S,X,Y,Z; int res=0; cin >> K >> S; for (X=0; X<K; ++X){ for (Y=0; y<K; ++Y){ int Z = S-X-Y; if (0<=Z<=K) ++res; } } cout << res << endl; }
a.cc: In function 'int main()': a.cc:9:19: error: 'y' was not declared in this scope 9 | for (Y=0; y<K; ++Y){ | ^
s308308115
p03835
C++
#include<cstdio> #include<iostream> #include<iomanip> #include<algorithm> #include<cmath> #include<cstring> #include<cstdlib> #include<fstream> using namespace std; int main() { int x,y,z; int s,k; cin>>s>>k; itn sum=0; for(x=0;x<=k;x++) { for(y=0;y<=k;y++) { for(z=0;z<=k;z++) { if(x+y+z==s) { sum++; } } } } return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'itn' was not declared in this scope; did you mean 'int'? 15 | itn sum=0; | ^~~ | int a.cc:24:41: error: 'sum' was not declared in this scope 24 | sum++; | ^~~
s614001465
p03835
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a,b,c=0,d=0,e=0,count=0; cin>>a>>b; for(int c=0;c<b/3;c++){ for(int d=0;d<b/3;d++){ e=(b/3)-c-d; if(e>=0 and b==c+b+e){ count++; } } } } cout<<count<<endl; }
a.cc:16:3: error: 'cout' does not name a type 16 | cout<<count<<endl; | ^~~~ a.cc:17:1: error: expected declaration before '}' token 17 | } | ^
s179361739
p03835
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a,b,c=0,d=0,e=0,count=0; cin>>a>>b; for(int c=0;c<b/3;c++){ for(int d=0;d<b/3;d++){ e=(b/3)-c-d; if(e>=0 and b==c+b+e) count++; } } } cout<<count<<endl; }
a.cc:15:3: error: 'cout' does not name a type 15 | cout<<count<<endl; | ^~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s016520576
p03835
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a,b,c=0,d=0,e=0,count=0; cin>>a>>b; for(int i=0;i<b/3;i++){ for(int j=0;j<b/3;j++){ for(int k=0;k<b/3;k++){ if(b==i+j+k) count++ } } } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:11:18: error: expected ';' before '}' token 11 | count++ | ^ | ; 12 | } | ~
s470329686
p03835
C++
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <algorithm> #include <set> using namespace std; int main() { int k,s; cin >> k >> s; int i,j,l int ans = 0; for(i = 0;i <=k;++i){ for(j = 0;j <= k;++j){ for(l = 0;l <= k;++l){ if(i+j+l == s){ ++ans; } } } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: expected initializer before 'int' 15 | int ans = 0; | ^~~ a.cc:18:17: error: 'l' was not declared in this scope 18 | for(l = 0;l <= k;++l){ | ^ a.cc:20:23: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | ++ans; | ^~~ | abs a.cc:25:13: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | cout << ans << endl; | ^~~ | abs
s636782190
p03835
C++
#include<bits/stdc++.h> using namespace std; int main() { int k,s,i,ans=0; scanf("%d %d",&k,&s); for(i=0;i<=k;i++) { for(j=0;j<=k;j++) { int ij=s-i-j; if(ij<=k && ij>=0) ans++; } } printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'j' was not declared in this scope 9 | for(j=0;j<=k;j++) | ^
s303895648
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int count = 0; for (int X =0; X <=K; X++){ for (int Y =0; Y <=K; Y++){ int t = X+Y+Z; int Z = S - Y - X; if(t == S){ count++;} } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:11:21: error: 'Z' was not declared in this scope 11 | int t = X+Y+Z; | ^ a.cc: At global scope: a.cc:19:3: error: 'cout' does not name a type 19 | cout << count << endl; | ^~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s588849668
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int count = 0; for (int X =0; X <=K; X++){ for (int Y =0; Y <=K; Y++){ for(int Z =0; Z <=K; Z++){ int t = X+Y+Z if(t == S){ count++;} } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:13:11: error: expected ',' or ';' before 'if' 13 | if(t == S){ | ^~
s512208076
p03835
C++
for(int x=0;x<=k;x++) { if(x>s) break; for(int y=x;y<=k;y++) { if(y>s) break; for(int z=y;z<=k;z++) { if(z>s) break; if(x+y+z==s){ if(x==y==z) count+=1; else if(x==y||y==z||z==x) count+=3; else if(x!=y&&y!=z&&z!=x) count+=6; } } } }
a.cc:1:1: error: expected unqualified-id before 'for' 1 | for(int x=0;x<=k;x++) | ^~~ a.cc:1:13: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^ a.cc:1:18: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^
s286313386
p03835
C++
for(int x=0;x<=k;x++) { if(x>s) break; for(int y=x;y<=k;y++) { if(y>s) break; for(int z=y;z<=k;z++) { if(z>s) break; if(x+y+z==s){ if(x==y==z) count+=1; else if(x==y||y==z||z==x) count+=3; else if(x!=y&&y!=z&&z!=x) count+=6; } } }
a.cc:1:1: error: expected unqualified-id before 'for' 1 | for(int x=0;x<=k;x++) | ^~~ a.cc:1:13: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^ a.cc:1:18: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^
s152725506
p03835
C++
for(int x=0;x<=k;x++) { if(x>s) break; for(int y=x;y<=k;y++) { if(y>s) break; for(int z=y;z<=k;z++) { if(z>s) break; if(x+y+z==s){ if(x==y==z) count+=1; else if(x==y||y==z||z==x) count+=3; else if(x!=y&&y!=z&&z!=x) count+=1; } } }
a.cc:1:1: error: expected unqualified-id before 'for' 1 | for(int x=0;x<=k;x++) | ^~~ a.cc:1:13: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^ a.cc:1:18: error: 'x' does not name a type 1 | for(int x=0;x<=k;x++) | ^
s584770154
p03835
C++
int main(){ int k, s; int count=0; scanf("%d %d", &k, &s); for(int x=0;x<=k;x++) for(int y=0;y<=k;y++) for(int z=0;z<=k;z++) { if(x+y+z==s) count++; } printf("%d\n",count); return 0; }
a.cc: In function 'int main()': a.cc:4:5: error: 'scanf' was not declared in this scope 4 | scanf("%d %d", &k, &s); | ^~~~~ a.cc:11:5: error: 'printf' was not declared in this scope 11 | printf("%d\n",count); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){
s428052911
p03835
C++
int main(){ int k, s; int count=0; scanf("%d %d", &k, &s); for(int x=0;x<=k;k++) for(int y=0;y<=k;y++) for(int z=0;z<=k;z++) { if(x+y+z==s) count++; } printf("%d\n",count); return 0; }
a.cc: In function 'int main()': a.cc:4:5: error: 'scanf' was not declared in this scope 4 | scanf("%d %d", &k, &s); | ^~~~~ a.cc:11:5: error: 'printf' was not declared in this scope 11 | printf("%d\n",count); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){
s599770035
p03835
C++
#include <bits/stdc++.h> using namespace std; int n,m,ans; int i,j,k; int main(){ cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=n;j++){ k=s-i-j; if(k<=n&&k>0)ans++; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: 's' was not declared in this scope 9 | k=s-i-j; | ^
s826109435
p03835
C++
#pragma GCC optimize(3) #pragma GCC target("avx") #pragma GCC optimize("Ofast") #pragma GCC optimize("inline") #pragma GCC optimize("-fgcse") #pragma GCC optimize("-fgcse-lm") #pragma GCC optimize("-fipa-sra") #pragma GCC optimize("-ftree-pre") #pragma GCC optimize("-ftree-vrp") #pragma GCC optimize("-fpeephole2") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-fsched-spec") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("-falign-jumps") #pragma GCC optimize("-falign-loops") #pragma GCC optimize("-falign-labels") #pragma GCC optimize("-fdevirtualize") #pragma GCC optimize("-fcaller-saves") #pragma GCC optimize("-fcrossjumping") #pragma GCC optimize("-fthread-jumps") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-fwhole-program") #pragma GCC optimize("-freorder-blocks") #pragma GCC optimize("-fschedule-insns") #pragma GCC optimize("inline-functions") #pragma GCC optimize("-ftree-tail-merge") #pragma GCC optimize("-fschedule-insns2") #pragma GCC optimize("-fstrict-aliasing") #pragma GCC optimize("-fstrict-overflow") #pragma GCC optimize("-falign-functions") #pragma GCC optimize("-fcse-skip-blocks") #pragma GCC optimize("-fcse-follow-jumps") #pragma GCC optimize("-fsched-interblock") #pragma GCC optimize("-fpartial-inlining") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("-freorder-functions") #pragma GCC optimize("-findirect-inlining") #pragma GCC optimize("-fhoist-adjacent-loads") #pragma GCC optimize("-frerun-cse-after-loop") #pragma GCC optimize("inline-small-functions") #pragma GCC optimize("-finline-small-functions") #pragma GCC optimize("-ftree-switch-conversion") #pragma GCC optimize("-foptimize-sibling-calls") #pragma GCC optimize("-fexpensive-optimizations") #pragma GCC optimize("-funsafe-loop-optimizations") #pragma GCC optimize("inline-functions-called-once") #pragma GCC optimize("-fdelete-null-pointer-checks")#include<cstdio> #include<iostream> #include<algorithm> #include<cstdlib> #include<cstring> using namespace std; int k,s,sum; int main() { cin>>k>>s; for(int i=0;i<=k;i++) for(int j=0;j<=k;j++) for(int l=0;l<=k;l++) if(i+l+j==s)sum++; cout<<sum<<endl; return 0; }
a.cc:48:53: error: stray '#' in program 48 | #pragma GCC optimize("-fdelete-null-pointer-checks")#include<cstdio> | ^ a.cc:23:39: warning: bad option '-fwhole-program' to pragma 'optimize' [-Wpragmas] 23 | #pragma GCC optimize("-fwhole-program") | ^ a.cc:30:41: warning: bad option '-fstrict-overflow' to pragma 'optimize' [-Wpragmas] 30 | #pragma GCC optimize("-fstrict-overflow") | ^ a.cc:32:41: warning: bad option '-fcse-skip-blocks' to pragma 'optimize' [-Wpragmas] 32 | #pragma GCC optimize("-fcse-skip-blocks") | ^ a.cc:46:51: warning: bad option '-funsafe-loop-optimizations' to pragma 'optimize' [-Wpragmas] 46 | #pragma GCC optimize("-funsafe-loop-optimizations") | ^ a.cc:48:54: error: '#pragma GCC optimize' string is badly formed 48 | #pragma GCC optimize("-fdelete-null-pointer-checks")#include<cstdio> | ^~~~~~~ a.cc:55:10: warning: bad option '-fwhole-program' to attribute 'optimize' [-Wattributes] 55 | int main() | ^ a.cc:55:10: warning: bad option '-fstrict-overflow' to attribute 'optimize' [-Wattributes] a.cc:55:10: warning: bad option '-fcse-skip-blocks' to attribute 'optimize' [-Wattributes] a.cc:55:10: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
s001818554
p03835
C
#include<stdio.h> int main(void) { int k=0,s=0,z=0count=0; scanf("%d%d",&k,&s); for(int i = 0;i <= k;i++) { for(int j = 0;i <= k;j++) { z = s - i - j; if(0 <= z && z <= k){count++;} } } printf("%d",count); }
main.c: In function 'main': main.c:5:17: error: invalid suffix "count" on integer constant 5 | int k=0,s=0,z=0count=0; | ^~~~~~ main.c:12:28: error: 'count' undeclared (first use in this function) 12 | if(0 <= z && z <= k){count++;} | ^~~~~ main.c:12:28: note: each undeclared identifier is reported only once for each function it appears in
s012498073
p03835
C++
#include<iostream> #include<cstdio> using namespace std; int k,s; int x,y,z; int ans=0; int main(){ int i,j,kk; cin>>k>>s; if(3*k<s){ cout<<"0"<<endl; return 0; } if(3*k==s){ cout<<1<<endl; return 0; } int sum; ans=k*3 cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:16: error: expected ';' before 'cout' 19 | ans=k*3 | ^ | ; 20 | cout<<ans<<endl; | ~~~~
s889207731
p03835
C++
#include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <time.h> #include <string> #include <tuple> #include <vector> #include <map> #include <list> #include <set> #include <stack> #include <queue> #include <cstdlib> #include <algorithm> #include <random> #include <cassert> using namespace std; #define LL long long #define MP(a, b) make_pair(a, b) #define MMP(a, b, c) make_pair(make_pair(a, b), c) #define MAX 1000000000 #undef INT_MIN #undef INT_MAX #define INT_MIN -2147483648 #define INT_MAX 2147483647 #define LL_MIN -9223372036854775808 #define LL_MAX 9223372036854775807 #define PI 3.14159265359 int main(){ iostream::sync_with_stdio(false); int K,S; cin >> K >> S; long long ans = 0; for(int i=0; <=K; i++){ for(int j=0; j<=K; j++){ if(i+j<=S) ans++; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:18: error: expected primary-expression before '<=' token 37 | for(int i=0; <=K; i++){ | ^~
s232257678
p03835
C++
int main() { int K, S; cin >> K >> S; int sum = 0; for (int X = 0; X < K + 1; X++) { for (int Y = 0; Y < K + 1; Y++) { if (X + Y <= S) { sum += 1; } } } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> K >> S; | ^~~ a.cc:13:9: error: 'cout' was not declared in this scope 13 | cout << sum << endl; | ^~~~ a.cc:13:24: error: 'endl' was not declared in this scope 13 | cout << sum << endl; | ^~~~
s249513391
p03835
C++
#include <bits/stdc++.h> using namespace std; int main (){ int K, S; cin >> K >> S; int ans = 0; if(S <= K){ ans = (S + 2)*(S + 1)*S/6; } if(S > K && S <= 2*K){ ans = (S + 2)*(S + 1)*S/6 - 1; for(int X = K+1;X < S;X++){ ans -= (S-X+1)*(S-X)/2; } if(S > 2*K && S <= 3*K){ (S - 2*K + 2)*(S - 2*K + 1)*(S - 2*K)/6; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main (){ | ^