submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s389344878
p03834
C++
#include<iostream> #include<string> using namespace std; using string = std::string; int main() { string s; std::cin >> s; for each (char var in s) { if (var == ',') std::cout << " "; else std::cout << var; } std::cout << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: expected '(' before 'each' 10 | for each (char var in s) | ^~~~ | ( a.cc:10:19: error: expected primary-expression before 'char' 10 | for each (char var in s) | ^~~~ a.cc:10:13: error: 'each' was not declared in this scope 10 | for each (char var in s) | ^~~~ a.cc:16:5: error: expected primary-expression before 'return' 16 | return 0; | ^~~~~~ a.cc:15:32: error: expected ')' before 'return' 15 | std::cout << std::endl; | ^ | ) 16 | return 0; | ~~~~~~ a.cc:10:13: note: to match this '(' 10 | for each (char var in s) | ^~~~
s344687342
p03834
Java
import java.util.Scanner; public class A_Haiku { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); System.out.println(s.replace(',', ' ')); sc.close(); } }
Main.java:3: error: class A_Haiku is public, should be declared in a file named A_Haiku.java public class A_Haiku { ^ 1 error
s599106625
p03834
Java
import java.util.Scanner; public class Main051A { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String s = sc.next(); System.out.println(s.replace(',', ' ')); sc.close(); } }
Main.java:2: error: class Main051A is public, should be declared in a file named Main051A.java public class Main051A { ^ 1 error
s427413204
p03834
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = scanner.next(); String a = s.substring(0,5); String b = s.substring(6,13); String c = s.substring(14,19); System.out.println(a + " " + b + " " + c); } }
Main.java:5: error: cannot find symbol String s = scanner.next(); ^ symbol: variable scanner location: class Main 1 error
s150602176
p03834
C++
#include <iostream> #include <string> using namespace std; int main(){ string s;cin>>s; string::size_type pos = s.find(','); while(pos != string::npos){ s.replace(pos, 1, ' '); pos = s.find(',', pos + 1); } cout << s << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::replace(std::__cxx11::basic_string<char>::size_type&, int, char)' 8 | s.replace(pos, 1, ' '); | ~~~~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:2275:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match) 2275 | replace(size_type __pos, size_type __n1, const _CharT* __s) | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2275:7: note: conversion of argument 3 would be ill-formed: a.cc:8:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 8 | s.replace(pos, 1, ' '); | ^~~ | | | char /usr/include/c++/14/bits/basic_string.h:2413:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(const_iterator, const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2413 | replace(const_iterator __i1, const_iterator __i2, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2413:9: note: candidate expects 4 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2522:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2522 | replace(size_type __pos, size_type __n, const _Tp& __svt) | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2522:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string<char>&]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = char; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2522:2: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::replace(size_type, size_type, const _Tp&) [with _Tp = char]' 2522 | replace(size_type __pos, size_type __n, const _Tp& __svt) | ^~~~~~~ a.cc:8:18: required from here 8 | s.replace(pos, 1, ' '); | ~~~~~~~~~^~~~~~~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string<char>&>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2540:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2540 | replace(size_type __pos1, size_type __n1, const _Tp& __svt, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2540:9: note: candidate expects 4 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2562:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(const_iterator, const_iterator, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2562 | replace(const_iterator __i1, const_iterator __i2, const _Tp& __svt) | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2562:9: note: template argument deduction/substitution failed: a.cc:8:19: note: cannot convert 'pos' (type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) to type 'std::__cxx11::basic_string<char>::const_iterator' 8 | s.replace(pos, 1, ' '); | ^~~ /usr/include/c++/14/bits/basic_string.h:2200:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2200 | replace(size_type __pos, size_type __n, const basic_string& __str) | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2200:67: note: no known conversion for argument 3 from 'char' to 'const std::__cxx11::basic_string<char>&' 2200 | replace(size_type __pos, size_type __n, const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:2223:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2223 | replace(size_type __pos1, size_type __n1, const basic_string& __str, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2223:7: note: candidate expects 5 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2249:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2249 | replace(size_type __pos, size_type __n1, const _CharT* __s, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2249:7: note: candidate expects 4 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2300:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2300 | replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2300:7: note: candidate expects 4 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2319:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(__const_iterator, __const_iterator, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2319 | replace(__const_iterator __i1, __const_iterator __i2, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2319:32: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2319 | replace(__const_iterator __i1, __const_iterator __i2, | ~~~~~~~~~~~~~~~~~^~~~ /usr/include/c++/14/bits/basic_string.h:2340:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(__const_iterator, __const_iterator, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; __const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]' 2340 | replace(__const_iterator __i1, __const_iterator __i2, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:2340:7: note: candidate expects 4 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:2363:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(__const_iterator, __const_iterator, const _CharT*) [with _CharT = char; _Tr
s883787975
p03834
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin>>s; replace(s.begin(), s.end(), ',', ' '); cout << s << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'replace' was not declared in this scope 7 | replace(s.begin(), s.end(), ',', ' '); | ^~~~~~~
s524546476
p03834
C++
S = input() ans = S[:5]+' '+S[6:13]+' '+S[14:] print(ans)
a.cc:1:1: error: 'S' does not name a type 1 | S = input() | ^
s196136075
p03834
C++
#include <iostream> #include <cstdio> using namespace std; int main() { char str[21]; int i; gets(str); for(i=0;str[i]!='\0';i++) { if(str[i]==',') { str[i]=' '; } } puts(str); return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(str); | ^~~~ | getw
s406788542
p03834
C++
#include <bits/stdc++.h> #include <cstdio> #include <cstdlib> using namespace std; int main() { char s[100]; gets(s); for(int i=0 ; s[i] ; i++){ if(s[i]==',') printf(" "); else printf("%c",s[i]); } putchar('\n'); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s520348265
p03834
C++
#include <bits/stdc++.h> #include <cstdio> #include <cstdlib> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); #endif // ONLINE_JUDGE char s[100]; gets(s); for(int i=0 ; s[i] ; i++){ if(s[i]==',') purchar(' '); else putchar(s[i]); } putchar('\n'); return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s); | ^~~~ | getw a.cc:13:23: error: 'purchar' was not declared in this scope; did you mean 'putchar'? 13 | if(s[i]==',') purchar(' '); | ^~~~~~~ | putchar
s975551401
p03834
C++
#include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); char s[20]; gets(s); for(int i=0; i<20; ++i) { if(s[i]==',') s[i]=' '; } puts(s); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s957871736
p03834
C++
#include <bits/stdc++.h> using namespace std; int main() { freopen("in.txt","r",stdin); char s[20]; gets(s); for(int i=0; i<20; ++i) { if(s[i]==',') s[i]=' '; } puts(s); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s787418951
p03834
C++
#include<cstdio> #define rep(i,a,b) for (int i = a ; i < b ; i ++) using namespace std; char a[100]; int main() { gets(a); a[5] = ' '; a[13] = ' '; puts(a); }
a.cc: In function 'int main()': a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(a); | ^~~~ | getw
s379512200
p03834
C++
#include<bits/stdc++.h> #define rep(i,a,b) for (int i = a ; i < b ; i ++) using namespace std; char a[100]; int main() { gets(a); a[5] = ' '; a[13] = ' '; puts(a); }
a.cc: In function 'int main()': a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(a); | ^~~~ | getw
s733732698
p03834
C++
#include <bits/stdc++.h> using namespace std; int main() { char s[25]; gets(s); s[5] = ' '; s[12] = ' '; puts(s); return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s381546502
p03834
C++
#include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <queue> #include <map> #include <set> #include<string.h> #include <algorithm> using namespace std; int main() { char s[25]; gets(s); for(int i=0;s[i]!='\0';++i) { if(s[i]==',') s[i]=' '; } puts(s); return 0; }
a.cc: In function 'int main()': a.cc:18:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw
s259824225
p03834
C++
#include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <queue> #include <map> #include <set> #include <algorithm> using namespace std; int main() { char s[25]; gets(s); for(int i=0;s[i]!='\0';++i) { if(s[i]==',') s[i]=' '; } puts(s); return 0; }
a.cc: In function 'int main()': a.cc:17:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(s); | ^~~~ | getw
s315425615
p03834
C++
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> #include <string> #include <map> #include <stack> #include <queue> #include <vector> #define inf 0x3f3f3f3f #define met(a,b) memset(a,b,sizeof a) #define pb push_back typedef long long ll; using namespace std; const int N = 5e2+10; const int M = 24005; const ll mod=1e9+7; using namespace std; char str[N]; int main(){ gets(str); for(int i=0;i<strlen(str);i++){ if(str[i]==',')str[i]=' '; } puts(str); return 0; }
a.cc: In function 'int main()': a.cc:22:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 22 | gets(str); | ^~~~ | getw
s504128843
p03834
C++
#include <bits/stdc++.h> int main() { string str; std::cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == ',') { str[i] = ' '; } } std::cout << str << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:3: error: 'string' was not declared in this scope 4 | string str; | ^~~~~~ a.cc:4:3: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:15: error: 'str' was not declared in this scope; did you mean 'std'? 5 | std::cin >> str; | ^~~ | std
s982232686
p03834
C++
#include <bits/stdc++.h> int main() { string str; std::cin >> str; for (int i = 0: i < str.length(); i++) { if (str[i] == ',') { str[i] = ' '; } } std::cout << str << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:3: error: 'string' was not declared in this scope 4 | string str; | ^~~~~~ a.cc:4:3: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:15: error: 'str' was not declared in this scope; did you mean 'std'? 5 | std::cin >> str; | ^~~ | std a.cc:6:14: error: initializer in range-based 'for' loop 6 | for (int i = 0: i < str.length(); i++) { | ^ a.cc:6:35: error: expected ')' before ';' token 6 | for (int i = 0: i < str.length(); i++) { | ~ ^ | ) a.cc:6:37: error: 'i' was not declared in this scope 6 | for (int i = 0: i < str.length(); i++) { | ^
s733490490
p03834
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); String[] split = s.split(','); System.out.println(split[0] + " " + split[1] + " " + split[2]); } }
Main.java:7: error: incompatible types: char cannot be converted to String String[] split = s.split(','); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s000317869
p03834
C++
#include<iostream> #include<string> using namespace std; void main() { string str; cin >> str; for (int i = 0; i < 19; i++) { if (i == 5 || i == 13) { cout << " "; } else { cout << str[i]; } } cout << endl; }
a.cc:6:1: error: '::main' must return 'int' 6 | void main() { | ^~~~
s797434370
p03834
Java
public class Beg54A { public static void main(String[] args) { final String input = args[0]; for (int i = 0; i < input.length(); i++) System.out.print(input.charAt(i) == ',' ? ' ' : input.charAt(i)); } }
Main.java:1: error: class Beg54A is public, should be declared in a file named Beg54A.java public class Beg54A { ^ 1 error
s968606279
p03834
C++
#include <stdio.h> int main(){ char s; s = "happy,newyear,enjoy"; return 0; }
a.cc: In function 'int main()': a.cc:6:6: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 6 | s = "happy,newyear,enjoy"; | ^~~~~~~~~~~~~~~~~~~~~ | | | const char*
s184256795
p03834
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; std::replace(s.begin(), s.end(), ',', ' '); cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: 'replace' is not a member of 'std' 11 | std::replace(s.begin(), s.end(), ',', ' '); | ^~~~~~~
s700109441
p03834
C++
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; replace(s.begin(), s.end(), ',', ' '); cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'replace' was not declared in this scope 11 | replace(s.begin(), s.end(), ',', ' '); | ^~~~~~~
s823617543
p03834
C
s = input() print(s.replace(',',' '))
main.c:1:1: warning: data definition has no type or storage class 1 | s = input() | ^ main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int] main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration] 1 | s = input() | ^~~~~ main.c:1:5: error: initializer element is not constant main.c:2:1: error: expected ',' or ';' before 'print' 2 | print(s.replace(',',' ')) | ^~~~~
s864255098
p03834
C++
int main(void){ string s; cin >> s; s[5]=' ',s[13]=' '; cout << s << endl; return 0;
a.cc: In function 'int main()': a.cc:2:5: error: 'string' was not declared in this scope 2 | string s; | ^~~~~~ a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> s; | ^~~ a.cc:3:12: error: 's' was not declared in this scope 3 | cin >> s; | ^ a.cc:5:5: error: 'cout' was not declared in this scope 5 | cout << s << endl; | ^~~~ a.cc:5:18: error: 'endl' was not declared in this scope 5 | cout << s << endl; | ^~~~ a.cc:6:14: error: expected '}' at end of input 6 | return 0; | ^ a.cc:1:15: note: to match this '{' 1 | int main(void){ | ^
s060476637
p03834
C++
int main(void){ string s; cin >> s; s[5]=' ',s[13]=' '; cout << s << end1; return 0;
a.cc: In function 'int main()': a.cc:2:5: error: 'string' was not declared in this scope 2 | string s; | ^~~~~~ a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> s; | ^~~ a.cc:3:12: error: 's' was not declared in this scope 3 | cin >> s; | ^ a.cc:5:5: error: 'cout' was not declared in this scope 5 | cout << s << end1; | ^~~~ a.cc:5:18: error: 'end1' was not declared in this scope 5 | cout << s << end1; | ^~~~ a.cc:6:14: error: expected '}' at end of input 6 | return 0; | ^ a.cc:1:15: note: to match this '{' 1 | int main(void){ | ^
s969430921
p03834
C++
int main(void){ string s; cin >> s; s[5]=' ',s[13]=' '; cout << s << end1; return 0;
a.cc: In function 'int main()': a.cc:2:5: error: 'string' was not declared in this scope 2 | string s; | ^~~~~~ a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> s; | ^~~ a.cc:3:12: error: 's' was not declared in this scope 3 | cin >> s; | ^ a.cc:5:5: error: 'cout' was not declared in this scope 5 | cout << s << end1; | ^~~~ a.cc:5:18: error: 'end1' was not declared in this scope 5 | cout << s << end1; | ^~~~ a.cc:6:14: error: expected '}' at end of input 6 | return 0; | ^ a.cc:1:15: note: to match this '{' 1 | int main(void){ | ^
s303202238
p03834
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<string> #include<cstring> #include<vector> #include<map> #include<list> #include<stack> #include<queue> #include<climits> //INT_MIN/MAX using namespace std; #define FOR(i,s,e) for(ll (i)=(s);(i)<(e);(i)++) #define FORR(i,s,e) for(ll (i)=(s);(i)>(e);(i)--) #define MOD 1000000007 #define llong long long #define debug(x) cout<<#x<<": "<<x<<endl typedef long long ll; llong N; /* 2017/01/18 問題 ----- abc051 a /Link ----- */ /* -----解説等----- 問題: */ int main() { cin.tie(0); ios_base::sync_with_stdio(false); string S; cin >> S; FOR(i, 0, 5) { cout << S[i]; } cout << " "; FOR(i, 6, 13) { cout << S[i] ; } cout << " "; FOR(i, 14, 19) { cout << S[i] <<; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:48:24: error: expected primary-expression before ';' token 48 | cout << S[i] <<; | ^
s227343729
p03834
C++
def slv(string): ret = '' for i in range(len(string)): if string[i] == ',': ret += ' ' else: ret += string[i] if __name__ == '__main__': s = input() print(slv(s))
a.cc:2:11: error: empty character constant 2 | ret = '' | ^~ a.cc:9:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 9 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def slv(string): | ^~~
s879623181
p03834
C++
#include <iostream>#include<string>using namespace std;string a,b,c;int main() {cin>>a>>b>>c;cout<<a<<" "<<b<<" "<<c;return 0;}
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>#include<string>using namespace std;string a,b,c;int main() {cin>>a>>b>>c;cout<<a<<" "<<b<<" "<<c;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
s176489699
p03834
C++
#include <iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s[5]=[13]=' '; cout<<s<<endl; }
a.cc: In function 'int main()': a.cc:7:7: error: expected identifier before numeric constant 7 | s[5]=[13]=' '; | ^~ a.cc: In lambda function: a.cc:7:10: error: expected '{' before '=' token 7 | s[5]=[13]=' '; | ^ a.cc: In function 'int main()': a.cc:7:11: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'char') 7 | s[5]=[13]=' '; | ^~~ a.cc:7:9: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted) 7 | s[5]=[13]=' '; | ^ a.cc:7:9: note: no known conversion for argument 1 from 'char' to 'const main()::<lambda()>&'
s255935401
p03834
C++
#include <iostream> int main() { char str[20]; cin >> str; str[5] = str[13] = ' '; cout << str << endl; return 0; }
a.cc: In function 'int main()': a.cc:4:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin >> str; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << str << 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:6:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 6 | cout << str << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s300352866
p03834
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin>>s; for(int i=0;i<s.size();i++){ cout<<(s[i]==','?" ":s[i]); } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:33: error: operands to '?:' have different types 'const char*' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 7 | cout<<(s[i]==','?" ":s[i]);
s267796024
p03834
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; cin>>s; for(int i=0;i<s.size();i++){ cout<<(s[i]==','?" ",s[i]); } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:42: error: expected ':' before ')' token 7 | cout<<(s[i]==','?" ",s[i]); | ^ | : a.cc:7:42: error: expected primary-expression before ')' token
s749340563
p03834
Java
public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int c=0,x,y,z,k,s; k=sc.nextInt(); s=sc.nextInt(); for(x=0;x<=s;i++) { for(y=0;y<=s;y++) { for(z=0;z<=s;z++) { if((x+y+z)==s) c++; } } } System.out.println(c); } }
Main.java:5: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:9: error: cannot find symbol for(x=0;x<=s;i++) ^ symbol: variable i location: class Main 3 errors
s790744018
p03834
C++
#include <iostream> #include <string> int main() { string s; std::cin >> s; for (int i=0;i<s.size();i++){ if(i==5||i==13) std::cout << ' '; else std::cout << s[i]; } std::cout << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:5:1: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:5:1: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:6:13: error: 's' was not declared in this scope 6 | std::cin >> s; | ^
s997849519
p03834
C++
#include<bits/stdc++.h> using namespace std; int main() { char S[19]; cin >> S; S[5] == ' '; S[13] == ' '; cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: 's' was not declared in this scope 10 | cout << s << endl; | ^
s700641316
p03834
C++
qweqweqweqw
a.cc:1:1: error: 'qweqweqweqw' does not name a type 1 | qweqweqweqw | ^~~~~~~~~~~
s759918405
p03834
C++
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { string a; cin >> a; string b = a.substr(0, 5),c=a.substr(6,7),d=a.substr(14,5); cout << b << " " << c << " " << d << edndl; return 0; }
a.cc: In function 'int main()': a.cc:27:46: error: 'edndl' was not declared in this scope 27 | cout << b << " " << c << " " << d << edndl; | ^~~~~
s249757523
p03834
C++
#include <stdio.h> char s1[1024]; int main() { scanf("%s", s1); for(int i = 0; i < strlen(s1); i++) { if(s1[i] == ',') s1[i] = ' '; } printf("%s\n", s1); return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'strlen' was not declared in this scope 7 | for(int i = 0; i < strlen(s1); i++) { | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 |
s053791839
p03834
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s[5]="_"; s[13]=" _"; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:6: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 9 | s[5]="_"; | ^~~ | | | const char* a.cc:10:7: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 10 | s[13]=" _"; | ^~~~ | | | const char*
s485263647
p03834
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s[5]=" "; s[13]=" "; cout<<s<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:6: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 9 | s[5]=" "; | ^~~ | | | const char* a.cc:10:7: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 10 | s[13]=" "; | ^~~ | | | const char*
s088393506
p03834
C
#include<stdio.h> #include<stdlib.h> int main() { char string[20]; int i = -1; fscanf(stdin,"%19[^\n]",string); while(string[++i]!=EOF){ if(string[i]==','){ string[i] = ' '; } printf("%s",string); return 0; }
main.c: In function 'main': main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
s199886720
p03834
C++
# -*- utf8 -*- arg = gets.chomp # arg = arg.split(" ") puts arg.gsub(/,/, " ")
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- utf8 -*- | ^ a.cc:5:3: error: invalid preprocessing directive #arg 5 | # arg = arg.split(" ") | ^~~ a.cc:3:1: error: 'arg' does not name a type 3 | arg = gets.chomp | ^~~
s483775164
p03834
C++
test submit totototo
a.cc:1:1: error: 'test' does not name a type 1 | test submit totototo | ^~~~
s768358313
p03834
C++
Test submit.Tptptp
a.cc:1:1: error: 'Test' does not name a type 1 | Test submit.Tptptp | ^~~~
s439699899
p03834
C++
てst
a.cc:1:1: error: '\U00003066\U0000ff53\U0000ff54' does not name a type 1 | てst | ^~~~~~
s243763706
p03834
C++
てst
a.cc:1:1: error: '\U00003066\U0000ff53\U0000ff54' does not name a type 1 | てst | ^~~~~~
s246782259
p03834
Java
import java.util.Scanner; public class TaskA { public static void main(String[] args) { Scanner s = new Scanner(System.in); String line = s.nextLine(); String result = ""; for(int i = 0; i < line.length(); i ++){ if(line.charAt(i)==','){ result += ' '; }else{ result += line.charAt(i); } } System.out.println(result); } }
Main.java:3: error: class TaskA is public, should be declared in a file named TaskA.java public class TaskA { ^ 1 error
s078429742
p03834
Java
public static void main(String[] args) { Scanner s = new Scanner(System.in); String line = s.nextLine(); String result = ""; for(int i = 0; i < line.length(); i ++){ if(line.charAt(i)==','){ result += ' '; }else{ result += line.charAt(i); } } System.out.println(result); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s625311208
p03834
C++
#include<bits/stdc++.h> #define int long long int #define rep(a,b,c) for(int a=b;a<c;a++) #define repm(a,b,c) for(int a=(b-1);a>=c;a--) #define pb push_back #define str string #define sf(a) scanfs("%d",&a) #define pb push_back #define mp make_pair #define Fi first #define Se second #define ALL(v) (v).begin(), (v).end() using namespace std; const int INF = 1e18 + 9; const int Mod = 1e9 + 7; inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;} inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;} typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pii> vii; str s; void ans2(); void ans3(); signed main() { cin >> s; rep(i,0,s.size()){ if(s[i]==',')cout << " "; else cout << s[i]; } cout << endl; // str ss; // cin >> ss; // cout << ss.size() << endl; // ans2(); // ans3(); return 0; } void ans2(){ int a,b,c,d; cin >> a >> b >> c >> d; str a1=""; str a2=""; str b1=""; str b2=""; rep(i,b,d){ a1+='U'; b1+='D'; } rep(j,a,c){ a2+='R'; b2+='L'; } str ans=a1; ans+=a2; ans+=b1; ans+=b2; ans+='L'; ans+=a1; ans+='U'; ans+=a2; ans+="RDR"; ans+=b1; ans+='D'; ans+=b2; ans+="LU"; cout << ans << endl; cout << ans.size() << endl; return ; } set<string> an; void ans3(){ int n,m; cin >> n >> m; rep(i,0,n){ rep(j,0,n){ if((i+j)>=(m-n)&&(i+j)<=m){ str ss=to_string(i); ss+='#'; ss+=std::to_string(j); ss+='#'; ss+=std::to_string(m-(i+j)); an.insert(ss); } } } cout << ss.size() << endl; return; }
a.cc: In function 'void ans3()': a.cc:93:13: error: 'ss' was not declared in this scope; did you mean 's'? 93 | cout << ss.size() << endl; | ^~ | s
s880425368
p03834
C++
#include <iostream> #include <string> #include <cstdio> #define ULL unsigned long long using namespace std; int main() { string str; cin.getline(str, EOF); for (int i=0; i<str.size(); i++){ if (str[i] != ' ' && str[i] != ',') cout << str[i]; if (str[i] == ',') cout << ' '; } return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: no matching function for call to 'std::basic_istream<char>::getline(std::string&, int)' 9 | cin.getline(str, EOF); | ~~~~~~~~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:740:5: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(char_type*, std::streamsize, char_type) [with _CharT = char; _Traits = std::char_traits<char>; char_type = char; std::streamsize = long int]' 740 | basic_istream<char>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:740:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/istream:520:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; char_type = char; std::streamsize = long int]' 520 | getline(char_type* __s, streamsize __n) | ^~~~~~~ /usr/include/c++/14/istream:520:26: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::basic_istream<char>::char_type*' {aka 'char*'} 520 | getline(char_type* __s, streamsize __n) | ~~~~~~~~~~~^~~
s059300835
p03834
C++
#include <iostream> #include <string> #include <cstdio> #define ULL unsigned long long using namespace std; int main() { string str; getline(stdin, str, '\n'); for (int i=0; i<str.size(); i++){ if (str[i] != ' ' && str[i] != ',') cout << str[i]; if (str[i] == ',') cout << ' '; } return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: no matching function for call to 'getline(FILE*&, std::string&, char)' 9 | getline(stdin, str, '\n'); | ~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'FILE*' 9 | getline(stdin, str, '\n'); | ~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate expects 2 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: template argument deduction/substitution failed: a.cc:9:12: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'FILE*' 9 | getline(stdin, str, '\n'); | ~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate expects 2 arguments, 3 provided In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:45: note: no known conversion for argument 1 from 'FILE*' to 'char**' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~
s321165884
p03834
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; //頂点fromkら頂点へのtoへのコストcostの辺 struct edge { int from, to, cost;}; const int MAX_V = 100; const int MAX_E = 10000; const int INF = 9999; edge es[MAX_E]; int prev[10000]; int d[MAX_V]; //最短距離 int V, E; //Vは頂点数、Eは辺の数 int used[MAX_V][MAX_V]; //s番目の頂点から各頂点への最短距離を求める void shortest_path(int s) { for(int i = 0; i < V; i++) d[i] = INF; for(int i = 0; i < V; i++) prev[i] = -1; d[s] = 0; while (true) { bool update = false; for(int i = 0; i < E; i++) { edge e = es[i]; if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) { d[e.to] = d[e.from] + e.cost; update = true; prev[e.to] = prev[e.from]; } } if(!update) break; } } vector<int> get_path(int t) { vector<int> path; for(; t != -1 ; t = prev[t]) path.push_back(t); reverse(path.begin(), path.end()); return path; } int main() { int ans = 0; cin >> V >> E; for(int i = 0; i < E; i++) { cin >> es[i].to >> es[i].from >> es[i].cost; } for(int i = 0; i < V; i++) { shortest_path(i); for(int j = 1; j < V; j++) { vector<int> path = get_path(j); for(int k = 0; k < path.size()-1; k++) { used[path[k]][path[k+1]] = 1; } } } for(int i = 0; i < E; i++) { if(!used[es[i].to][es[i].from]) { ans++; } } cout << ans << endl; return 0; }
a.cc: In function 'void shortest_path(int)': a.cc:24:30: error: reference to 'prev' is ambiguous 24 | for(int i = 0; i < V; i++) prev[i] = -1; | ^~~~ In file included from /usr/include/c++/14/string:47, 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_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [10000]' 16 | int prev[10000]; | ^~~~ a.cc:33:9: error: reference to 'prev' is ambiguous 33 | prev[e.to] = prev[e.from]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [10000]' 16 | int prev[10000]; | ^~~~ a.cc:33:22: error: reference to 'prev' is ambiguous 33 | prev[e.to] = prev[e.from]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [10000]' 16 | int prev[10000]; | ^~~~ a.cc: In function 'std::vector<int> get_path(int)': a.cc:42:23: error: reference to 'prev' is ambiguous 42 | for(; t != -1 ; t = prev[t]) path.push_back(t); | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [10000]' 16 | int prev[10000]; | ^~~~
s197807218
p03834
C++
#include <iostream> #include <string> int main() { string s; std::cin >> s ; while (true) { std::string::size_type pos = s.find(","); if (pos != std::string::npos) { s.replace(pos, 1, " "); } else { break; } } std::cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'string' was not declared in this scope 7 | string s; | ^~~~~~ a.cc:7:9: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:9:21: error: 's' was not declared in this scope 9 | std::cin >> s ; | ^ a.cc:20:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 20 | std::cout << s << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s842939912
p03834
C++
#include <iostream> #include <string> #include <cstdio> #define ULL unsigned long long using namespace std; int main() { string str; getline(con, str, EOF); for (int i=0; i<str.size(); i++){ if (str[i] != ' ' && str[i] != ',') cout << str[i]; if (str[i] == ',') cout << ' '; } return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'con' was not declared in this scope 9 | getline(con, str, EOF); | ^~~
s803741121
p03834
C++
#include <iostream> #include <string> #include <cstdio> using namespace std; int main() { string str; getline(cin, str, EOF); for (int i=0; i<str.size(); i++){ if (str[i] != ' ' && str[i] != ',') cout << str[i]; if (str[i] == ',') cout << ' '; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:12: error: no matching function for call to 'getline(std::istream&, std::string&, int)' 8 | getline(cin, str, EOF); | ~~~~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: template argument deduction/substitution failed: a.cc:8:12: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 8 | getline(cin, str, EOF); | ~~~~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate expects 2 arguments, 3 provided /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: template argument deduction/substitution failed: a.cc:8:12: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 8 | getline(cin, str, EOF); | ~~~~~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate expects 2 arguments, 3 provided In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:45: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'char**' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~
s824851250
p03834
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; //頂点fromkら頂点へのtoへのコストcostの辺 struct edge { int from, to, cost;}; const int MAX_V = 100; const int MAX_E = 10000; const int INF = 9999; edge es[MAX_E]; int prev[MAX_V]; int d[MAX_V]; //最短距離 int V, E; //Vは頂点数、Eは辺の数 int used[MAX_V][MAX_V]; //s番目の頂点から各頂点への最短距離を求める void shortest_path(int s) { for(int i = 0; i < V; i++) d[i] = INF; for(int i = 0; i < V; i++) prev[i] = -1; d[s] = 0; while (true) { bool update = false; for(int i = 0; i < E; i++) { edge e = es[i]; if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) { d[e.to] = d[e.from] + e.cost; update = true; prev[e.to] = prev[e.from]; } } if(!update) break; } } vector<int> get_path(int t) { vector<int> path; for(; t != -1 ; t = prev[t]) path.push_back(t); reverse(path.begin(), path.end()); return path; } int main() { int ans = 0; cin >> V >> E; for(int i = 0; i < E; i++) { cin >> es[i].to >> es[i].from >> es[i].cost; } for(int i = 0; i < V; i++) { shortest_path(i); for(int j = 1; j < V; j++) { vector<int> path = get_path(j); for(int k = 0; k < path.size()-1; k++) { used[path[k]][path[k+1]] = 1; } } } for(int i = 0; i < E; i++) { if(!used[es[i].to][es[i].from]) { ans++; } } cout << ans << endl; return 0; }
a.cc: In function 'void shortest_path(int)': a.cc:24:30: error: reference to 'prev' is ambiguous 24 | for(int i = 0; i < V; i++) prev[i] = -1; | ^~~~ In file included from /usr/include/c++/14/string:47, 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_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [100]' 16 | int prev[MAX_V]; | ^~~~ a.cc:33:9: error: reference to 'prev' is ambiguous 33 | prev[e.to] = prev[e.from]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [100]' 16 | int prev[MAX_V]; | ^~~~ a.cc:33:22: error: reference to 'prev' is ambiguous 33 | prev[e.to] = prev[e.from]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [100]' 16 | int prev[MAX_V]; | ^~~~ a.cc: In function 'std::vector<int> get_path(int)': a.cc:42:23: error: reference to 'prev' is ambiguous 42 | for(; t != -1 ; t = prev[t]) path.push_back(t); | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)' 244 | prev(_BidirectionalIterator __x, typename | ^~~~ a.cc:16:5: note: 'int prev [100]' 16 | int prev[MAX_V]; | ^~~~
s168656997
p03834
C
#include <stdio.h> #include<string.h> int main(){ char s[16]; int k; int s; int x; int y; int z; int g=0; int q; scanf("%d%d",&k,&s); for(x=0;x<=k;x++){ for(y=0;y<=k;y++){ for(z=0;z<=k;z++){ if(x+y+z==s){ g++; } } } } printf("%d\n",g); return 0; }
main.c: In function 'main': main.c:8:13: error: conflicting types for 's'; have 'int' 8 | int s; | ^ main.c:6:14: note: previous declaration of 's' with type 'char[16]' 6 | char s[16]; | ^
s670288193
p03834
Java
import java.io.*; public class test1 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1=br.readLine(); String str2=str1.replace(',', ' '); System.out.println(str2); } }
Main.java:2: error: class test1 is public, should be declared in a file named test1.java public class test1 { ^ 1 error
s566558601
p03834
C++
#include <iostream> using namespace std; int main() { string s; cin >> s; s[5] = s[13] = ’ ’; cout << s << endl; return 0; }
a.cc:9:20: error: extended character ’ is not valid in an identifier 9 | s[5] = s[13] = ’ ’; | ^ a.cc:9:22: error: extended character ’ is not valid in an identifier 9 | s[5] = s[13] = ’ ’; | ^ a.cc: In function 'int main()': a.cc:9:20: error: '\U00002019' was not declared in this scope 9 | s[5] = s[13] = ’ ’; | ^
s763038764
p03834
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main(void){ char h[20]; scanf("%s",h); for(i=0;i<strlen(h);i++) if(h[i]==',') h[i]=' '; printf("%s\n",h); return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'i' was not declared in this scope 8 | for(i=0;i<strlen(h);i++) | ^
s738014771
p03834
C++
#include <iostream> using namespace std; int main() { string s; cin >> s; s[5] = s[13] = ′ ′; cout << s << endl; return 0; }
a.cc:9:20: error: extended character ′ is not valid in an identifier 9 | s[5] = s[13] = ′ ′; | ^ a.cc:9:22: error: extended character ′ is not valid in an identifier 9 | s[5] = s[13] = ′ ′; | ^ a.cc: In function 'int main()': a.cc:9:20: error: '\U00002032' was not declared in this scope 9 | s[5] = s[13] = ′ ′; | ^
s672039787
p03834
C++
#include <iostream> using namespace std; int main() { string s; cin >> s; s[5] = s[13] = ‘ ‘; cout << s << endl; return 0; }
a.cc:9:20: error: extended character ‘ is not valid in an identifier 9 | s[5] = s[13] = ‘ ‘; | ^ a.cc:9:22: error: extended character ‘ is not valid in an identifier 9 | s[5] = s[13] = ‘ ‘; | ^ a.cc: In function 'int main()': a.cc:9:20: error: '\U00002018' was not declared in this scope 9 | s[5] = s[13] = ‘ ‘; | ^
s351770735
p03834
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ char s[22]; while(gets(s)){ int len = strlen(s); for(int i = 0;i < len;++i){ if(s[i] == ',') printf(" "); else printf("%c",s[i]); } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | while(gets(s)){ | ^~~~ | getw
s317639873
p03834
C++
#include <iostream> int main() { std::string s; std::cin >> s; for (int i = 0; i < s.size(); ++i) { if (s[i] == ',') std::cout << " "; else std::cout << s[i]; } std::cout << std::endl;
a.cc: In function 'int main()': a.cc:11:28: error: expected '}' at end of input 11 | std::cout << std::endl; | ^ a.cc:3:12: note: to match this '{' 3 | int main() { | ^
s569304369
p03834
C
#include<stdio.h> int main() { char a; for(;;){ scanf("%c",&a); printf("%c",a); if(a == ,){ printf(" "); } } return 0; }
main.c: In function 'main': main.c:8:13: error: expected expression before ',' token 8 | if(a == ,){ | ^
s057880878
p03834
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ char s[22]; while(gets(s)){ int len = strlen(s); for(int i = 0;i < len;++i){ if(s[i] == ',') printf(" "); else printf("%c",s[i]); } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | while(gets(s)){ | ^~~~ | getw
s058240556
p03834
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin >>s; s[5] = " "; s[13] = " "; s[19] = " "; cout << s <<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 7 | s[5] = " "; | ^~~ | | | const char* a.cc:8:9: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 8 | s[13] = " "; | ^~~ | | | const char* a.cc:9:9: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 9 | s[19] = " "; | ^~~ | | | const char*
s946498093
p03834
C
#include <stdio.h> int main() { char c; while((c = getchar()) != EOF){ if(c == ',') c=' '; putchar(c); } retrurn(0); }
main.c: In function 'main': main.c:10:2: error: implicit declaration of function 'retrurn' [-Wimplicit-function-declaration] 10 | retrurn(0); | ^~~~~~~
s192366294
p03834
C++
#include<bits/stdc++.h> using namespace std; int main() { string st=""; char s[100]; gets(s); for(int i=0;s[i];i++){ if(isalpha(s[i])) st+=s[i]; else st+=" "; } cout<<st<<endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s213841953
p03834
Java
import java.util.Scanner; /** * Created by sonetsuyoshi on 2016/07/31. */ public class Main { static public void main(String[] args) { Scanner sc = new Scanner(System.in); char[] chs = sc.nextLine().toCharArray(); chs[5] = ' '; chs[13] = ' '; for(char ch: chs) System.out.print(ch); System.out.println(); } @Test public void test() { Main m = new Main(); } }
Main.java:18: error: cannot find symbol @Test ^ symbol: class Test location: class Main 1 error
s186995369
p03834
C++
#include <iostream> #include <string> using namespace std; int main() { string input; cin << input; input[5] = input[13] = ' '; cout << input << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 9 | cin << input; | ~~~ ^~ ~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} 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/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/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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /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:9:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << input; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ 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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << input; | ^~~~~ /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:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:9:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << input; | ^~~~~ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = std::__cxx11::basic_string<char>]': a.cc:9:12: required from here 9 | cin << input; | ^~~~~ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~
s064072074
p03834
C++
s = gets.split(",") puts s .gsub(/,/," ")
a.cc:1:1: error: 's' does not name a type 1 | s = gets.split(",") | ^
s531300784
p03834
C++
main = do s <- getLine putStrLn $ map (\c -> if c == ',' then ' ' else c) s
a.cc:3:19: error: stray '\' in program 3 | putStrLn $ map (\c -> if c == ',' then ' ' else c) s | ^ a.cc:1:1: error: 'main' does not name a type 1 | main = do | ^~~~
s220329605
p03834
C++
#include<bits/stdc++.h> using namespace std; int main() { string st=""; char s[100]; gets(s); for(int i=0;s[i];i++){ if(isalpha(s[i])) st+=s[i]; else st+=" "; } cout<<st<<endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s311654193
p03834
C++
//========================================================================== // // Bismillahir-Rahmanir-Rahim // // ========================================================================== #include <bits/stdc++.h> #define ll long long int #define f(x,y,z) for(int x=y;x<z;x++) #define pii pair<int,int> #define pll pair<ll,ll> #define CLR(a) memset(a,0,sizeof(a)) #define SET(a) memset(a,-1,sizeof(a)) #define N 100010 #define M 1000000007 #define pi acos(-1.0) #define ff first #define ss second #define pb push_back #define inf (int)1e9 #define eps 1e-9 using namespace std; int dx[]={0,0,1,-1,-1,-1,1,1}; int dy[]={1,-1,0,0,-1,1,1,-1}; template < class T> inline T biton(T n,T pos){return n |((T)1<<pos);} template < class T> inline T bitoff(T n,T pos){return n & ~((T)1<<pos);} template < class T> inline T ison(T n,T pos){return (bool)(n & ((T)1<<pos));} template < class T> inline T gcd(T a, T b){while(b){a%=b;swap(a,b);}return a;} template <typename T> string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); } inline int nxt(){int aaa;scanf("%d",&aaa);return aaa;} inline ll lxt(){ll aaa;scanf("%lld",&aaa);return aaa;} inline double dxt(){double aaa;scanf("%lf",&aaa);return aaa;} template <class T> inline T bigmod(T p,T e,T m){T ret = 1; for(; e > 0; e >>= 1){ if(e & 1) ret = (ret * p) % m;p = (p * p) % m; } return (T)ret;} #define sayed #ifdef sayed #define debug(args...) {cerr<<"Debug: "; dbg,args; cerr<<endl;} #else #define debug(args...) // Just strip off all debug tokens #endif struct debugger{ template<typename T> debugger& operator , (const T& v){ cerr<<v<<" "; return *this; } }dbg; ///******************************************START****************************************** vector<string> v; int main(){ //freopen("out.txt","w",stdout); //ios_base::sync_with_stdio(false); //cin.tie(0); string s; cin>>s; s+=','; string temp; for(int i=0;i<s.length();i++){ if(s[i]==','){ v.pb(temp); temp.clear(); continue; } temp+=s[i]; } for(int i=0;i<v.length();i++){ if(i) cout<<" "; cout<<v[i]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:66:20: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length' 66 | for(int i=0;i<v.length();i++){ | ^~~~~~
s441976102
p03834
C++
#define SORT(v) sort(v.begin(), v.end()) #include "iostream" #include "map" #include "vector" #include <stack> #include "cstdlib" #include <algorithm> #include <cstdarg> #include "ane.cpp" #define INF (int)1e9 #define NMAX 200 #define MMAX 200 #define MOD 100000 using namespace std; // コメントアウトするとdb_printf()を実行しない #define DEBUG // デバッグ用printf void db_printf(const char* format, ...){ #ifndef DEBUG return; #endif va_list arg; va_start(arg, format); vprintf(format, arg); // コンソールに出力 va_end(arg); } // n次元配列の初期化。第2引数の型のサイズごとに初期化していく。 template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } typedef pair<int, int> P; int N,M,dp[NMAX][MMAX] = {}; string s; static const int di[] = {-1, 0, 1, -1, 1, -1, 0, 1}; static const int dj[] = {-1, -1, -1, 0, 0, 1, 1, 1}; int ans = 0; void solve(){ // 解答アルゴリズム for (int i = 0; i < s.size(); ++i) { if (s[i] == ',') { s[i] = ' '; } } } void debug(){ // デバッグ用出力 } void answer(){ // 解答出力 cout << s << endl; } int main(int argc, char const *argv[]) { // 入力の読み込み,番兵法 ios::sync_with_stdio(false); Fill(dp, -1); cin >> s; solve(); #ifdef DEBUG debug(); #endif answer(); return 0; }
a.cc:9:10: fatal error: ane.cpp: No such file or directory 9 | #include "ane.cpp" | ^~~~~~~~~ compilation terminated.
s280160413
p03834
C++
#include <iostream> #include <iomanip> #include <ios> #include <sstream> #include <cstdio> #include <algorithm> #include <cstdlib> #include <cmath> #include <numeric> #include <regex> #include <utility> #include <random> #include <cstddef> #include <cstdint> #include <cfloat> #include <limits> #include <array> #include <bitset> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <valarray> #include <vector> #include <deque> #include <forward_list> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; replace(ALL(s), ',', ' '); cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:47:11: error: 'ALL' was not declared in this scope 47 | replace(ALL(s), ',', ' '); | ^~~
s825382075
p03834
Java
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine(),","); System.out.print(st.nextToken()+" "+st.nextToken()+" "+st.nextToken()); } }
Main.java:6: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main Main.java:6: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main 2 errors
s785712367
p03834
Java
import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine(),","); System.out.print(st.nextToken()+" "+st.nextToken()+" "+st.nextToken()); } }
Main.java:6: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main Main.java:6: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main 2 errors
s086581614
p03834
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<math.h> #include<map> #define rep(i,n,m) for(int i=n;i<(int)(m);i++) using namespace std; int main() { string str; cin >> str; rep(i, 0, str.length) { if (str[i] == ',') { str[i] = ' ' ; } } cout << str << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 19 | rep(i, 0, str.length) { | ^ a.cc:9:40: note: in definition of macro 'rep' 9 | #define rep(i,n,m) for(int i=n;i<(int)(m);i++) | ^
s882527352
p03834
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int cnt = 0; String str = ""; String s1 = sc.next(); String str = s1.replaceAll(",", " "); System.out.print(str); System.out.println(); } }
Main.java:13: error: variable str is already defined in method main(String[]) String str = s1.replaceAll(",", " "); ^ 1 error
s202481685
p03834
Java
import java.io.*; class Main { static Random random = new Random(); public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine(),","); System.out.print(st.nextToken()+" "+st.nextToken()+" "+st.nextToken()); } }
Main.java:4: error: cannot find symbol static Random random = new Random(); ^ symbol: class Random location: class Main Main.java:4: error: cannot find symbol static Random random = new Random(); ^ symbol: class Random location: class Main Main.java:8: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main Main.java:8: error: cannot find symbol StringTokenizer st=new StringTokenizer(br.readLine(),","); ^ symbol: class StringTokenizer location: class Main 4 errors
s092491015
p03834
C++
#include "string/replace_all.hpp" int main() { string s; cin >> s; replaceAll(s, ",", " "); cout << s << endl; }
a.cc:1:10: fatal error: string/replace_all.hpp: No such file or directory 1 | #include "string/replace_all.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s907375773
p03834
C++
package abc051; import java.util.*; class A{ static Scanner s = new Scanner(System.in); public static void main(String[] args) { System.out.println(s.next().replaceAll(",", " ")); } }
a.cc:1:1: error: 'package' does not name a type 1 | package abc051; | ^~~~~~~ a.cc:3:1: error: 'import' does not name a type 3 | import java.util.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:16: error: 'Scanner' does not name a type 5 | static Scanner s = new Scanner(System.in); | ^~~~~~~ a.cc:6:15: error: expected ':' before 'static' 6 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:6:33: error: 'String' has not been declared 6 | public static void main(String[] args) { | ^~~~~~ a.cc:6:42: error: expected ',' or '...' before 'args' 6 | public static void main(String[] args) { | ^~~~ a.cc:9:2: error: expected ';' after class definition 9 | } | ^ | ; a.cc: In static member function 'static void A::main(int*)': a.cc:7:17: error: 'System' was not declared in this scope 7 | System.out.println(s.next().replaceAll(",", " ")); | ^~~~~~ a.cc:7:36: error: 's' was not declared in this scope 7 | System.out.println(s.next().replaceAll(",", " ")); | ^
s301524536
p03834
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < n; i++) { if (s[i] == ',') s[i] = ' '; } cout << s << endl; }
a.cc: In function 'int main()': a.cc:7:29: error: 'n' was not declared in this scope 7 | for (int i = 0; i < n; i++) { | ^
s493756203
p03835
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i < (int)(n+1); i++) const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (long long i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(ll n, ll k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; if(n==k){ return 1; } return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } // vector<vector<int>> A(3, vector<int>(4)); int main() { ll k,s; cin>>k>>s; ll ans=0; for(int i=0; i<k; i++){ for(int j=0; j<k; j++){ if(S-i-j<=s&&0<=S-i-j){ ans++; } } } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:40:16: error: 'S' was not declared in this scope 40 | if(S-i-j<=s&&0<=S-i-j){ | ^
s118915026
p03835
C++
#include<bits/stdc.h> using namespace std; int main(){ int k,s; cin>>k>>s; int count=0; for(int i=0;i<=k;i++){ for(int j=0;i<=k;i++){ for(int l=0;i<=k;i++){ if(i+j+l==s) count++; } } } cout<<count<<endl; return 0; }
a.cc:1:9: fatal error: bits/stdc.h: No such file or directory 1 | #include<bits/stdc.h> | ^~~~~~~~~~~~~ compilation terminated.
s299464439
p03835
C++
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int k , s; int ans = 0; cin >> k >> s; for(int i = 0; i <= k; i++){ for(int j = 0; j <= k; j++){ for(int z = 0; z <= k; z++){ if(i + j + z == s) ans++; } } } cout << ans << " "; re
a.cc: In function 'int main()': a.cc:19:2: error: 're' was not declared in this scope 19 | re | ^~ a.cc:19:4: error: expected '}' at end of input 19 | re | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s154348642
p03835
C++
#include<algorithm> #include<bitset> #include<cmath> #include<complex> #include<deque> #include<functional> #include<iomanip> #include<iostream> #include<iterator> #include<map> #include<numeric> #include<queue> #include<set> #include<stack> #include<string> #include<unordered_map> #include<unordered_set> #include<utility> #include<vector> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define FOR(i,x,n) for(int i=x; i<(n); i++) #define ALL(n) begin(n),end(n) #define MOD (1000000007) #define INF (2e9) #define INFL (2e18) typedef long long ll; typedef unsigned int ui; typedef unsigned long long ull; using vint=vector<int>; using vll=vector<ll>; template<class T>using arr=vector<vector<T>>; template<class T>int popcount(T &a){int c=0; rep(i, 8*(int)sizeof(a)){if((a>>i)&1) c++;} return c;} template<class T>void pr(T x){cout << x << endl;} template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);} template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);} template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } int main() { int k, s; cin >> k >> s; int ans = 0: rep(x, k){ rep(y, k){ if(s - x - y >= 0) ans++; } } pr(ans); return 0;}
a.cc: In function 'int main()': a.cc:44:16: error: expected ',' or ';' before ':' token 44 | int ans = 0: | ^ a.cc:45:9: error: 'x' was not declared in this scope 45 | rep(x, k){ | ^ a.cc:21:31: note: in definition of macro 'rep' 21 | #define rep(i,n) for(int i=0; i<(n); i++) | ^
s168105881
p03835
C++
int main() { long long k,s;cin>>k>>s; long long cnt =0; for (size_t x = 0; x <= k; x++) { for (size_t y = 0; y <= k; y++) { long long z = s - (x+y); if (0 <= z && z <= k) { cnt++; } } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:3:17: error: 'cin' was not declared in this scope 3 | long long k,s;cin>>k>>s; | ^~~ a.cc:5:8: error: 'size_t' was not declared in this scope 5 | for (size_t x = 0; x <= k; x++) | ^~~~~~ a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | int main() a.cc:5:22: error: 'x' was not declared in this scope 5 | for (size_t x = 0; x <= k; x++) | ^ a.cc:7:16: error: expected ';' before 'y' 7 | for (size_t y = 0; y <= k; y++) | ^~ | ; a.cc:7:24: error: 'y' was not declared in this scope 7 | for (size_t y = 0; y <= k; y++) | ^ a.cc:18:3: error: 'cout' was not declared in this scope 18 | cout << cnt << endl; | ^~~~ a.cc:18:18: error: 'endl' was not declared in this scope 18 | cout << cnt << endl; | ^~~~
s916983729
p03835
C++
#include <bits/stdc++.h> using namespace std; int main() { int K, S; cin >> K >> S; int count = 0; for (int x = 0; x <= K; i++){ for (int y = 0; y <= K; j++){ if (S - x - y >= 0 && S - x - y <= K) count++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:10:27: error: 'i' was not declared in this scope 10 | for (int x = 0; x <= K; i++){ | ^ a.cc:11:29: error: 'j' was not declared in this scope 11 | for (int y = 0; y <= K; j++){ | ^
s593868420
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s; int t=0; cin>>k>>s; if(s>3*k){ cout<<0; return<<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){ t++; } } } } cout<<t; }
a.cc: In function 'int main()': a.cc:10:23: error: expected primary-expression before '<<' token 10 | return<<0; | ^~
s944678809
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s; int t=0; cin>>k>>s; for(int x=0;x<=k;x++){ for(int y=0;y<=k;y++){ for(int y=0;y<=k;y++){ if(x+y+z==s){ t++; } } } } cout<<t; }
a.cc: In function 'int main()': a.cc:11:40: error: 'z' was not declared in this scope 11 | if(x+y+z==s){ | ^
s175327121
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s; int t=0; cin>>k>>s; for(intx=0;x<k;x++){ for(inty=0;y<k;y++){ for(inty=0;y<k;y++){ if(x+y+z==s){ t++; } } } } cout<<t; }
a.cc: In function 'int main()': a.cc:8:13: error: 'intx' was not declared in this scope; did you mean 'int'? 8 | for(intx=0;x<k;x++){ | ^~~~ | int a.cc:8:20: error: 'x' was not declared in this scope 8 | for(intx=0;x<k;x++){ | ^ a.cc:9:21: error: 'inty' was not declared in this scope; did you mean 'int'? 9 | for(inty=0;y<k;y++){ | ^~~~ | int a.cc:9:28: error: 'y' was not declared in this scope 9 | for(inty=0;y<k;y++){ | ^ a.cc:11:40: error: 'z' was not declared in this scope 11 | if(x+y+z==s){ | ^
s251880648
p03835
C++
#include <iostream> using namespace std; int main(){ int k,s; int t=0; cin<<k<<s; for(intx=0;x<k;x++){ for(inty=0;y<k;y++){ for(inty=0;y<k;y++){ if(x+y+z==s){ t++; } } } } cout<<t; }
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<<k<<s; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:7:12: note: candidate: 'operator<<(int, int)' (built-in) 7 | cin<<k<<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/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/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<<k<<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<<k<<s; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /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<<k<<s; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /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<<k<<s; | ^ /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<<k<<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<<k<<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<<k<<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<<k<<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<<k<<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<<k<<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<<k<<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<<k<<s; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684: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<<k<<s; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689: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<<k<<s; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:7:7: required from here 7 | cin<<k<<s; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:8:13: error: 'intx' was not declared in this scope; did you mean 'int'? 8 | for(intx=0;x<k;x++){ | ^~~~ | int a.cc:8:20: error: 'x' was not declared in this scope 8 | for(intx=0;x<k;x++){ | ^ a.cc:9:21: error: 'inty' was not declared in this scope; did you mean 'int'? 9 | for(inty=0;y<k;y++){ | ^~~~ | int a.cc:9:28: error: 'y' was not declared in t