submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s428787562
p03835
C++
#include<bits/stc++.h> using namespace std; int K, S; int main () { cin >> K >> S; int count = 0; for (int x = 0; x <= K; x++){ for (int y = 0; y <= K; y++){ if (((S-x-y) <= K) && ((S-x-y) >= 0) { count++; } } } }
a.cc:1:9: fatal error: bits/stc++.h: No such file or directory 1 | #include<bits/stc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s542494248
p03835
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> #include <queue> typedef long long ll; using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mod 1000000007 int main(){ int K,S; cin >> K >> S; int ans = 0; for(int x = 0; x <= K; x++){ for(int y = 0; y <= K; y++){ int z = S-x-y; if(0 <= z && z <= K){ ans++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:12:11: note: to match this '{' 12 | int main(){ | ^
s988279362
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, s; cin >> k >> s; int cnt = 0; for(int a = 0; a <= k; a++){ for(int b = 0; b <= k; b++){ if(s - a - b <= k) cnt++; } } } cout << cnt << endl; }
a.cc:18:3: error: 'cout' does not name a type 18 | cout << cnt << endl; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s869078226
p03835
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0; i < n; i++) #define REPR(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int k,s; cin >> k >> s; int ans = 0; REP(x,k+1){ if(x==s){ ans++; break; } REP(y,k+1){ if(x+y==s){ ans++; break; } if(s-(x+y) <= k) cnt++; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:25:28: error: 'cnt' was not declared in this scope; did you mean 'int'? 25 | if(s-(x+y) <= k) cnt++; | ^~~ | int
s963309987
p03835
C++
#include <bits/stdc++.h> using namespace std; bool po(int x,int K){ if (0<=x && x<= K){ return true; } else{ return false; } } int sum(int K,int S){ int z=0,count=0; for(int x =0;po(x,K);x++){ for(int y=0;po(y,K);y++){ for(;po(z,K);z++){ if(x+y+z == S){ count++; break; } } if (x==0 && z>=0 && K>=z){ z--; } else{ z=0; } } } return count; } int main(){ int K,S; cin>>K>>S; cout<<sum(K,S)<<endl;
a.cc: In function 'int main()': a.cc:37:24: error: expected '}' at end of input 37 | cout<<sum(K,S)<<endl; | ^ a.cc:34:11: note: to match this '{' 34 | int main(){ | ^
s413579052
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int k, s; cin >> k >> s; int ans=0; for(int i=0; i<=k; i++){ for(int j=0; j<=k; j++){ int z = s-i-j; if(0<=z && z<=k){ ans++; } } } } cout << ans << endl; return 0; }
a.cc:16:5: error: 'cout' does not name a type 16 | cout << ans << endl; | ^~~~ a.cc:17:5: error: expected unqualified-id before 'return' 17 | return 0; | ^~~~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s379484272
p03835
C++
#include<iostream> using namespace std; int main(){ int x,y,z; int K,S; int pattern; cin >> K >> S; for(x=0;x<=K;x++){ for(y=0;y<=K;y++){ z = S - x - y; if( (x+y+z) == S) pattern++; } } cout << pattern < endl; }
a.cc: In function 'int main()': a.cc:19:19: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 19 | cout << pattern < endl; | ~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 19 | cout << pattern < endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 19 | cout << pattern < endl; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:19:21: note: couldn't deduce template parameter '_CharT' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 19 | cout << pattern < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3901 | operator<(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed: a.cc:19:21: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 19 | cout << pattern < endl; | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2600 | operator<(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed: a.cc:19:21: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 19 | cout << pattern < endl; | ^~~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)' 507 | operator<(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&' 507 | operator<(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
s631769385
p03835
C++
#include <iostream> using namespace std; int main(){ int x,y,z; int K,S; int pattern=0; cin >> 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) pattern++; } } } cout << pattern << endl; } } cout << pattern << endl; }
a.cc:24:3: error: expected declaration before '}' token 24 | } | ^ a.cc:26:3: error: 'cout' does not name a type 26 | cout << pattern << endl; | ^~~~ a.cc:28:1: error: expected declaration before '}' token 28 | } | ^
s520344904
p03835
C++
#include <iostream> using namespace std; int main(){ int x,y,z; int K,S; int pattern=0; cin >> K >> S; for(x=0;x<=2500;x++){ for(y=0;y<=2500;y++){ for(z=0;z<=2500;z++){ if(x+y+z = S) pattern++; } } } cout << pattern << endl; }
a.cc: In function 'int main()': a.cc:15:15: error: lvalue required as left operand of assignment 15 | if(x+y+z = S) | ~~~^~
s902299889
p03835
C
#include<stdio.h> int main(){ int x,y,z; int i,j; int k,s; int ans=0; scanf("%d %d",&k,&s); for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ z=s-x-y; if(z>=0&&z<=k)ans++ } } printf("%d\n",ans); return 0; }
main.c: In function 'main': main.c:11:26: error: expected ';' before '}' token 11 | if(z>=0&&z<=k)ans++ | ^ | ; 12 | } | ~
s040606002
p03835
C
#include<stido.h> int main(){ int x,y,z; int i,j,l; int k,s; int n=0; scanf("%d %d",&k,&s); for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ for(l=0;l<=k;l++){ if(i+j+l==s)n++; } } } printf("%d\n",n); return 0; }
main.c:1:9: fatal error: stido.h: No such file or directory 1 | #include<stido.h> | ^~~~~~~~~ compilation terminated.
s137166060
p03835
C
#include<stido.h> int main(){ int x,y,z; int i,j,l; int k,s; scanf("%d %d",&k,&s); for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ for(l=0;l<=k;l++){ if(i+j+l==s)s++; } } } printf("%d\n",s); return 0; }
main.c:1:9: fatal error: stido.h: No such file or directory 1 | #include<stido.h> | ^~~~~~~~~ compilation terminated.
s912259017
p03835
C++
#include<bits/stdc++.h> using namespsace std; int main() { int i,j,k,s; cin>>k>>s; int ans=0; for(i=0;i<=k;++i) { for(j=0;j<=k;++j) { if(s-(i+j)>=0 && s-(i+j)<=k) ++ans; } } cout<<ans<<endl; return 0; }
a.cc:3:7: error: expected nested-name-specifier before 'namespsace' 3 | using namespsace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin>>k>>s; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 18 | cout<<ans<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:18:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 18 | cout<<ans<<endl; | ^~~~ | std::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: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s298881469
p03835
C++
num = input().split() k = int(num[0]) s = int(num[1]) #print(k) #print(s) import numpy as np x = np.arange(k+1) y = np.arange(k+1).reshape(k+1,1) z = np.arange(k+1) xy = x + y count =0 #l=0 for i in range(k+1) : for j in range(k+1) : a = x + xy[i][j] count +=np.count_nonzero(a == s) #l +=1 #print(l) print(count)
a.cc:6:2: error: invalid preprocessing directive #print 6 | #print(k) | ^~~~~ a.cc:7:2: error: invalid preprocessing directive #print 7 | #print(s) | ^~~~~ a.cc:17:2: error: invalid preprocessing directive #l 17 | #l=0 | ^ a.cc:22:10: error: invalid preprocessing directive #l 22 | #l +=1 | ^ a.cc:23:10: error: invalid preprocessing directive #print 23 | #print(l) | ^~~~~ a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'? 1 | num = input().split() | ^~~ | enum
s489129544
p03835
C++
#include<iostream> using namespace std; int k,s,cnt=0; int main() { cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { for(int z=0;z<=k;z++) if(x+y+z==s) cnt++; } } cout<<cnt<<endl; return 0;
a.cc: In function 'int main()': a.cc:15:14: error: expected '}' at end of input 15 | return 0; | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s715807327
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k,s; cin >> k >> s; int df = 0; for(int x = 0;x <= k;x++){ for(int y = 0;y <= k && x + y <= s;y++){ if(x + y + k >= s){ df++; } } } } cout << df << endl; }
a.cc:15:1: error: 'cout' does not name a type 15 | cout << df << endl; | ^~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s024647223
p03835
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0;i<(n);i++) int main(){ int k, s, ans = 0; cin >> k >> s; for(int i = 0; i <= k; i++) for(int j = 0; j <= k - i; j++) { if(0 <= s - i - j && s - i - j <= k) ans++; } cout << ans << e#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0;i<(n);i++) 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(0 <= s - i - j && s - i - j <= k) ans++; } cout << ans << endl; } ndl; }
a.cc:12:19: error: stray '#' in program 12 | cout << ans << e#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:12:18: error: 'e' was not declared in this scope 12 | cout << ans << e#include <bits/stdc++.h> | ^ a.cc:17:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 17 | int main(){ | ^~ a.cc:17:9: note: remove parentheses to default-initialize a variable 17 | int main(){ | ^~ | -- a.cc:17:9: note: or replace parentheses with braces to value-initialize a variable a.cc:17:11: error: a function-definition is not allowed here before '{' token 17 | int main(){ | ^ a.cc:25:3: error: 'ndl' was not declared in this scope 25 | ndl; | ^~~
s697055616
p03835
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String line = scanner.nextLine(); String[] strings = line.split(" "); int K = Integer.parseInt(strings[0]); int S = Integer.parseInt(strings[1]); int count = 0; for (int i = 0; i <= K; i++) { for (int j = 0; j <= K; j++) { for (int k = 0; k <= K; k++) { if (i + j + k == S) { count++; } if (i + j + k > S) { break; } } } } System.out.println(count); } }
Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s236255278
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K, S; int count = 0; cin >> K >> S; for(int i = 0; i < K){ for(int j = 0; j < K; j++){ if(0<= S-i-j<=K){ count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:23: error: expected ';' before ')' token 8 | for(int i = 0; i < K){ | ^ | ;
s658235604
p03835
C++
#include <iostream> using namespace std; int main(){ int X,Y,Z, K, S, counter; counter = 0; cin >> 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)counter+=1; } } } cout << counter << endl; }
a.cc: In function 'int main()': a.cc:11:15: error: lvalue required as left operand of assignment 11 | if(X+Y+Z = S)counter+=1; | ~~~^~
s371320520
p03835
C++
#include <iostream> using namespace std; int main(){ int X,Y,Z, K, S, counter; counter = 0; cin >> 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)counter+=1; } cout << counter << endl; }
a.cc: In function 'int main()': a.cc:11:15: error: lvalue required as left operand of assignment 11 | if(X+Y+Z = S)counter+=1; | ~~~^~ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:8:22: note: to match this '{' 8 | for(X = 0;X<=K;X++){ | ^ a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s248697864
p03835
C++
#include<iostream> using namespace std; int k,s,cnt=0; int main() { cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { for(int z=0;z<=k;z++) if(x+y+z==s) cnt++; } } cout<<cnt<<endl; re
a.cc: In function 'int main()': a.cc:15:5: error: 're' was not declared in this scope 15 | re | ^~ a.cc:15:7: error: expected '}' at end of input 15 | re | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s655515799
p03835
C++
#include<iostream> using namespace std; int main() { int K,S,X,Y,Z,total.count=0; cin >> K >> S; for (X=0; X<=K; X++) { for (Y=0; Y<=K; Y++) { for (Z=0; X<=K; Z++) { total = X + Y + Z; if (total == S) count++; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:5:22: error: expected initializer before '.' token 5 | int K,S,X,Y,Z,total.count=0; | ^ a.cc:12:9: error: 'total' was not declared in this scope 12 | total = X + Y + Z; | ^~~~~ a.cc:13:25: error: 'count' was not declared in this scope 13 | if (total == S) count++; | ^~~~~ a.cc:18:11: error: 'count' was not declared in this scope 18 | cout << count << endl; | ^~~~~
s769607599
p03835
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n)+1;i++) using namespace std; int main() { int k, s, ans=0; cin >> k >> s; rep(a,k+1){ rep(b,k+1) { int c=S-a-b; if(0<= c && c<=k) { ans++; } } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:15: error: 'S' was not declared in this scope 9 | int c=S-a-b; | ^ a.cc: At global scope: 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 | } | ^
s416384543
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int k, s, ans=0; cin >> k >> s; for(int h=0;h<k+1;i++){ for(int i=0;i<k+1;i++){ for(int j=0;j<k+1;i++){ int count=h+i+j; if(count==s) ans++; } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:21: error: 'i' was not declared in this scope 6 | for(int h=0;h<k+1;i++){ | ^
s758327833
p03835
C++
#include <bits/stdc++.h> for(int i=0;i<n;i++) using namespace std; int main() { int k, s, ans=0; cin >> k >> s; for(int h=0;h<k+1;i++){ for(int i=0;i<k+1;i++){ for(int j=0;j<k+1;i++){ int count=h+i+j; if(count==s) ans++; } } } cout << ans << endl; }
a.cc:2:1: error: expected unqualified-id before 'for' 2 | for(int i=0;i<n;i++) | ^~~ a.cc:2:13: error: 'i' does not name a type 2 | for(int i=0;i<n;i++) | ^ a.cc:2:17: error: 'i' does not name a type 2 | for(int i=0;i<n;i++) | ^ a.cc: In function 'int main()': a.cc:6:20: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | int k, s, ans=0; cin >> k >> s; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:21: error: 'i' was not declared in this scope 7 | for(int h=0;h<k+1;i++){ | ^ a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:16:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 16 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/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: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s203088551
p03835
C++
#include<iostream> using namespace std; int main(){ int S; int k; int c=0; cin>>S>>K; for(int X=0;X<=K;X++){ for(int Y=0;Y<=K;Y++){ int Z=S-(X+Y); if(Z>=0&&Z<=K) C++; } } cout<<c; }
a.cc: In function 'int main()': a.cc:7:17: error: 'K' was not declared in this scope 7 | cin>>S>>K; | ^ a.cc:12:25: error: 'C' was not declared in this scope 12 | C++; | ^
s664278517
p03835
C++
#include<iostream> using namespace std; int main(){ int k,s; cin>>k>>s; int x,y=0,z; int count=0; for(int i=0;i<=k;i++) { x=i; for(int i=0;i<=k;i++){ z=i; if(x+y+z==s) count+=1; count=count*2; } }} cout<<count; }
a.cc:19:17: error: 'cout' does not name a type 19 | cout<<count; | ^~~~ a.cc:20:9: error: expected declaration before '}' token 20 | } | ^
s113126777
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 ++){ if(S - x - y <= K){ ans += 1; } } } } 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 | } | ^
s697860843
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K, S; cin >> K >> S; int ans = 0; for(int x = 0, x <= K, x ++){ for(int y = 0, y <= K, y ++){ for(int z = 0, z <= K, z ++){ if(x+y+z == S){ ans += 1; } } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:19: error: expected ';' before '<=' token 8 | for(int x = 0, x <= K, x ++){ | ^~~ | ; a.cc:8:20: error: expected primary-expression before '<=' token 8 | for(int x = 0, x <= K, x ++){ | ^~ a.cc:8:30: error: expected ';' before ')' token 8 | for(int x = 0, x <= K, x ++){ | ^ | ; a.cc:9:21: error: expected ';' before '<=' token 9 | for(int y = 0, y <= K, y ++){ | ^~~ | ; a.cc:9:22: error: expected primary-expression before '<=' token 9 | for(int y = 0, y <= K, y ++){ | ^~ a.cc:9:32: error: expected ';' before ')' token 9 | for(int y = 0, y <= K, y ++){ | ^ | ; a.cc:10:23: error: expected ';' before '<=' token 10 | for(int z = 0, z <= K, z ++){ | ^~~ | ; a.cc:10:24: error: expected primary-expression before '<=' token 10 | for(int z = 0, z <= K, z ++){ | ^~ a.cc:10:34: error: expected ';' before ')' token 10 | for(int z = 0, z <= K, z ++){ | ^ | ;
s569539945
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K, S; cin >> K >> S; int ans = ;0 for(int x = 0, x <= K, x ++){ for(int y = 0, y <= K, y ++){ for(int z = 0, z <= K, z ++){ if(x+y+z == S){ ans += 1; } } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:13: error: expected primary-expression before ';' token 7 | int ans = ;0 | ^ a.cc:7:15: error: expected ';' before 'for' 7 | int ans = ;0 | ^ | ; 8 | for(int x = 0, x <= K, x ++){ | ~~~
s849339958
p03835
C++
#include<bits/stdc++.h> using namespace sts; int main(){ int K, S; cin >> K >> S; int ans = ;0 for(int x = 0, x <= K, x ++){ for(int y = 0, y <= K, y ++){ for(int z = 0, z <= K, z ++){ if(x+y+z == S){ ans += 1; } } } } cout << ans << endl; }
a.cc:2:17: error: 'sts' is not a namespace-name 2 | using namespace sts; | ^~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> K >> S; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:13: error: expected primary-expression before ';' token 7 | int ans = ;0 | ^ a.cc:7:15: error: expected ';' before 'for' 7 | int ans = ;0 | ^ | ; 8 | for(int x = 0, x <= K, x ++){ | ~~~ a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 17 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:17:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 17 | cout << ans << endl; | ^~~~ | std::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: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s271020580
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int s,k,c=0; scanf("%d%d",&k,&s); for(int x=0;0<=x&&x<=k;x++) { for (int y=0;0<=y&&y<=k;y++) { int z=s-(x+y); if(z>=0&&z<=k) { c++; } } } printf("%d",c);
a.cc: In function 'int main()': a.cc:20:20: error: expected '}' at end of input 20 | printf("%d",c); | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s104801954
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int s,k,c=0; scanf("%d%d",&k,&s); for(int x=0;0<=x&&x<=k;x++) { for (int y=0;0<=y&&y<=k;y++) { int z=s-(x+y); if(z>=0&&z<=k) { c++; } } } printf("%d",c);
a.cc: In function 'int main()': a.cc:20:20: error: expected '}' at end of input 20 | printf("%d",c); | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s190040877
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s,z; cin>>k>>s; int c=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++) z=s-i-j; if(s==i+j+z){ if(z>=0&&z<=k){ c+=1;}} } cout<<c; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'j' was not declared in this scope 10 | if(s==i+j+z){ | ^
s064641317
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s,z; cin>>k>>s; int c=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++) z=s-i-j; if(z>=0&&z<=k){ if(s==i+j+z){ c+=1;}} } cout<<c; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'j' was not declared in this scope 11 | if(s==i+j+z){ | ^
s485870355
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s,z; cin>>k>>s; int c=0; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++) z=s-i-j; if(s==i+j+z){ if(z>=0&&z<=k) c+=1;} } cout<<c; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'j' was not declared in this scope 10 | if(s==i+j+z){ | ^
s186147949
p03835
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; int main(){ ll k,s,c=0; cin>>k>>s; for(int i=0;i<=k;i++){ for(int j=0;j<=k;j++){ if(s-i-j>=0 && s-i-j<=k) c++ } } cout<<c<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:41: error: expected ';' before '}' token 11 | if(s-i-j>=0 && s-i-j<=k) c++ | ^ | ; 12 | } | ~
s952679004
p03835
C++
using namespace std; int main(){ int k,s; scanf("%d%d",&k,&s); int cnt=0; for(int x=0;x<=k;++x) { for(int y=0;y<=k;++y){ int z; z=s-(x+y); if((z<=k)&&(z>=0)) ++cnt; } } printf("%d",cnt);}
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d%d",&k,&s); | ^~~~~ a.cc:17:9: error: 'printf' was not declared in this scope 17 | printf("%d",cnt);} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 |
s501578316
p03835
C++
#include<bits/stdc++.h> using namespace std; int main() { int k,s,c=0,z; scanf("%d%d",&k,&s); for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if(z>=0&&z<=k&&(o+x+y)==s) c++; } } printf("%d",c);
a.cc: In function 'int main()': a.cc:12:33: error: 'o' was not declared in this scope 12 | if(z>=0&&z<=k&&(o+x+y)==s) | ^ a.cc:16:27: error: expected '}' at end of input 16 | printf("%d",c); | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s595855548
p03835
C++
#include<bits/stdc++.h> using namespace std; int main() { int k,s,c=0,z; scanf("%d%d",&k,&s); for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if(z>=0&&z<=k&&(o+x+y) ==s) c++; } } printf("%d",c); }
a.cc: In function 'int main()': a.cc:12:33: error: 'o' was not declared in this scope 12 | if(z>=0&&z<=k&&(o+x+y) ==s) | ^
s249895686
p03835
C++
#include<iostream> using namespace std; int main (){ int s,k; scanf("%d%d",&k,&s); int c=0vz; for(int y=0;y<=k;y++){ for(int x=0;x<=k;x++) { z=s(y+x); if (z>=0&&z<=k) c++; } } printf("%d",c); }
a.cc: In function 'int main()': a.cc:6:7: error: unable to find numeric literal operator 'operator""vz' 6 | int c=0vz; | ^~~ a.cc:12:1: error: 'z' was not declared in this scope 12 | z=s(y+x); | ^ a.cc:12:4: error: 's' cannot be used as a function 12 | z=s(y+x); | ~^~~~~
s533636734
p03835
C++
#include<bits/stdc++.h> using namespace std; int main (){ int s,k; scanf("%d%d",&k,&s); int c=0,z; for(int y=0;y<=k;y++){ for(int x=0;x<=k;x++) { z=s(y+x); if (z>=0&&z<=k) c++; } } printf("%d",c); }
a.cc: In function 'int main()': a.cc:12:4: error: 's' cannot be used as a function 12 | z=s(y+x); | ~^~~~~
s593146248
p03835
C++
#include<bits/stdc++.h> using namespace std; int main (){ int s,k; scanf("%d%d",&k,&s); int c=0vz; for(int y=0;y<=k;y++){ for(int x=0;x<=k;x++) { z=s(y+x); if (z>=0&&z<=k) c++; } } printf("%d",c); }
a.cc: In function 'int main()': a.cc:6:7: error: unable to find numeric literal operator 'operator""vz' 6 | int c=0vz; | ^~~ a.cc:12:1: error: 'z' was not declared in this scope 12 | z=s(y+x); | ^ a.cc:12:4: error: 's' cannot be used as a function 12 | z=s(y+x); | ~^~~~~
s547489081
p03835
C++
#include <iostream> #include<bits/stdc++.h> using namespace std; int main(){ int n,count=0; cin>>n; for(int i==0;i<n;i++){ int x ,y,z; cin>>x>>y>>z; if((x+y+z)>=2) count++; } cout<<count; return 0;}
a.cc: In function 'int main()': a.cc:7:18: error: expected ';' before '==' token 7 | for(int i==0;i<n;i++){ | ^~ | ; a.cc:7:18: error: expected primary-expression before '==' token 7 | for(int i==0;i<n;i++){ | ^~ a.cc:7:25: error: expected ')' before ';' token 7 | for(int i==0;i<n;i++){ | ~ ^ | ) a.cc:7:26: error: 'i' was not declared in this scope 7 | for(int i==0;i<n;i++){ | ^
s129380687
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k; int count =0; cin >>k>>s; for(int x=0;x<=k;x++) { for( int y=0;y<=k;y++) { int z=s-(x+y); if(z>=0&&z<=k) count ++; } } cout<<count <<endl; } }
a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s886863384
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k; int count =0; cin>>k>>s; for(int i=0;i<=k;i++) { for(int y=0;y<=k;i++) int z=s-(i+y); if(z>=0&&z<=k) count ++; } cout<<count; }
a.cc: In function 'int main()': a.cc:11:4: error: 'z' was not declared in this scope 11 | if(z>=0&&z<=k) | ^
s561604578
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k; int count =0; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;i++){ int z=s-(x+y); if(z>=0&&z<=k) count ++; } } cout<<count<<"\n";
a.cc: In function 'int main()': a.cc:9:18: error: 'i' was not declared in this scope 9 | for(int y=0;y<=k;i++){ | ^ a.cc:15:19: error: expected '}' at end of input 15 | cout<<count<<"\n"; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s474507172
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k; int count =0; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;i++){ int z=s-(x+y); if(z>=0&&z<=k) count ++; } } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:10:18: error: 'i' was not declared in this scope 10 | for(int y=0;y<=k;i++){ | ^
s531505272
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k, count =0; cin>>k>>s; for(int i=0;i<=k;i++) for(int y=0;y<=k;i++) int z=s-(i+y); if(z>=0&&z<=k) count ++; cout<<count; }
a.cc: In function 'int main()': a.cc:9:4: error: 'z' was not declared in this scope 9 | if(z>=0&&z<=k) | ^
s478827163
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int s,k; int count =0; cin>>k>>s; for(int i=0;i<=k;i++) { for(int y=0;y<=k;i++){ int z=s-(i+y); if(z>=0&&z<=k) count ++; } } cout<<count;
a.cc: In function 'int main()': a.cc:16:13: error: expected '}' at end of input 16 | cout<<count; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s306564218
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,k; int count =0; cin>>x>>k; for(int i=0;i<=k;i++) { for(int y=0;y<=k;i++){ int z=x-(i+y); if(z>=0&&z<=k) count ++;
a.cc: In function 'int main()': a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:10:22: note: to match this '{' 10 | for(int y=0;y<=k;i++){ | ^ a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:9:1: note: to match this '{' 9 | { | ^ a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s231398796
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,k; int count =0; cin>>x>>k; for(int i=0;i<=k;i++) { for(int y=0;y<=k;i++){ int z=s-(i+y); if(z>=0&&z<=k) count ++;
a.cc: In function 'int main()': a.cc:11:7: error: 's' was not declared in this scope 11 | int z=s-(i+y); | ^ a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:10:22: note: to match this '{' 10 | for(int y=0;y<=k;i++){ | ^ a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:9:1: note: to match this '{' 9 | { | ^ a.cc:13:10: error: expected '}' at end of input 13 | count ++; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s360241564
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int x,k; int count =0; cin>>x>>k; for(int i=0;i<=k;i++) { for(int y=0;y<=k;i++){ int z=s-(x+y); if(z>=0&&z<=k) count ++; } } cout<<count; }
a.cc: In function 'int main()': a.cc:11:7: error: 's' was not declared in this scope 11 | int z=s-(x+y); | ^
s785118934
p03835
C++
#include<cstdio> using namespace std; int main(void){ int n,s; int i,j; int x,cnt; scanf("%d %d",&n,&s); cnt=0; for(i=0;i<=n;i++){ for(j=0;j<=n;j++){ x=s-(i+j); if(x<=k) cnt++; } } printf("%d\n",cnt); return 0; }
a.cc: In function 'int main()': a.cc:12:31: error: 'k' was not declared in this scope 12 | if(x<=k) cnt++; | ^
s527605654
p03835
C++
103:29:10 Running Remaining: 64:30:49 Overview Problem Status Rank (103:29:03) 3 Comments Previous12345…Next Username Prob Result Time (ms) Mem (MB) Lang Submit Time MennaMostafa F Submit Failed C++ 3 hr ago MennaMostafa F Submit Failed C++ 3 hr ago MennaMostafa F Time Limit Exceeded C++ 1 days ago MennaMostafa F Time Limit Exceeded C++ 1 days ago All Copyright Reserved © 2010-2019 Xu Han Server Time: 2019-07-16 23:59:09 UTC+2 Click to rejudge Click to rejudge Click to rejudge #20499136 | MennaMostafa's solution for [Problem F] Status Submit Failed Length 376 Lang C++14 (GCC 5.3.0) Submitted 2019-07-16 21:23:18 Select Code #include <iostream> using namespace std ; int main () { int limit , sum , abs = 0, counter =0; cin >> limit >> sum ; for (int i=0;i<=limit ; i++) { for (int j =0; j<= limit ; j++) { abs = i + j -sum ; abs *=-1 ; if (abs <= limit && abs >=0) { counter ++ ; } abs = 0 ; } } cout << counter ; return 0 ; }
a.cc:7:1: error: extended character … is not valid in an identifier 7 | Previous12345…Next | ^ a.cc:36:24: error: extended character © is not valid in an identifier 36 | All Copyright Reserved © 2010-2019 Xu Han | ^ a.cc:37:31: error: invalid digit "9" in octal constant 37 | Server Time: 2019-07-16 23:59:09 UTC+2 | ^~ a.cc:42:11: error: "|" is not a valid filename 42 | #20499136 | MennaMostafa's solution for [Problem F] | ^ a.cc:42:25: warning: missing terminating ' character 42 | #20499136 | MennaMostafa's solution for [Problem F] | ^ a.cc:48:12: error: too many decimal points in number 48 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 103:29:10 Running Remaining: 64:30:49 | ^~~ 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:53: /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, cons
s714675495
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int k; int s; cin>>k; cin<<s; if(k==s) cout<<k*3; else if(k>s||s>k) { cout<<((k+s)%3)-1; } return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 7 | cin<<s; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:12: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin<<s; | ~~~^~~ a.cc:7:12: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 7 | cin<<s; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ 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: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:7:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 7 | cin<<s; | ^ /usr/include/c++/14/ostream:684
s816207281
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k)){ count ++; } } } cout<<count; return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: no post-increment operator for type 11 | count ++; | ^~ a.cc:15:5: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 15 | cout<<count; | ~~~~^~~~~~~ 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:2: /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: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __
s844405219
p03835
C++
#include <stdio.h> int main(){ int i,k,s,ans=0; scanf("%d%d",&k,&s); for(int x = 0; x <= k; x++){ for(int y = 0; y <= k; y++){ for(int z = 0; z <= k; z++) { if (s==x+y+z) ans=ans+1 } } } printf("%d",ans); return 0; }
a.cc: In function 'int main()': a.cc:12:20: error: expected ';' before '}' token 12 | ans=ans+1 | ^ | ; 13 | } | ~
s730430208
p03835
C++
#include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}} cout<<count; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: expected ')' before '{' token 10 | if((z>=0)&&(z<=k){ count ++; }}} cout<<count; | ~ ^ | ) a.cc:10:31: error: expected primary-expression before '}' token 10 | if((z>=0)&&(z<=k){ count ++; }}} cout<<count; | ^ a.cc:10:40: error: 'count' was not declared in this scope 10 | if((z>=0)&&(z<=k){ count ++; }}} cout<<count; | ^~~~~
s964842504
p03835
C++
//f #include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}}} cout<<count; return 0; }
a.cc:2:21: warning: extra tokens at end of #include directive 2 | #include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}}} cout<<count; return 0; } | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s013410978
p03835
C++
#include <iostream> using namespace std; int main(){ int s,k; cin>>k>>s; for(int x=0;x<=k;x++) { for(int y=0;y<=k;y++) { int z=s-(x+y); if((z>=0)&&(z<=k){ count ++; }}}} cout<<count; return 0; }
a.cc: In function 'int main()': a.cc:11:18: error: expected ')' before '{' token 11 | if((z>=0)&&(z<=k){ | ~ ^ | ) a.cc:13:2: error: expected primary-expression before '}' token 13 | }}}} | ^ a.cc: At global scope: a.cc:14:1: error: 'cout' does not name a type 14 | cout<<count; | ^~~~ a.cc:15:1: error: expected unqualified-id before 'return' 15 | return 0; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s814379759
p03835
C++
#include<bits/stdc++.h> using namespace std; int a[n]; int main() { cin>>k>>s; for(int i=0;i<=k;i++) { for(int j=0;j<=k;j++) { a[n+i+j]++; } } int sum=0; for(int i=0;i<=k;i++) { int pos=s-i; if(pos<0) { continue; } sum+=a[i+pos]; } cout<<sum<<endl; return 0; }
a.cc:3:9: error: 'n' was not declared in this scope; did you mean 'yn'? 3 | int a[n]; | ^ | yn a.cc: In function 'int main()': a.cc:7:12: error: 'k' was not declared in this scope 7 | cin>>k>>s; | ^ a.cc:7:15: error: 's' was not declared in this scope 7 | cin>>k>>s; | ^ a.cc:12:14: error: 'a' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:12:16: error: 'n' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:23:15: error: 'a' was not declared in this scope 23 | sum+=a[i+pos]; | ^
s340572314
p03835
C++
#include<bits/stdc++.h> using namespace std; int a[n]; int main() { int k,s; cin>>k>>s; for(int i=0;i<=k;i++) { for(int j=0;j<=k;j++) { a[n+i+j]++; } } int sum=0; for(int i=0;i<=k;i++) { int pos=s-i; if(pos<0) { continue; } sum+=a[i+pos]; } cout<<sum<<endl; return 0; }
a.cc:3:9: error: 'n' was not declared in this scope; did you mean 'yn'? 3 | int a[n]; | ^ | yn a.cc: In function 'int main()': a.cc:12:14: error: 'a' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:12:16: error: 'n' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:23:15: error: 'a' was not declared in this scope 23 | sum+=a[i+pos]; | ^
s595484900
p03835
C++
#include<bits/stdc++.h> using namespace std; int a[n]; int main() { int k,s; cin>>k>>s; for(int i=0;i<=k;i++) { for(int j=0;j<=k;j++) { a[n+i+j]++; } } int sum=0; for(int i=0;i<=k;i++) { int pos=s-i; if(pos<0) { continue; } sum+=a[n+pos]; } cout<<sum<<endl; return 0; }
a.cc:3:9: error: 'n' was not declared in this scope; did you mean 'yn'? 3 | int a[n]; | ^ | yn a.cc: In function 'int main()': a.cc:12:14: error: 'a' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:12:16: error: 'n' was not declared in this scope 12 | a[n+i+j]++; | ^ a.cc:23:15: error: 'a' was not declared in this scope 23 | sum+=a[n+pos]; | ^ a.cc:23:17: error: 'n' was not declared in this scope 23 | sum+=a[n+pos]; | ^
s936102587
p03835
C++
// // main.cpp // 051_B_Sum_of_Three_Integers2 // // Created by tolemy on 2019/07/15. // Copyright © 2019 tolemy. All rights reserved. // #include <iostream> #include <vector> using namespace std; int main(int argc, const char * argv[]) { //入力の受け取り int k, s = 0; cin >> k >> s; //回答方針:2分探索を使用 //3重ループにすると、計算量がO(k^3)となり、かなり遅い //問題を変形する //x + y + z = k ⇄ y + z = k - x //k - xを先にリスト化しておいて、y, zの2重ループ内で検索する。 //この結果、計算量はO(k^2 * logk)となる。 //2分探索用のリストを作成 vector<int> answer; for(int x = k;x>=0; x--) { answer.push_back(k - x); } int count = 0; for(int y = 0;y <= k; y++) { for(int z = 0;z <= k; z++) { if(binary_search(answer.begin(), answer.end(), y + z)) count++; } } cout << count; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:42:16: error: 'binary_search' was not declared in this scope 42 | if(binary_search(answer.begin(), answer.end(), y + z)) count++; | ^~~~~~~~~~~~~
s417375750
p03835
C++
#import<iostream> using namespace std; int main() { int k,s; cin >> k >> s; int count = 0; for(int x = 0; x <= k; x++) { for(int y = 0; y <= k; y++) { if (s-x-y <= k) count++ } } cout << count << endl; }
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:10:36: error: expected ';' before '}' token 10 | if (s-x-y <= k) count++ | ^ | ; 11 | } | ~
s087188230
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int i,j,N,K,cnt=0,t; cin>>N>>K; for(i=0,i<=N;i++){ for(j=0,j<=N;j++){ t=K-i-j; if(t>=0&&t<=K)cnt++; } } cout <<cnt<<endl; }
a.cc: In function 'int main()': a.cc:7:17: error: expected ';' before ')' token 7 | for(i=0,i<=N;i++){ | ^ | ; a.cc:8:17: error: expected ';' before ')' token 8 | for(j=0,j<=N;j++){ | ^ | ;
s458618517
p03835
C++
K,S=map(int,input().split()) cnt=0 for i in range(K+1): for j in range(K+1): if 0<=S-i-j<=K: cnt+=1 print(cnt)
a.cc:1:1: error: 'K' does not name a type 1 | K,S=map(int,input().split()) | ^
s627076846
p03835
C++
#include <bits/stdc++.h> using namespace std; //typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; //container util //------------------------------------------ #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) //repetition //------------------------------------------ #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main() { int K, S, ans=0; cin >> K >> S; REP(i,K+1) { REP(j,K+1-x) { int x = i, y = j; int z = S - x - y; if(z > 0) ans++; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:33:15: error: 'x' was not declared in this scope 33 | REP(j,K+1-x) { | ^ a.cc:25:37: note: in definition of macro 'FOR' 25 | #define FOR(i,a,b) for(int i=(a);i<(b);++i) | ^ a.cc:33:5: note: in expansion of macro 'REP' 33 | REP(j,K+1-x) { | ^~~
s930800171
p03835
C++
import java.util.* fun main(args : Array<String>) { val sc = Scanner(System.`in`) val k = sc.nextInt() val s = sc.nextInt() var result = 0 for (x in 0..k) { for (y in 0..k) { if (x+y <= s && s <= x+y+k) result++ } } } print(result) }
a.cc:4:29: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ a.cc:4:32: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ a.cc:9:15: error: too many decimal points in number 9 | for (x in 0..k) { | ^~~~ a.cc:10:19: error: too many decimal points in number 10 | for (y in 0..k) { | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.* | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:15:10: error: expected constructor, destructor, or type conversion before '(' token 15 | print(result) | ^ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s736606225
p03835
C
#include<stdio.h> int main(){ int K,S,a,b,c,cnt=0; scanf("%d %d", &K, &S); for(a=0; a<=K; a++){ for(b=0; b<=K; b++){ c=s-a-b; if(c<=K && c>=0) cnt++; } printf("%d",cnt); } return 0; }
main.c: In function 'main': main.c:7:9: error: 's' undeclared (first use in this function) 7 | c=s-a-b; | ^ main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
s619666609
p03835
C
#include<stdio.h> int main(){ int K,S,a,b,c,cnt=0; scanf("%d %d", &K, &S); for(a=0; a<=K; a++){ for(b=0; b<=K; b++){ c=s-a-b; if(c<=K && c>=0) cnt++; } printf("%d\n",cnt); } return 0; }
main.c: In function 'main': main.c:7:9: error: 's' undeclared (first use in this function) 7 | c=s-a-b; | ^ main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
s224128502
p03835
C
#include<stdio.h> int main(){ int s,k,a,b,c,cnt=0; scanf("%d %d", &s, &k); for(a=0; a<=k; a++){ for(b=0; b<=k; b++){ c=s-a-b; if(c<=k && c>=0){ cnt+=1; } } // printf("%d",cnt); } printf("%d",cnt); return0; }
main.c: In function 'main': main.c:15:3: error: 'return0' undeclared (first use in this function) 15 | return0; | ^~~~~~~ main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
s120450362
p03835
C
#include<stdio.h> int main(){ int s,k,a,b,c,cnt=0; scanf("%d%d", &s, &k); for(a=0; a<=k; a++){ for(b=0; b<=k; b++){ c=s-a-b; if(c<=k && c>=0){ cnt+=1 } } } } } printf("%d\n",cnt); }
main.c: In function 'main': main.c:9:15: error: expected ';' before '}' token 9 | cnt+=1 | ^ | ; 10 | } | ~ main.c: At top level: main.c:14:3: error: expected identifier or '(' before '}' token 14 | } | ^ main.c:15:10: error: expected declaration specifiers or '...' before string constant 15 | printf("%d\n",cnt); | ^~~~~~ main.c:15:17: error: unknown type name 'cnt'; did you mean 'int'? 15 | printf("%d\n",cnt); | ^~~ | int main.c:16:1: error: expected identifier or '(' before '}' token 16 | } | ^
s835795889
p03835
C
#include<stdio.h> int main(){ int s,k,a,b,c,cnt; scanf("%d%d", &s, &k); cnt=0; for(a=0; a<=k; a++){ for(b=0; b<=k; b++){ c=s-a-b; if(c<=k && c>=0){ cnt+=1 } } } } } printf("%d\n",cnt); }
main.c: In function 'main': main.c:10:15: error: expected ';' before '}' token 10 | cnt+=1 | ^ | ; 11 | } | ~ main.c: At top level: main.c:15:3: error: expected identifier or '(' before '}' token 15 | } | ^ main.c:16:10: error: expected declaration specifiers or '...' before string constant 16 | printf("%d\n",cnt); | ^~~~~~ main.c:16:17: error: unknown type name 'cnt'; did you mean 'int'? 16 | printf("%d\n",cnt); | ^~~ | int main.c:17:1: error: expected identifier or '(' before '}' token 17 | } | ^
s629394226
p03835
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(Sytem.in); int k = sc.nextInt(); int s = sc.nextInt(); int ans = 0; for (int i = 0; i <= k; i++) { for (int j = 0; j <= k; j++) { int tmp = s - i - j; if (0 <=tmp && tmp <= k) ans++; } } System.out.println(ans); } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(Sytem.in); ^ symbol: variable Sytem location: class Main 1 error
s196050659
p03835
C++
#include<bits/stdc++.h> using namespace std; int main(){ int K,S,i,ans=0; cin >> K >> S; for(i=0; i<K+1; i++){ ans += S-i+1 } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:17: error: expected ';' before '}' token 9 | ans += S-i+1 | ^ | ; 10 | } | ~
s854405423
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; c=0; d=0; cin>>a>>b; for(int i=0;i<=a;i++){ for(int j=0;j<=a;j++){ for(int k=0;k<=a;k++){ if(i+j+k==b) c++; if(i+j>b){ break; } if(i+j>b){ d=j; break; } } if(i+d>b) break; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s632297460
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; c=0; cin>>a>>b; for(int i=0;i<=a;i++){ for(int j=0;j<=a;j++){ for(int k=0;k<=a;k++){ if(i+j+k==b) c++; if(i+j>b){ break; } } if(i+j>b) a=j; break; } if(i+j>a) break; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:21:10: error: 'j' was not declared in this scope 21 | if(i+j>a) | ^
s469531846
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; c=0; cin>>a>>b; for(int i=0;i<=a;i++){ for(int j=0;j<=a;j++){ for(int k=0;k<=a;k++){ if(i+j+k==b) c++; if(i+j>b) break; } if(i+j>b) break; } if(i+j>b) break; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:19:10: error: 'j' was not declared in this scope 19 | if(i+j>b) | ^
s314191870
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; c=0; cin>>a>>b; for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ for(int k=0;k<a;k++){ if(i+j+k==b) c++; if(i+j>b) break; } if(i+j>b) break; } if(i+j>b) break; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:19:10: error: 'j' was not declared in this scope 19 | if(i+j>b) | ^
s744532408
p03835
C++
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main(int argc, const char * argv[]) { int K, S; cin >> K >> S; int ans = 0; for(int i = 0; i <= S; i++){ for(int j = 0; j <= S - i; j++){ if(i+j + k <= S){ ans++; } } } cout << ans << endl; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:14:20: error: 'k' was not declared in this scope 14 | if(i+j + k <= S){ | ^
s038358935
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int ans = 0; for (int i = 0; i <= K; i++) { for (int j = 0; j <= K; j++) { if (S - i - j <=K && S - i - j >= 0) { 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 | } | ^
s551970956
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int ans = 0; for (int i = 0; i <= K; i++) { for (int j = 0; j <= K; j++) { for (int k = 0; k<= K; k++) { if (S == i + j + k) { ans+++; } } } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:17: error: expected primary-expression before ';' token 12 | ans+++; | ^
s938965798
p03835
Java
import java.util.Scanner; public class Aim { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int k = scan.nextInt(); int s = scan.nextInt(); int x = 0; int y = 0; int z = 0; int countS = 0; int countK = 0; countS = (s + 2) * (s + 1) / 2; //0以上で合計がsになる3つの数 //System.out.println(countS); //あとは→k以上を使っているのを排除 for(x=k;x<=s;x++) { for(y=k;y<=s;y++) { for(z=k;z<=s;z++) { if(x+y==s-z) { countK++; } } } } int show = countS; if(s==3*k) { show=1; } System.out.println(show); } }
Main.java:3: error: class Aim is public, should be declared in a file named Aim.java public class Aim { ^ 1 error
s034339011
p03835
C++
#include<iostream> #include <vector> #include "cxx-prettyprint/prettyprint.hpp" #define MSG(x) std::cout << (x) << std::endl; using namespace std; int main() { int K, S; cin >> K >> S; std::vector<std::vector<int>> list; for (int x=0; x<=K && x<=S; x++) { int YplusZ = S - x; for (int y=0; y<=YplusZ; y++) { int z = YplusZ - y; if (y > K || z > K) { continue; } list.push_back({x, y, z}); } } MSG(list.size()); }
a.cc:3:10: fatal error: cxx-prettyprint/prettyprint.hpp: No such file or directory 3 | #include "cxx-prettyprint/prettyprint.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s544323260
p03835
C++
#include <bits/stdc++.h> #define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout) using namespace std; int K, S, T; int main(void){ //IO("test.in", "test.out"); scanf("%d%d", &K, &S); for(int i = 0; i <= K; i++) if(S - i <= K * 2) 2 * (1 << (K * 2 - S - i)) printf("%d\n", T); }
a.cc: In function 'int main()': a.cc:11:62: error: expected ';' before 'printf' 11 | if(S - i <= K * 2) 2 * (1 << (K * 2 - S - i)) | ^ | ; 12 | printf("%d\n", T); | ~~~~~~
s451191051
p03835
C++
#include <iostream> #include <algorithm> #include <map> #include <string> #include <cmath> #define mod 1000000007 using namespace std; int main(void){ int K, S; cin >> K >> S; for(int i=0; i<=K; i++){ for(int j=0; j<=K; j++){ if(i+j <= S && i+j >= 2*K) count++; } } cout << count; return 0; }
a.cc: In function 'int main()': a.cc:20:38: error: no post-increment operator for type 20 | count++; | ^~ a.cc:25:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 25 | cout << count; | ~~~~~^~~~~~~~ In file included from /usr/include/c++/14/iostream:41, 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: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/os
s670479359
p03835
C++
#include<stdio.h> int main(void) { int k,s,x,y,z,a; scanf("%d",&k); scanf("%d",&s); a=0; for(x=0;x<=k;++x) { for(y=0;y<=k;++y) { if(0<=z a z<=k) { a=a+1; } } } printf("%d\n",a); return 0; }
a.cc: In function 'int main()': a.cc:11:32: error: expected ')' before 'a' 11 | if(0<=z a z<=k) { | ~ ^~ | )
s656636646
p03835
C++
#include<iostream> #include<cmath> using namespace std; int main() { int K,S; cin >> K>>S; int count =0; for (int i=0;i<=K;i++) { for (int j=0;j<=K;j++) { for (int k=0;k<=K;k++) { if (i+j+k==S) { count++; } } } } cout << count << endl;
a.cc: In function 'int main()': a.cc:19:27: error: expected '}' at end of input 19 | cout << count << endl; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s663040356
p03835
C++
#include <iostream> using namespace std; int main() { int K, S; 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: In function 'int main()': a.cc:7:3: error: 'count' was not declared in this scope 7 | count = 0; | ^~~~~
s427597378
p03835
C++
#include<iostream> using namespace std; int main() { int K,S; cin >> K >> S; int count = 0; for(int i = 1,i <= K;i++) { for(int j = 1;j <= K;j++) { for(int k = 1;k <= K;k++) { if(i + j + k == S) { count++; } } } } cout << count < endl; }
a.cc: In function 'int main()': a.cc:8:18: error: expected ';' before '<=' token 8 | for(int i = 1,i <= K;i++) { | ^~~ | ; a.cc:8:19: error: expected primary-expression before '<=' token 8 | for(int i = 1,i <= K;i++) { | ^~ a.cc:17:17: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 17 | cout << count < endl; | ~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 17 | cout << count < endl; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 17 | cout << count < endl; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:17:19: note: couldn't deduce template parameter '_CharT' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 17 | cout << count < endl; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3901 | operator<(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed: a.cc:17:19: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>' 17 | cout << count < endl; | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2600 | operator<(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed: a.cc:17:19: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>' 17 | cout << count < endl; | ^~~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)' 507 | operator<(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&' 507 | operator<(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
s009699520
p03835
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <cstdlib> #include <cmath> #include <numeric> #include <tuple> #include <stack> #define rep(i,n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define print(s) cout << s << endl typedef long long ll; using namespace std; ll mod = pow(10,9) + 7; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } char upper(char c){ return c-0x20; } char lower(char c){ return c+0x20; } int main() { int k,s; cin >> k >> s; int count = 0; rep(i,k){ rep(j,k){ if (a+k < s && s-(a+b) <= k){ count++; } } } cout << count/2 << endl; }
a.cc: In function 'int main()': a.cc:34:29: error: 'a' was not declared in this scope 34 | if (a+k < s && s-(a+b) <= k){ | ^ a.cc:34:45: error: 'b' was not declared in this scope 34 | if (a+k < s && s-(a+b) <= k){ | ^
s580524196
p03835
C++
#include <bits/stdc++.h> using namespace std; int main(){ int K,S; cin >> K >> S; int c=0; for (int i=0;i=<min(K,S);i++){ c+=S-i+1; } cout << c << endl; }
a.cc: In function 'int main()': a.cc:7:18: error: expected primary-expression before '<' token 7 | for (int i=0;i=<min(K,S);i++){ | ^
s457158693
p03835
C++
#include <iostream> using namespace std; int main() { int K, S; cin >> K >> S; int cnta = 0; //まずはj<l<i for (int i = 0; i < K + 1; i++) { for (int l = 0; l < i; i++) { for (int j = 0; j < l; i++) { if (i + l + j == S) { cnta += 1; } } } cnta *= 6; //3こ全部違う int cntb; for (int i = 0; i < K + 1; i++) { for (int l = 0; l <= i; i++) { for (int j = 0; j <= l; i++) { if (i + l + j == S) { cntb += 1; } } } //2こかぶりまたは3こかぶりの数 if (S % 3 == 0) { cntb -= 1; } cntb *= 3; cout << cnta + cntb << endl; } return 0; }
a.cc: In function 'int main()': a.cc:45:10: error: expected '}' at end of input 45 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s335975971
p03835
C++
#include <bits/stdc++.h> using namespace std; int k, s, ans; int main () { cin>>k>>s; for(int i=1;i<=k;i++) { for(int j=1;j<=k;j++) int ij=s-i-j; if(ij<=k && ij >=0)ans++; } cout<<ans<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: 'ij' was not declared in this scope; did you mean 'i'? 11 | if(ij<=k && ij >=0)ans++; | ^~ | i
s153251807
p03835
C++
#include <bits/stdc++.h> using namespace std; int k, s; int main () { cin>>k>>s; for(int i=1;i<=k;i++) { for(int j=1;j<=k;j++) int ij=s-i-j; if(ij<=k && ij >=0)ans++; } cout<<ans<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: 'ij' was not declared in this scope; did you mean 'i'? 11 | if(ij<=k && ij >=0)ans++; | ^~ | i a.cc:11:32: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | if(ij<=k && ij >=0)ans++; | ^~~ | abs a.cc:14:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | cout<<ans<<"\n"; | ^~~ | abs
s171068419
p03835
C++
//#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { //入力 long K,S,x=0,y=0,z=0,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+l) <= K) { ans++; } } } //出力 cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:60: error: 'l' was not declared in this scope 12 | if (S-(i + j) >= 0 && S-(i+l) <= K) { | ^
s320043094
p03835
C++
//#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { //入力 long K,S,x=0,y=0,z=0,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+l) <= K) { ans++; } } } //出力 cout << ans << endl;
a.cc: In function 'int main()': a.cc:12:60: error: 'l' was not declared in this scope 12 | if (S-(i + j) >= 0 && S-(i+l) <= K) { | ^ a.cc:18:29: error: expected '}' at end of input 18 | cout << ans << endl; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^