submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s795295872
p03835
C++
#include <bits/stdc++.h> using namespace std; int main (){ int K, S; cin >> K >> S; 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; } }
a.cc: In function 'int main()': a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | ans = (S + 2)*(S + 1)*S/6; | ^~~ | abs a.cc:11:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | ans = (S + 2)*(S + 1)*S/6 - 1; | ^~~ | abs a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main (){ | ^
s749916283
p03835
C++
#include <bits/stdc++.h> using namespace std; int main (){ int K, S; cin >> K >> S; 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(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 } }
a.cc: In function 'int main()': a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | ans = (S + 2)*(S + 1)*S/6; | ^~~ | abs a.cc:11:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | ans = (S + 2)*(S + 1)*S/6 - 1; | ^~~ | abs a.cc:12:9: error: 'X' was not declared in this scope 12 | for(X = K+1;X < S;X++){ | ^ a.cc:16:44: error: expected ';' before '}' token 16 | (S - 2*K + 2)*(S - 2*K + 1)*(S - 2*K)/6 | ^ | ; 17 | } | ~ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main (){ | ^
s933619825
p03835
C++
#include <bits/stdc++.h> using namespace std; int main (){ int K, S; cin >> K >> S; int ans = 1; while(S > 0){ ans *= (K + S) / S; S-- } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:8: error: expected ';' before '}' token 10 | S-- | ^ | ; 11 | } | ~
s529036398
p03835
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int A = sc.nextInt(); int B = sc.nextInt(); int count = 0; int total = 0; for(int i = 1; i <= N; i++){ int n=i; count = 0; while(int n>0){ count += n % 10; n = n / 10; } if(A<=count && count<=B){ total += i; } } System.out.println(total); } }
Main.java:16: error: '.class' expected while(int n>0){ ^ Main.java:16: error: not a statement while(int n>0){ ^ Main.java:16: error: ';' expected while(int n>0){ ^ 3 errors
s610028831
p03835
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int count = 0; for(int x=0; x<=k; x++){ for(int y=0; y<=k; y++){ int z=s-x-y; if(0=<z && z<=k){ count++; } } } System.out.println(count); } }
Main.java:15: error: > or ',' expected if(0=<z && z<=k){ ^ 1 error
s432638527
p03835
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int count = 0; for(int x=0; x<=k; x++){ for(int y=0; y<=k; y++){ z=s-x-y; if(x+y+z==k){ count++; } } } System.out.println(count); } }
Main.java:14: error: cannot find symbol z=s-x-y; ^ symbol: variable z location: class Main Main.java:15: error: cannot find symbol if(x+y+z==k){ ^ symbol: variable z location: class Main 2 errors
s377990091
p03835
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int count = 0; for(int x=0; x<=k; x++){ for(int y=0; y<=k; y++){ z=s-x-y; if(x+y+z==k){ count++ } } } System.out.println(count); } }
Main.java:16: error: ';' expected count++ ^ 1 error
s148827132
p03835
Java
import java.util.*; public class Main(){ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int s = sc.nextInt(); int count = 0; for(int x=0; x<=k; x++){ for(int y=0; y<=k; y++){ for(int z=0; z<=k; z++){ if(x+y+z == s){ count++; } } } } System.out.println(count); } }
Main.java:3: error: '{' expected public class Main(){ ^ 1 error
s906518594
p03835
C++
#include<iostream> #include<algorithm> #include<math.h> #include<string> using namespace std; int main() { int K, S; cin K >> S; int i, j, k; int count = 0; for (i = 0; i <= K; ++i) { for (j = 0; j <= K; ++j) { for (k = 0; k <= K;++k) { if (i + j + k == S)++count; } } } cout << count << endl; return 0;
a.cc: In function 'int main()': a.cc:9:12: error: expected ';' before 'K' 9 | cin K >> S; | ^~ | ; a.cc:22:18: error: expected '}' at end of input 22 | return 0; | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s260901532
p03835
C++
#include<iostream> using namespace std; int main(){ int k,s;cin>>k>>s; int n=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)n++; // } int z=s-x-y; if(0<=x&&x<=k){ n++; } } } cout<<n<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: 'x' was not declared in this scope 12 | int z=s-x-y; | ^ a.cc:12:17: error: 'y' was not declared in this scope 12 | int z=s-x-y; | ^
s793757854
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; }
a.cc: In function 'int main()': a.cc:10:12: error: 's' was not declared in this scope 10 | if ( s - i - j >= 0 && s - i - j <= k){ | ^ a.cc:10:43: error: 'k' was not declared in this scope 10 | if ( s - i - j >= 0 && s - i - j <= k){ | ^
s631308049
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++ ){ for ( int k = 0; k <= K; k++ ){ if ( i + j + k == S ){ ans ++; break; } } if ( i + j > S ) break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:10: error: 'k' was not declared in this scope 6 | cin >> k >> s; | ^ a.cc:6:15: error: 's' was not declared in this scope 6 | cin >> k >> s; | ^
s996090471
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++ ){ for ( int k = 0; k <= K; k++ ){ if ( i + j + k == S ){ ans ++; breakl } } if ( i + j > S ) break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:10: error: 'k' was not declared in this scope 6 | cin >> k >> s; | ^ a.cc:6:15: error: 's' was not declared in this scope 6 | cin >> k >> s; | ^ a.cc:13:11: error: 'breakl' was not declared in this scope 13 | breakl | ^~~~~~
s436077368
p03835
C++
#include<iostream> 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 && z <= k) ans++; } } } cout << ans; }
a.cc:17:5: error: 'cout' does not name a type 17 | cout << ans; | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s825226843
p03835
C++
#include<iostream> 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 && z <= k) ans++; } } } } cout << ans; }
a.cc:16:5: error: expected declaration before '}' token 16 | } | ^ a.cc:18:5: error: 'cout' does not name a type 18 | cout << ans; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s965247602
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,s; cin>>k>>s; int ans=0; for(int x=0;x<=k;x++){ for(int y=0;y<=k;y++){ int z=s-x-y; if(z>=0&&z<=k)}{ ans++; } } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:21: error: expected primary-expression before '}' token 12 | if(z>=0&&z<=k)}{ | ^ a.cc: At global scope: a.cc:18:3: error: 'cout' does not name a type 18 | cout<<ans<<endl; | ^~~~ a.cc:20:3: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:22:1: error: expected declaration before '}' token 22 | } | ^
s754424610
p03835
Java
package zen; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class SumOfThree { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(" "); int max = Integer.parseInt(s[0]); int ans = Integer.parseInt(s[1]); int result = 0; for(int i=0; i<=max; i++) { for(int j=0; j<=max; j++) { int k = ans - (i + j); if(0 <= k && k <= ans) result++; } } System.out.println(result); } }
Main.java:7: error: class SumOfThree is public, should be declared in a file named SumOfThree.java public class SumOfThree { ^ 1 error
s615113652
p03835
Java
import java.util.*; public class SumOfThree { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int max = sc.nextInt(); int sumAns = sc.nextInt(); int result = countSumOfThree(max, sumAns); System.out.println(result); sc.close(); } public static int countSumOfThree(int max, int sumAns){ int count = 0; for(int i=0; i<=max; i++){ for(int j=0; j<=max; j++){ for(int k=0; k<=max; k++){ if(i+j+k == sumAns) count++; } } } return count; } }
Main.java:3: error: class SumOfThree is public, should be declared in a file named SumOfThree.java public class SumOfThree { ^ 1 error
s127645802
p03835
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <cstdlib> #include <thread> #include <chrono> #include <queue> using namespace std; int main(void){ int k = 0; int s = 0; cin >> k >> s; int counter = 0; for(int p=0;i<k;p++){ for(int q=0;j<k;q++){ for(int r=0;r<k;r++){ if(p+q+r==s){ counter++; } } } } cout << counter << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: 'i' was not declared in this scope 18 | for(int p=0;i<k;p++){ | ^ a.cc:19:29: error: 'j' was not declared in this scope 19 | for(int q=0;j<k;q++){ | ^
s587222116
p03835
C++
k, s = map(int, input().split(' ')) ans = 0 for x in range(k+1): for y in range(k+1): if -1 < (s - x - y) < k + 1: ans += 1 print(ans)
a.cc:1:1: error: 'k' does not name a type 1 | k, s = map(int, input().split(' ')) | ^
s528095636
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S,X=0,Y=0,Z=0,sunadatyan=0; cin>>K>>S; /*for(int i=0;i<=S;i++){ if(K*3==S){ cout<<1; break; } if(S/i<=K||S%i==0){ sunadatyan[i]=sunadatyan[i]+i; }//ここまででK以下の数字だよ*/ for(int i=0;i<=K;i++){ for(int ii=0;i<=K;i++){ for(int iii=0;i<=K){ if(i+ii+iii==S){ sunadatyan=sunadatyan+1; } } } } cout<<sunadatyan<<endl; }
a.cc: In function 'int main()': a.cc:16:43: error: expected ';' before ')' token 16 | for(int iii=0;i<=K){ | ^ | ;
s598418373
p03835
C++
#include<iostream> using namespace std; int main(){ int k,s; int cnt = 0; cin >> k >> s; for(int i = 0; i <= k; i++){ for(int j = 0; j <= k; j++){ if(s - i + j >=){ cnt++; } } } cout << cnt << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:12:28: error: expected primary-expression before ')' token 12 | if(s - i + j >=){ | ^
s580361820
p03835
C++
#include<iostream> using namespace std; int main(){ int k,s; int cnt = 0; for(int i = 0; i <= k; i++){ for(int j = 0; j <= k; j++){ if(s - i + j >=){ cnt++; } } } cin >> cnt >> s; return 0; }
a.cc: In function 'int main()': a.cc:10:28: error: expected primary-expression before ')' token 10 | if(s - i + j >=){ | ^
s560519806
p03835
C
#include<cstdio> int main(){ int K,S,p=0; scanf("%d%d",&K,&S); for(int i=0;i<=K;i++)for(int n=0;n<=K;n++)for(int j=0;j<=K;j++){if(i+n+j==S)p++;}printf("%d",p);return 0;}
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s126338718
p03835
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; int k,s; int main(){ cin >> k >> s; int count = 0; for(int i = 0; i <= k; i++){ for(int j = 0; j <= k; j++){ int l = s - i - j; if(0 <= l && l <= k) count++; } } } cout << count << endl; }
a.cc:18:5: error: 'cout' does not name a type 18 | cout << count << endl; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s958469782
p03835
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; int k,s; int main(){ cin >> k >> s; int count = 0; for(int i = 0; i < k; i++){ for(int j = 0; j < k; j++){ for( l = 0; l < k; l++){ if(i + j + l == s) count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:13:18: error: 'l' was not declared in this scope 13 | for( l = 0; l < k; l++){ | ^
s054217339
p03835
C++
#include <iostream> using namespace std; int K,S; int main(){ cin >> K >> S; int ans = 0; for(int i=0;i<=K;i++){ for(int j=0;j<=K;j++){ if(0<=S-i-j && S-i-j-<=K) ans++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:28: error: expected primary-expression before '<=' token 10 | if(0<=S-i-j && S-i-j-<=K) ans++; | ^~
s814408051
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 l=0;l<=K;l++) { if(S-l-i<=K) 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 | } | ^
s839661261
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){ if(S-x<K){ Y=S-x; }else{ Y=K; } for(int y=0;y<=Y;++y){ if(S-x-y<K){ Z=S-x-y; }else{ Z=K; } for(int z=0;z<=Z;++z){ if(x+y+z==S){ ans += 1; break; } } } } cout << ans; }
a.cc: In function 'int main()': a.cc:13:25: error: 'Y' was not declared in this scope 13 | Y=S-x; | ^ a.cc:15:25: error: 'Y' was not declared in this scope 15 | Y=K; | ^ a.cc:17:32: error: 'Y' was not declared in this scope 17 | for(int y=0;y<=Y;++y){ | ^ a.cc:19:33: error: 'Z' was not declared in this scope 19 | Z=S-x-y; | ^ a.cc:21:33: error: 'Z' was not declared in this scope 21 | Z=K; | ^ a.cc:23:40: error: 'Z' was not declared in this scope 23 | for(int z=0;z<=Z;++z){ | ^
s442856245
p03835
C++
#include <iostream> using namespace std; int main() { int k, s; cin >> k >> s; int num = 0; for (int i = 0; i <= k; i++) { for (int j = i; j <= k; j++) { for (int u = j; u <= k; u++) { if (i + j + u == s) { if ((j == u && i != j) || (i == j && i != u)) { num += 3; cout << i << j << u << endl; } else if (i == j && i == u) { num += 1; cout << i << j << u << endl; } else { num += 6; } } } } } cout << num << endl;
a.cc: In function 'int main()': a.cc:29:25: error: expected '}' at end of input 29 | cout << num << endl; | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s079823279
p03835
C++
#include<iostream> using namespace std; int main() { int K, S; cin >> K >> S; int score = 0; for(int a = 0; a <= 3*K; ++a){ for(int b = 0; b <= 3*K; ++b){ int c = S - a - b; if(0 <= c and z <= K) ++score; } } cout << score << endl; }
a.cc: In function 'int main()': a.cc:10:21: error: 'z' was not declared in this scope 10 | if(0 <= c and z <= K) ++score; | ^
s336502691
p03835
C++
#include<iostream> using namespace std; int main() { int K, S; cin >> K >> S; int score = 0; for(int a = 0; a <= 3*K; ++a){ for(int b = 0; b <= 3*K; ++b){ int c = S - x - y; if(0 <= c and z <= K) ++score; } } cout << score << endl; }
a.cc: In function 'int main()': a.cc:9:19: error: 'x' was not declared in this scope 9 | int c = S - x - y; | ^ a.cc:9:23: error: 'y' was not declared in this scope 9 | int c = S - x - y; | ^ a.cc:10:21: error: 'z' was not declared in this scope 10 | if(0 <= c and z <= K) ++score; | ^
s749090657
p03835
C++
#include<cstdio> #include<cmath> #include<cstring> #include<string> #include <cstring> #include <iostream> #include <algprithm> using namespace std; int main() { int K,S,X,Y,Z,ans,cnt = 0; scanf("%d%d",&K,&S); for(X = 0; X <= K; X++) for(Y = 0; Y <= K; Y++) { ans = S - X - Y; if(ans >= 0 && ans <= K) cnt++; } printf("%d\n",cnt); return 0; }
a.cc:7:10: fatal error: algprithm: No such file or directory 7 | #include <algprithm> | ^~~~~~~~~~~ compilation terminated.
s439370900
p03835
C++
Home Problem Status Contest User Group Forum Article Logout Martha Begin: 2018-09-22 14:30 CST 西南民族大学2018年新生题目1 End: 2018-11-11 14:30 CST 364:51:13 Elapsed: 364:51:13 Running Remaining: 835:08:46 Overview Problem Status Rank (364:51:12) 0 Comments Previous 1 2 3 4 5 … Next Run ID Username Prob Result Time (ms) Mem (MB) Length Lang Submit Time 16302798 Martha T Time Limit Exceeded 307 C++ 20 hr ago All Copyright Reserved ©2018 Xu Han Server Time: 2018-10-07 19:21:13 CST #16302798 | Martha's solution for [Problem T] Status Time Limit Exceeded Length 307 Lang C++14 (GCC 5.3.0) Submitted 2018-10-06 23:16:33 Shared 7.0 / 10.0 Select Code #include<cstdio> #include<cmath> #include<cstring> #include<string> using namespace std; char a[20]; int main() { int K,S,X,Y,Z,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++; } printf("%d\n",cnt); return 0; } Preview:
a.cc:14:13: error: invalid digit "9" in octal constant 14 | Begin: 2018-09-22 14:30 CST | ^~ a.cc:20:16: error: invalid digit "8" in octal constant 20 | Remaining: 835:08:46 | ^~ a.cc:34:5: error: extended character … is not valid in an identifier 34 | … | ^ a.cc:54:24: error: extended character © is not valid in an identifier 54 | All Copyright Reserved ©2018 Xu Han | ^ a.cc:56:11: error: "|" is not a valid filename 56 | #16302798 | Martha's solution for [Problem T] | ^ a.cc:56:19: warning: missing terminating ' character 56 | #16302798 | Martha's solution for [Problem T] | ^ a.cc:62:20: error: too many decimal points in number 62 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:2:1: error: 'Home' does not name a type 2 | Home | ^~~~ In file included from /usr/include/c++/14/cmath:45, from a.cc:71: /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' 164 | __is_null_pointer(std::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, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::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)> | ^~~~~~ In file included from /usr/include/stdio.h:34, from /usr/include/c++/14/cstdio:42, from a.cc:70: /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_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does no
s151865434
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); int S = scan.nextInt(); int a; int b; int x; int cnt = 0; int Z; for (a = 0; a <= K; x++) { if (S - x < K) Z = S-x; for (b = 0; b <= Z; b++) { if (S - a - b <= K) cnt++; } } System.out.println(cnt); } }
Main.java:15: error: variable x might not have been initialized if (S - x < K) Z = S-x; ^ Main.java:17: error: variable Z might not have been initialized for (b = 0; b <= Z; b++) { ^ 2 errors
s408098703
p03835
C++
#include<iostream> using namespace std; int main(){ int K, S; cin >> K >> S; int i, j, k, /*count=0;*/count1=0, count3=0, count6=0; for(i=0; i<=K; i++){ for(j=i; j<=K; j++){ for(k=j; k<=K; k++){ // cout << i << j << k << endl; if(i+j+k==S){ count++; if(i==j && j==k) count1++; else if(i==j || j==k) count3++; else count6++; } } } } // cout << count << endl; cout << count1 + 3*count3 + 6*count6 << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:41: error: 'count' was not declared in this scope; did you mean 'count6'? 14 | count++; | ^~~~~ | count6
s948719553
p03835
C++
#include <iostream> #include <vector> using namespace std; int main() { int K,S; cin>>K>>S; int count=0; for(int X=0;X<=K;++X){ for(int Y=0;Y<=K;++Y){ int Z=S-X-Y; if(0<=Z && Z<=K) ++count } } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:14:16: error: expected ';' before '}' token 14 | ++count | ^ | ; 15 | } | ~
s743388820
p03835
C++
#include <iostream> #include <vector> 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:13:15: error: lvalue required as left operand of assignment 13 | if(X+Y+Z=S) | ~~~^~
s360069543
p03835
C++
#include "bits/stdc++.h" #define rep(i,a,n) for(int i = (a);i < (n);i++) typedef long long ll; typedef unsigned long long ull; using namespace std; int main(){ int k,s,cnt = 0; cin >> a >> b >> c; rep(i,0,k){ rep(j,0,k){ rep(j,0,k){ if(i+j+k == s){ cnt++; } } } } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:16: error: 'a' was not declared in this scope 10 | cin >> a >> b >> c; | ^ a.cc:10:21: error: 'b' was not declared in this scope 10 | cin >> a >> b >> c; | ^ a.cc:10:26: error: 'c' was not declared in this scope 10 | cin >> a >> b >> c; | ^
s725838523
p03835
C++
#include <iostream> int main() { int K, S; std::cin >> K >> S; int cnt = 0; for (int i = 0; i <= K; ++i) { for (int j = 0; j <= K; ++j) { int k = S - i - j; if ( 0 <= z && z <= K ) ++cnt; } } std::cout << cnt << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'z' was not declared in this scope 11 | if ( 0 <= z && z <= K ) ++cnt; | ^
s001511841
p03835
C++
#include <iostream> using namespace std; int main(){ int k=0, s=0; cin >> k >> s; int counter=0; int x=0,y=0,z=0; for(int i=0; i<=k; ++i){ for(int j=i; j<=k; ++j){ x = i;s y = j; z = k - x - y; if(z>=0) ++counter; } } cout << counter << endl; }
a.cc: In function 'int main()': a.cc:12:20: error: expected ';' before 'y' 12 | x = i;s | ^ | ; 13 | y = j; | ~
s995311530
p03835
C++
#include <iostream> using namespace std; int main(){ int k=0, s=0; cin >> k >> s; int counter=0; int x=0,y=0,z=0; for(int j=0; j<k; ++j){ for(int i=0; i<k; ++i){ x = i; y = j; z = s - i - j; if(z >= 0) ++counter; } } cout << counter-1 << endl;
a.cc: In function 'int main()': a.cc:19:31: error: expected '}' at end of input 19 | cout << counter-1 << endl; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s109176978
p03835
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(n);i++) const int MOD=(int)1e9+7; using namespace std; int main(){ int S,K; int ans; cin >> K >> S; for(x,K+1){ for(y,K+1){ int z = S - x - y; if(z>=0 && z <= K){ ans++; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'x' was not declared in this scope 9 | for(x,K+1){ | ^ a.cc:18:1: error: expected primary-expression before '}' token 18 | } | ^ a.cc:17:25: error: expected ')' before '}' token 17 | cout << ans << endl; | ^ | ) 18 | } | ~ a.cc:9:8: note: to match this '(' 9 | for(x,K+1){ | ^ a.cc:18:1: error: expected primary-expression before '}' token 18 | } | ^
s711651003
p03835
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(n);i++) const int MOD=(int)1e9+7; using namespace std; int main(){ int S,K; int ans; cin >> K >> S; for(x,K+1){ for(y,K+1){ for(z,K+1){ if((x+y+z) == S){ ans++; } } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'x' was not declared in this scope 9 | for(x,K+1){ | ^ a.cc:19:1: error: expected primary-expression before '}' token 19 | } | ^ a.cc:18:25: error: expected ')' before '}' token 18 | cout << ans << endl; | ^ | ) 19 | } | ~ a.cc:9:8: note: to match this '(' 9 | for(x,K+1){ | ^ a.cc:19:1: error: expected primary-expression before '}' token 19 | } | ^
s620401675
p03835
C++
ソースコード Copy Copy #include <iostream> int main(void) { int k, s; std::cin >> k; std::cin >> 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++; } } } std::cout << count << std::endl; return 0; }
a.cc:1:1: error: '\U000030bd\U000030fc\U000030b9\U000030b3\U000030fc\U000030c9' does not name a type 1 | ソースコード | ^~~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:5: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /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) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /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 initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /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:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /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:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not
s516985689
p03835
C++
ソースコード Copy Copy #include <iostream> int main(void) { int k, s; std::cin >> k; std::cin >> 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++; } } } std::cout << count << std::endl; return 0; }
a.cc:1:1: error: '\U000030bd\U000030fc\U000030b9\U000030b3\U000030fc\U000030c9' does not name a type 1 | ソースコード | ^~~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:5: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /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) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /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 initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /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:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /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:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not
s732175075
p03835
C++
ソースコード Copy Copy #include <iostream> int main(void) { int k, s; std::cin >> k; std::cin >> 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++; } } } std::cout << count << std::endl; return 0; }
a.cc:1:1: error: '\U000030bd\U000030fc\U000030b9\U000030b3\U000030fc\U000030c9' does not name a type 1 | ソースコード | ^~~~~~~~~~~~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:5: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /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) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /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 initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /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:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /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:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /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:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /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:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not
s008866859
p03835
C++
#include <iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> using namespace std; int main() { ll K, S; cin >> K >> S; ll cnt = 0; for (ll x = 0; x <= K; ++x) { for (ll y = 0; y <= K; ++y) { ll z = S - x - y; if (z >= 0 && z <= K) ++cnt; } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'll' was not declared in this scope 8 | ll K, S; | ^~ a.cc:9:16: error: 'K' was not declared in this scope 9 | cin >> K >> S; | ^ a.cc:9:21: error: 'S' was not declared in this scope 9 | cin >> K >> S; | ^ a.cc:10:11: error: expected ';' before 'cnt' 10 | ll cnt = 0; | ^~~~ | ; a.cc:11:16: error: expected ';' before 'x' 11 | for (ll x = 0; x <= K; ++x) { | ^~ | ; a.cc:11:24: error: 'x' was not declared in this scope 11 | for (ll x = 0; x <= K; ++x) { | ^ a.cc:12:24: error: expected ';' before 'y' 12 | for (ll y = 0; y <= K; ++y) { | ^~ | ; a.cc:12:32: error: 'y' was not declared in this scope; did you mean 'yn'? 12 | for (ll y = 0; y <= K; ++y) { | ^ | yn a.cc:13:27: error: expected ';' before 'z' 13 | ll z = S - x - y; | ^~ | ; a.cc:14:29: error: 'z' was not declared in this scope 14 | if (z >= 0 && z <= K) ++cnt; | ^ a.cc:14:49: error: 'cnt' was not declared in this scope; did you mean 'int'? 14 | if (z >= 0 && z <= K) ++cnt; | ^~~ | int a.cc:17:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 17 | cout << cnt << endl; | ^~~ | int
s675157381
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K,S; cin >> K >> S; int x,y,z,a; a=0; for(x=0;x<=K;x++){ for(y=0;y<=K;y++){ for(z=0;z<=K;z++){ if(x+y+z==S){ a++;} } } } cout << a << endl;
a.cc: In function 'int main()': a.cc:17:21: error: expected '}' at end of input 17 | cout << a << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s445948616
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,s; cin >> n >> s; int count = 0; for(int i=0;i<=n;i++) { for(int j=0;j<=n;j++) { int temp = s-i-j; if(temp >= 0 && temp <= k) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:18:37: error: 'k' was not declared in this scope 18 | if(temp >= 0 && temp <= k) | ^
s114214761
p03835
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; typedef long long lng; #define FOR(i,a,b) for(int i=(a); i<=(b); ++i) #define FORD(i,b,a) for(int i=(b); i>=(a); --i) #define REP(i,n) FOR(i,0,n-1) #define ALL(a) (a).begin(), (a).end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) //ATTENTION: <a> must be sorted in advance lng power(lng b, lng n) {lng sol=1; while(n>0) {if(n&1) {sol=sol*b;} n>>=1; b*= b;} return sol;} //calculate b^n const int MOD = 1000000007; //10^9+7 /*********** variables ************/ /**********************************/ int main() { cin.tie(0); ios::sync_with_stdio(false); int K, S; cin >> K >> S; REP(i, K+1) REP(j, K+1) REP(k, K+1) { if(i+j+k==S) cnt++; } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:28:22: error: 'cnt' was not declared in this scope; did you mean 'int'? 28 | if(i+j+k==S) cnt++; | ^~~ | int a.cc:30:13: error: 'cnt' was not declared in this scope; did you mean 'int'? 30 | cout << cnt << endl; | ^~~ | int
s846895792
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int N = 0; for (int i = 0; i <= K; i++) { for (int j = 0; j <= K; j++) { { if(i + j <= S && i + j + K >= S) N ++; } } cout << N << 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() { | ^
s392180146
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; N = 0; for (int i = 0; i <= K-1; i++) { for (int j = 0; j <= K-1; j++) { for (int k = 0; k <= K-1; k++) { if(i + j + k == S) N ++; } } } cout << N << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'N' was not declared in this scope 7 | N = 0; | ^
s783595702
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+1; i++) { for(int j=0; j<K+1; j++) { if(s-(i+j) <= k) count++; } } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:23: error: 'k' was not declared in this scope 13 | if(s-(i+j) <= k) | ^
s748871824
p03835
C
#include <stdio.h> int main(){ int k,s; int x,y,z; int count; scanf("%d%d", &k, &s); for(x = 0; x <= k; x++){ for(y = 0; y <= k; y++){ z = s - x - y; if(0 <= z && z <= k)count++; } printf("%d", count); return 0; }
main.c: In function 'main': main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
s188231644
p03835
C++
#include <iostream> using namespace std; int main() { int K; int S; int cnt; int Y; int Z; cin >> K >> S; for (int i = 0 ; i < K+1 ; ++i ){ for ( int j = 0 ; i < K+1 ; ++i ){ Y = S - i - j; if ( Y >= 0 && Y <= K){ ++cnt; } } } cout << cnt << endl;
a.cc: In function 'int main()': a.cc:17:23: error: expected '}' at end of input 17 | cout << cnt << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s565568688
p03835
C++
#include <iosteram> using namespace std; int main() { int K; int S; int cnt; int Y; int Z; cin >> K >> S; for (int i = 0 ; i < K+1 ; ++i ){ for ( int j = 0 ; i < K+1 ; ++i ){ Y = S - i - j; if ( Y >= 0 && Y <= K){ ++cnt; } } } cout << cnt << endl;
a.cc:1:10: fatal error: iosteram: No such file or directory 1 | #include <iosteram> | ^~~~~~~~~~ compilation terminated.
s734805279
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ int z = S-x-y; if (z>=0&&z<=k) ++res; } } cout << res <<endl; }
a.cc: In function 'int main()': a.cc:12:14: error: 'k' was not declared in this scope 12 | if (z>=0&&z<=k) ++res; | ^
s189558525
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ int z = S-x-y; if (total==K) ++res; } } cout << res <<endl; }
a.cc: In function 'int main()': a.cc:12:5: error: 'total' was not declared in this scope 12 | if (total==K) ++res; | ^~~~~
s107276065
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ int z = S - x - y; if (0<=z&& z<=k) ++res; } } }
a.cc: In function 'int main()': a.cc:12:15: error: 'k' was not declared in this scope 12 | if (0<=z&& z<=k) ++res; | ^
s452198594
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ for(int z=0; z <= K; ++z){ int total = x + y + z if (total==K) ++res; } } } cout << res <<endl; }
a.cc: In function 'int main()': a.cc:13:1: error: expected ',' or ';' before 'if' 13 | if (total==K) ++res; | ^~
s950854592
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ for(int z=0; z <= K; ++z){ int total = x + y + z; if (total==X) ++res; } } } cout << res <<endl; }
a.cc: In function 'int main()': a.cc:13:12: error: 'X' was not declared in this scope 13 | if (total==X) ++res; | ^
s561868912
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ for(int z=0; z <= K; ++z){ int total = x + y + z; if (total==S) ++res; } } } cout << res <<endl; } #include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ for(int z=0; z <= K; ++z){ int total = x + y + z; if (total==S) ++res; } } } cout << res <<endl; }
a.cc:23:5: error: redefinition of 'int main()' 23 | int main(){ | ^~~~ a.cc:4:9: note: 'int main()' previously defined here 4 | int main(){ | ^~~~
s940265853
p03835
C++
#include <iostream> using namespace std; int main(){ int K,S; cin>>K>>S; int res=0; for(int x=0; x <= K; ++x){ for(int y=0; y <= K; ++y){ for(int z=0; z <= K; ++z){ int total = x + y + z; if (total==S) ++res; } }
a.cc: In function 'int main()': a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:9:26: note: to match this '{' 9 | for(int x=0; x <= K; ++x){ | ^ a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s963775474
p03835
C++
#include < bits/stdc++.h> using namespace std; int main() { int k,s,count; cin>>k>>s; 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; return 0; }
a.cc:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include < bits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s536112614
p03835
C++
#include <iostream> using namespace std; int main(){ int x,y,z,k,s; int as = 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 and z <= k;){ as = as + 1; } } } cout << as << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:26: error: expected primary-expression before ')' token 11 | if(0 <= z and z <= k;){ | ^
s191082249
p03835
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main() { int i,j,k,s,x,y,z; int counter = 0; cin >> k >> s; for(x = 0; x <= k;x++) { for(y = 0;y <= k; y++){ z = s - x - y; if(z => 0 && z <= k) { counter++; } } } cout << counter << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:19: error: expected primary-expression before '>' token 18 | if(z => 0 && z <= k) { | ^
s318893450
p03835
C++
#include<iostream> using namespace std; int main() { int K, S; cin >> K >> S; int res = 0; for (int x = 0; x <= K; ++x) { for (int y = 0; y <= K; ++y) { int z = S - x - y; if (0 <= z && z <= K) ++res; } } } cout << res << endl; return 0; }
a.cc:18:3: error: 'cout' does not name a type 18 | cout << res << endl; | ^~~~ a.cc:20:3: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:22:1: error: expected declaration before '}' token 22 | } | ^
s199014041
p03835
C++
#include<iostream> using namespace std; int main() { int K, S; cin >> K >> S; int res = 0; for (int x = 0; x <= K; ++x) { for (int y = 0; y <= K; ++y) { int z = S - x - y; if (0 <= Z && Z <= K) ++res; } } } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:18: error: 'Z' was not declared in this scope 13 | if (0 <= Z && Z <= K) ++res; | ^ a.cc: At global scope: a.cc:18:3: error: 'cout' does not name a type 18 | cout << res << endl; | ^~~~ a.cc:20:3: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:22:1: error: expected declaration before '}' token 22 | } | ^
s145847752
p03835
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> using namespace std; int main (void) { int k, s; cin >> k >> s; int ans=0; for (int i=0; i<=N-1; i++) { for (int j=0; j<=N-1; j++) { for (int k=0; k<=N-1; k++) { if (i+j+k == s) ans= ans+1; } } } cout << ans; }
a.cc: In function 'int main()': a.cc:11:20: error: 'N' was not declared in this scope 11 | for (int i=0; i<=N-1; i++) { | ^
s964490840
p03835
C++
#include <iostream> using namespace std; int main(){ int X, Y, Z, K, S; cin >> K >> S; int ans = 0; for (int X = 0; X <= K; ++X){ for (int Y = 0; Y <= K; ++Y){ Z = S - X - Y; if(0 <= Z <= K) ++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 | } | ^
s559026203
p03835
Java
package atc1; import java.util.*; public class main { public static void main(String args) { int cnt = 0; Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int S = sc.nextInt(); 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) { cnt++; } } } } System.out.println(cnt); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s744801195
p03835
Java
package spring; import java.util.*; public class B_51 { public static void main(String args) { int cnt = 0; Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int S = sc.nextInt(); 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) { cnt++; } } } } System.out.println(cnt); } }
Main.java:3: error: class B_51 is public, should be declared in a file named B_51.java public class B_51 { ^ 1 error
s013250922
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int S = sc.nextInt(); int counter = 0; for(int i = 0;i <= K;i++){ for(int j = 0;j <= K;j++){ if(S-i-j >=0 && S-i-j <= K)counter++; } } } System.out.println(counter); }}
Main.java:14: error: <identifier> expected System.out.println(counter); ^ Main.java:14: error: <identifier> expected System.out.println(counter); ^ Main.java:15: error: class, interface, enum, or record expected }} ^ 3 errors
s845723904
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int i,j,x,y,z,k,s,; cin>>k>>s; int ans=0; for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ if(s-i-j<=k&&0<=s-i-j){ ans++; } } } return 0; }
a.cc: In function 'int main()': a.cc:4:27: error: expected unqualified-id before ';' token 4 | int i,j,x,y,z,k,s,; | ^
s546281756
p03835
Java
import java.util.*; public static void main(String[] atgs) { Scanner scan = new Scanner(System.in); int ans = 0; int K = scan.nextInt(); int S = scan.nextInt(); 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; } } } System.out.println(ans); scan.close(); }
Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] atgs) { ^ (use --enable-preview to enable unnamed classes) 1 error
s482464038
p03835
Java
import java.util.*; public class at51B { public static void main(String[] atgs) { Scanner scan = new Scanner(System.in); int ans = 0; int K = scan.nextInt(); int S = scan.nextInt(); 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; } } } System.out.println(ans); scan.close(); } }
Main.java:2: error: class at51B is public, should be declared in a file named at51B.java public class at51B { ^ 1 error
s977647227
p03835
C++
#include <iostream> using namespace std; int main(){ int K, S; cin >> K >> S; for(int X=0;X<=K;X++){ for(int Y=0;Y<=K;Y++){ if(S-X-Y<=K&&S-X-Y>=0) a++; } } cout << a ; }
a.cc: In function 'int main()': a.cc:10:48: error: 'a' was not declared in this scope 10 | if(S-X-Y<=K&&S-X-Y>=0) a++; | ^ a.cc:13:17: error: 'a' was not declared in this scope 13 | cout << a ; | ^
s981013134
p03835
C++
#include <bits/stdc++.h> // #include "bits/stdc++.h" #define pout(n) printf ("%d\n", n) #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) typedef long long ll; using namespace std; int main (){ int k,s,count = 0; cin >> k >> s; rep(i,0,k+1){ rep(j,0,k+1){ int z = s-x-j; if(0 < z && z <= k) count++; } } } pout(count); return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'x' was not declared in this scope 18 | int z = s-x-j; | ^ a.cc: At global scope: a.cc:4:25: error: expected constructor, destructor, or type conversion before '(' token 4 | #define pout(n) printf ("%d\n", n) | ^ a.cc:24:3: note: in expansion of macro 'pout' 24 | pout(count); | ^~~~ a.cc:25:3: error: expected unqualified-id before 'return' 25 | return 0; | ^~~~~~ a.cc:26:1: error: expected declaration before '}' token 26 | } | ^
s065253641
p03835
C++
#include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #define INF 1000000007 using namespace std; int main(){ int K,S; scanf("%d %d",&K,&S); int cnt=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) cnt++; } } printf("%d\n",cnt); return 0; }
a.cc: In function 'int main()': a.cc:14:19: error: 'k' was not declared in this scope 14 | if(0<=z&&z<=k) cnt++; | ^
s667152666
p03835
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <numeric> #include <string> using namespace std; const double PI = acos(-1.0); const string alp = "abcdefghijklmnopqrstuvwxyz"; const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main(void) { int k,s,t,l; cin >> k >> s; t = 0; vector<int> v; if (s==0) { t = 1; } else if (s==1) { t = 3; } else { REP(i,k+1){ l=s-i; if (l==0) { if (2*k>l && l>k) { t += l + 1; if (l>k) { t -= 2 * (l - k) } } } } } cout << t; }
a.cc: In function 'int main()': a.cc:33:41: error: expected ';' before '}' token 33 | t -= 2 * (l - k) | ^ | ; 34 | } | ~
s631357480
p03835
Java
#include <bits/stdc++.h> using namespace std; #define int long long int K, S, ans = 0; signed main() { cin >> K >> S; for (int i = 0; i <= K; i++) { for (int j = 0; j <= K; j++) { if (S >= i + j && S - i - j <= K) { ans++; } } } cout << ans << endl; return 0; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:4: error: illegal character: '#' #define int long long ^ Main.java:4: error: class, interface, enum, or record expected #define int long long ^ Main.java:9: error: not a statement cin >> K >> S; ^ Main.java:17: error: not a statement cout << ans << endl; ^ Main.java:8: error: unnamed classes are a preview feature and are disabled by default. signed main() { ^ (use --enable-preview to enable unnamed classes) 7 errors
s058067910
p03835
C++
#include <bits//stdc++.h> using namespace std; int main(void){ int k,s; cin >> k >> s; for(int i=0;i<=k;i++){ for(int z=0;z<=k;z++){ if(k-i-j<=0&&k-i-j<=k){ count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:20: error: 'j' was not declared in this scope 8 | if(k-i-j<=0&&k-i-j<=k){ | ^ a.cc:9:22: error: no post-increment operator for type 9 | count++; | ^~ a.cc:13:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 13 | cout << count << endl; | ~~~~~^~~~~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate
s588902029
p03835
C++
#include <iostream> using namespace std; #define PrintLn(X) cout << X << endl #define Rep(i, n) for(int i = 0; i < (int)(n); ++i) int main(void) { int K, S; cin >> K >> S; int ans++; Rep(X, K + 1){ Rep(Y, K + 1){ int Z = S - X - Y; if(0 <= Z && Z <= K){ ans++; } } } PrintLn(ans); }
a.cc: In function 'int main()': a.cc:11:16: error: expected initializer before '++' token 11 | int ans++; | ^~ a.cc:16:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | ans++; | ^~~ | abs a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | PrintLn(ans); | ^~~ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^
s243371731
p03835
C++
#include <iostream> using namespace std; #define PrintLn(X) cout << X << endl #define Rep(i, n) for(int i = 0; i < (int)(n); ++i) int main(void) { int K, S; cin >> K >> S; int ans++; Rep(X, K + 1){ Rep(Y, K + 1){ Z = S - X - Y; if(0 <= Z && Z <= K){ ans++; } } } PrintLn(ans); }
a.cc: In function 'int main()': a.cc:11:16: error: expected initializer before '++' token 11 | int ans++; | ^~ a.cc:14:25: error: 'Z' was not declared in this scope 14 | Z = S - X - Y; | ^ a.cc:16:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | ans++; | ^~~ | abs a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | PrintLn(ans); | ^~~ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^
s598305253
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(sc.next()); int s = Integer.parseInt(sc.next()); int ans = 0; for(int x = 0;x <= k;x++){ for(int y = 0; y <= k; y++){ int z = S - x + y; if(z <= 0 && z <= k) ans++; } } System.out.println(ans); } }
Main.java:10: error: cannot find symbol int z = S - x + y; ^ symbol: variable S location: class Main 1 error
s344853312
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(sc.next()); int s = Integer.parseInt(sc.next()); int ans = 0; for(int x = 0;x <= k;x++){ for(int y = 0; y <= k; y++){ if(z <= 0 && z <= k) ans++; } } System.out.println(ans); } }
Main.java:10: error: cannot find symbol if(z <= 0 && z <= k) ans++; ^ symbol: variable z location: class Main Main.java:10: error: cannot find symbol if(z <= 0 && z <= k) ans++; ^ symbol: variable z location: class Main 2 errors
s575203992
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.next(); int s = sc.next(); int ans = 0; for(int x = 0;x <= k;x++){ for(int y = 0; y <= k; y++){ if(z <= 0 && z <= k) ans++; } } System.out.println(ans); } }
Main.java:5: error: incompatible types: String cannot be converted to int int k = sc.next(); ^ Main.java:6: error: incompatible types: String cannot be converted to int int s = sc.next(); ^ Main.java:10: error: cannot find symbol if(z <= 0 && z <= k) ans++; ^ symbol: variable z location: class Main Main.java:10: error: cannot find symbol if(z <= 0 && z <= k) ans++; ^ symbol: variable z location: class Main 4 errors
s363623916
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.next(); int s = sc.next(); 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++; } } } System.out.println(ans); } }
Main.java:5: error: incompatible types: String cannot be converted to int int k = sc.next(); ^ Main.java:6: error: incompatible types: String cannot be converted to int int s = sc.next(); ^ 2 errors
s127109451
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = in.next(); int s = in.next(); 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++; } } } System.out.println(ans); } }
Main.java:5: error: cannot find symbol int k = in.next(); ^ symbol: variable in location: class Main Main.java:6: error: cannot find symbol int s = in.next(); ^ symbol: variable in location: class Main 2 errors
s895111286
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = in.next()); int s = in.next()); 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++; } } } System.out.println(ans); } }
Main.java:5: error: ';' expected int k = in.next()); ^ Main.java:6: error: ';' expected int s = in.next()); ^ 2 errors
s315114983
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(in.next()); int s = Integer.parseInt(in.next()); 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++; } } } System.out.println(ans); } }
Main.java:5: error: cannot find symbol int k = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main Main.java:6: error: cannot find symbol int s = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main 2 errors
s500361673
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { scanner sc = new Scanner(System.in); int k = Integer.parseInt(in.next()); int s = Integer.parseInt(in.next()); 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++; } } } System.out.println(ans); } }
Main.java:4: error: cannot find symbol scanner sc = new Scanner(System.in); ^ symbol: class scanner location: class Main Main.java:5: error: cannot find symbol int k = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main Main.java:6: error: cannot find symbol int s = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main 3 errors
s757443122
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { canner sc = new Scanner(System.in); int k = Integer.parseInt(in.next()); int s = Integer.parseInt(in.next()); 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++; } } } System.out.println(ans); } }
Main.java:4: error: cannot find symbol canner sc = new Scanner(System.in); ^ symbol: class canner location: class Main Main.java:5: error: cannot find symbol int k = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main Main.java:6: error: cannot find symbol int s = Integer.parseInt(in.next()); ^ symbol: variable in location: class Main 3 errors
s481315224
p03835
C
#include <stdio.h> int main(){ int k=0,s=0; int ans=0; scanf("%d %d",&k,&s); for(int x=0;x<=k;x++){ for(int y=0;y<=k;y++){ if(s - x - y<=k and s - x - y>=0)ans++; } } printf("%d\n",ans); }
main.c: In function 'main': main.c:8:40: error: expected ')' before 'and' 8 | if(s - x - y<=k and s - x - y>=0)ans++; | ~ ^~~~ | )
s571495483
p03835
Java
package 自習用; import java.util.*; public class AtCoder_51_B { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int K = sc.nextInt(); final int S = sc.nextInt(); int counter = 0; for( int i = 0; i <= K; i++){ int sum_i = i; if( sum_i == S ){ counter++; continue; } for( int j = 0; j <= K; j++){ int sum_j = sum_i + j; if( sum_j == S ){ counter++; continue; } for( int k = 0; k <= K; k++){ int sum_k = sum_j + k; if( sum_k == S ){ counter++; continue; } } } } System.out.println(counter); } }
Main.java:4: error: class AtCoder_51_B is public, should be declared in a file named AtCoder_51_B.java public class AtCoder_51_B { ^ 1 error
s839957799
p03835
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int b = scan.nextInt(); int a = scan.nextInt(); int ans=0; for(int i=0;i<=b;i++){ for(int n=0;n<=b;n++){ int f= a-i-n; if(f<=b&&f>=0){ ans++; } } } System.out.println(ans); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s015999855
p03835
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #define WMAX 10000 #define HMAX 10000 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } typedef pair<int ,int > P; typedef long long ll; int K,S,ans = 0,X = Y = Z = 0; static const int dx[8] = {0,1,1,1,0,-1,-1,-1}, dy[8] = {1,1,0,-1,-1,-1,0,1}; void solve(){ } void debug(){ } void answer(){ cout << ans << "\n"; } int main(){ cin >> K >> S; for (int X = 0; X <= K; ++X) { for (int Y = 0; Y <= K; ++Y) { if(S-X-Y <= K && S-X-Y < 0){ ans++; } } } answer(); return 0; }
a.cc:28:21: error: 'Y' was not declared in this scope 28 | int K,S,ans = 0,X = Y = Z = 0; | ^ a.cc:28:25: error: 'Z' was not declared in this scope 28 | int K,S,ans = 0,X = Y = Z = 0; | ^
s076700016
p03835
Java
import java.util.*; public class SumofThreeIntegers { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int K=s.nextInt(); int S=s.nextInt(); int count=6; int i=0,j=0,k=0; for(i=1;i<=K;i++){ for(j=1;j<=K;j++){ for(k=1;k<=K;k++){ if(i+j+k==S)count++; } } } System.out.print(count); } }
Main.java:3: error: class SumofThreeIntegers is public, should be declared in a file named SumofThreeIntegers.java public class SumofThreeIntegers { ^ 1 error
s371947524
p03835
C++
# -*- coding: utf-8 -*- def main(): k, s = map(int, input().split()) answer = solve(k, s) return answer def solve(k, s): count = 0 for i in range(k + 1): v = 0 v += i if v == s: count += 1 continue for j in range(k + 1): v += j if v == s: count += 1 continue for k in range(k + 1): v += k if v == s: count += 1 continue return count print(main())
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:4:1: error: 'def' does not name a type 4 | def main(): | ^~~