submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s001777394
p03777
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <queue> #include <set> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) using namespace std; typedef long long int lli; int main(){ char a,b; cin>>a>>b; if(a=="H"&&b=="H")cout<<"H"; if(a=="H"&&b=="D")cout<<"D"; if(a=="D"&&b=="H")cout<<"D"; if(a=="D"&&b=="D")cout<<"H"; }
a.cc: In function 'int main()': a.cc:17:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | if(a=="H"&&b=="H")cout<<"H"; | ~^~~~~ a.cc:17:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | if(a=="H"&&b=="H")cout<<"H"; | ~^~~~~ a.cc:18:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | if(a=="H"&&b=="D")cout<<"D"; | ~^~~~~ a.cc:18:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | if(a=="H"&&b=="D")cout<<"D"; | ~^~~~~ a.cc:19:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 19 | if(a=="D"&&b=="H")cout<<"D"; | ~^~~~~ a.cc:19:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 19 | if(a=="D"&&b=="H")cout<<"D"; | ~^~~~~ a.cc:20:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(a=="D"&&b=="D")cout<<"H"; | ~^~~~~ a.cc:20:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(a=="D"&&b=="D")cout<<"H"; | ~^~~~~
s720352679
p03777
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <functional> #include <queue> #include <set> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) using namespace std; typedef long long int lli; int main(){ char a.b; cin>>a>>b; if(a=="H"&&b=="H")cout<<"H"; if(a=="H"&&b=="D")cout<<"D"; if(a=="D"&&b=="H")cout<<"D"; if(a=="D"&&b=="D")cout<<"H"; }
a.cc: In function 'int main()': a.cc:15:15: error: expected initializer before '.' token 15 | char a.b; | ^ a.cc:16:14: error: 'a' was not declared in this scope 16 | cin>>a>>b; | ^ a.cc:16:17: error: 'b' was not declared in this scope 16 | cin>>a>>b; | ^
s441958041
p03777
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main(){ string a, b ; cin >> a >> b ; if(a==b) cout << "H" << endl; else cout << "D" << endl }
a.cc: In function 'int main()': a.cc:9:25: error: expected ';' before '}' token 9 | else cout << "D" << endl | ^ | ; 10 | } | ~
s364280825
p03777
C++
use std::env; use std::io::*; use std::str::*; fn read<T: FromStr>() -> T { let stdin = stdin(); let s = stdin.bytes().map(|c| c.unwrap() as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect::<String>(); s.parse::<T>().ok().unwrap() } fn main() { // main の引数 /* 引数なしのときargs.len() = 1; */ let args: Vec<String> = env::args().collect(); let a = read::<String>().chars().collect(); let b = read::<String>().chars().collect(); if a[0] == b[0] { println!("H"); }else { println!("D"); } } /* AtCoder AtCoDeer H H 1 H D 0 D H 0 D D 1 */
a.cc:1:1: error: 'use' does not name a type 1 | use std::env; | ^~~ a.cc:2:1: error: 'use' does not name a type 2 | use std::io::*; | ^~~ a.cc:3:1: error: 'use' does not name a type 3 | use std::str::*; | ^~~ a.cc:5:1: error: 'fn' does not name a type 5 | fn read<T: FromStr>() -> T { | ^~ a.cc:14:1: error: 'fn' does not name a type 14 | fn main() { | ^~
s845424627
p03777
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); if(a == "H")System.out.println(b); else if(a == "D" && b == "H")System.println("D"); else System.out.println("H"); } }
Main.java:8: error: cannot find symbol else if(a == "D" && b == "H")System.println("D"); ^ symbol: method println(String) location: class System 1 error
s692347229
p03777
C
#include <stdio.h> int main(){ char a,b; scanf("%s %s",&a,&b); if(a==b){ printf("H") }else{ printf("D") } }
main.c: In function 'main': main.c:6:28: error: expected ';' before '}' token 6 | printf("H") | ^ | ; 7 | }else{ | ~ main.c:8:28: error: expected ';' before '}' token 8 | printf("D") | ^ | ; 9 | } | ~
s189102662
p03777
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String args[]) { FastReader sc = new FastReader(); String a = sc.next(); String b = sc.next(); if (a.equals("H") && b.equals("H") || a.equals("D") && b.equals("D")) System.out.println("H"); else System.out.println("D"); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.util.StringTokenizer; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s072141393
p03777
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<utility> #define REP(i,n) for(int i = 0;i < (n);i++) #define pb push_back using namespace std; const int INF = 1e9; typedef long long ll; int main(){ int x,y; string s,t; cin >> s >> t; x = 1; if(s == "D") x *= -1; if(t == "D") x *= -1; if(x == 1) cout << "H" << endl; else cout << "D" << endl; return 0;
a.cc: In function 'int main()': a.cc:26:12: error: expected '}' at end of input 26 | return 0; | ^ a.cc:12:11: note: to match this '{' 12 | int main(){ | ^
s089812666
p03777
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static PrintWriter out; static InputReader ir; static void solve() { out.println(rec(conv(ir.next().charAt(0)) ^ conv(ir.next().charAt(0)))); } static int conv(char c) { return c == 'H' ? 1 : 0; } static String rec(int a) { return a == 1 ? "D" : "H"; } public static void main(String[] args) throws Exception { ir = new InputReader(System.in); out = new PrintWriter(System.out); solve(); out.flush(); } static class InputReader { private InputStream in; private byte[] buffer = new byte[1024]; private int curbuf; private int lenbuf; public InputReader(InputStream in) { this.in = in; this.curbuf = this.lenbuf = 0; } public boolean hasNextByte() { if (curbuf >= lenbuf) { curbuf = 0; try { lenbuf = in.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return false; } return true; } private int readByte() { if (hasNextByte()) return buffer[curbuf++]; else return -1; } private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } private void skip() { while (hasNextByte() && isSpaceChar(buffer[curbuf])) curbuf++; } public boolean hasNext() { skip(); return hasNextByte(); } public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public int nextInt() { if (!hasNext()) throw new NoSuchElementException(); int c = readByte(); while (isSpaceChar(c)) c = readByte(); boolean minus = false; if (c == '-') { minus = true; c = readByte(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res = res * 10 + c - '0'; c = readByte(); } while (!isSpaceChar(c)); return (minus) ? -res : res; } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); int c = readByte(); while (isSpaceChar(c)) c = readByte(); boolean minus = false; if (c == '-') { minus = true; c = readByte(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res = res * 10 + c - '0'; c = readByte(); } while (!isSpaceChar(c)); return (minus) ? -res : res; } public double nextDouble() { return Double.parseDouble(next()); } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } public char[][] nextCharMap(int n, int m) { char[][] map = new char[n][m]; for (int i = 0; i < n; i++) map[i] = next().toCharArray(); return map; } } } import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static PrintWriter out; static InputReader ir; static void solve() { out.println(rec(conv(ir.next().charAt(0)) ^ conv(ir.next().charAt(0)))); } static int conv(char c) { return c == 'H' ? 1 : 0; } static String rec(int a) { return a == 1 ? "D" : "H"; } public static void main(String[] args) throws Exception { ir = new InputReader(System.in); out = new PrintWriter(System.out); solve(); out.flush(); } static class InputReader { private InputStream in; private byte[] buffer = new byte[1024]; private int curbuf; private int lenbuf; public InputReader(InputStream in) { this.in = in; this.curbuf = this.lenbuf = 0; } public boolean hasNextByte() { if (curbuf >= lenbuf) { curbuf = 0; try { lenbuf = in.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return false; } return true; } private int readByte() { if (hasNextByte()) return buffer[curbuf++]; else return -1; } private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } private void skip() { while (hasNextByte() && isSpaceChar(buffer[curbuf])) curbuf++; } public boolean hasNext() { skip(); return hasNextByte(); } public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public int nextInt() { if (!hasNext()) throw new NoSuchElementException(); int c = readByte(); while (isSpaceChar(c)) c = readByte(); boolean minus = false; if (c == '-') { minus = true; c = readByte(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res = res * 10 + c - '0'; c = readByte(); } while (!isSpaceChar(c)); return (minus) ? -res : res; } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); int c = readByte(); while (isSpaceChar(c)) c = readByte(); boolean minus = false; if (c == '-') { minus = true; c = readByte(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res = res * 10 + c - '0'; c = readByte(); } while (!isSpaceChar(c)); return (minus) ? -res : res; } public double nextDouble() { return Double.parseDouble(next()); } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } public char[][] nextCharMap(int n, int m) { char[][] map = new char[n][m]; for (int i = 0; i < n; i++) map[i] = next().toCharArray(); return map; } } }
Main.java:158: error: class, interface, enum, or record expected import java.io.IOException; ^ Main.java:159: error: class, interface, enum, or record expected import java.io.InputStream; ^ Main.java:160: error: class, interface, enum, or record expected import java.io.PrintWriter; ^ Main.java:161: error: class, interface, enum, or record expected import java.util.InputMismatchException; ^ Main.java:162: error: class, interface, enum, or record expected import java.util.NoSuchElementException; ^ 5 errors
s002508207
p03777
C++
#include <bits/stdc++.h> int main(){ std::string a, b; std::cin >> a >> b; if(a == 'H' || b == 'H') std::cout << "H\n"; else if(a == 'D' || b == 'H') std::cout << "H\n"; else std::cout << "D\n"; return 0; }
a.cc: In function 'int main()': a.cc:7:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, 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/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/14/bits/new_allocator.h:215:9: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'const std::__new_allocator<_Tp>' and 'char' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'const _CharT*' and 'char' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:7:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 7 | if(a == 'H' || b == 'H') std::cout << "H\n"; | ^~~ In file included from /usr/include/c++/14/functional:59, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/
s890803909
p03777
C++
#include <bits/stdc++.h> #include <cmath> #define out(n) std::cout << "n\n" int main(){ std::string a, b; std::cin >> a >> b; if(a == 'H' || b == 'H') out(H); else if(a == 'D' || b == 'H') out(H); else out(D); return 0; }
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 10 | if(a == 'H' || b == 'H') out(H); | ~ ^~ ~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, 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/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/14/bits/new_allocator.h:215:9: note: template argument deduction/substitution failed: a.cc:10:13: note: mismatched types 'const std::__new_allocator<_Tp>' and 'char' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:10:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:10:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:10:13: note: mismatched types 'const _CharT*' and 'char' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:10:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:10:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 10 | if(a == 'H' || b == 'H') out(H); | ^~~ In file included from /usr/include/c++/14/functional:59, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/std_function.h:743:5: note: candidate: 'template<class _Res, class ... _Args> bool std::operator==(const function<_Res(_ArgTypes ...)>&, nullptr_t)' 743 | operator==(cons
s272547437
p03777
C++
#include <stdio.h> int main(void){char a, b;scanf("%c %c", &a, &b);if(a == 'H'){printf("%c\n", b);}else if(b == 'H'){printf("B\n");}else{printf("H"\n);}return 0;}
a.cc:3:129: error: stray '\' in program 3 | int main(void){char a, b;scanf("%c %c", &a, &b);if(a == 'H'){printf("%c\n", b);}else if(b == 'H'){printf("B\n");}else{printf("H"\n);}return 0;} | ^ a.cc: In function 'int main()': a.cc:3:129: error: expected ')' before 'n' 3 | int main(void){char a, b;scanf("%c %c", &a, &b);if(a == 'H'){printf("%c\n", b);}else if(b == 'H'){printf("B\n");}else{printf("H"\n);}return 0;} | ~ ^~ | )
s239578893
p03777
C++
#include <iostream> using namespace std; int main(){ char a,b; cin >> A >> b; if (a == b){ cout << "H" <<endl; }else{ cout << "D" <<endl; } }
a.cc: In function 'int main()': a.cc:5:20: error: 'A' was not declared in this scope 5 | char a,b; cin >> A >> b; | ^
s105076362
p03777
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int a, b; bool ans; cin >> a >> b; ans = (b == 'H' ? true : false); if (a == 'D') ans != ans; cout << (ans == true ? "H" ? "D") << endl; }
a.cc: In function 'int main()': a.cc:10:37: error: expected ':' before ')' token 10 | cout << (ans == true ? "H" ? "D") << endl; | ^ | : a.cc:10:37: error: expected primary-expression before ')' token a.cc:10:37: error: expected ':' before ')' token 10 | cout << (ans == true ? "H" ? "D") << endl; | ^ | : a.cc:10:37: error: expected primary-expression before ')' token
s721383659
p03777
C++
#include <bits/stdc++.h> using namespace std; struct edge {int /*from,*/to,cost;}; typedef long long ll; typedef pair<int,int> P; typedef pair<pair<int,int>,int> PP; typedef vector<int> VI; typedef vector<long long int> VL; typedef vector<edge> VE; static const int MOD = 1000000007; static const int INF = 2147483647; //static const long long INF = 9223372000000000000; //static const long long INF = 9223372000000000000/2; //static const int INF = 1000010000; //int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0}; //int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0}; //int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0}; //int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0}; #define pb push_back #define mp make_pair #define all(x) (x).begin(),(x).end() #define fi first #define se second #define np next_permutation #define pq priority_queue #define SZ(a) int((a).size()) #define LEN(a) int((a).length()) #define MAX(a,b,c) max((a),max((b),(c))) #define MIN(a,b,c) min((a),min((b),(c))) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,x) for(int i=0;i<(int)(x);i++) #define REP1(i,x) for(int i=1;i<=(int)(x);i++) #define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--) #define RREP1(i,x) for(int i=((int)(x));i>0;i--) //#define int ll signed main(){ char a,b; scanf("%c %c",&a,&b); (a==b) ? putc("H") : putc("D"); return 0; }
a.cc: In function 'int main()': a.cc:42:19: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 42 | (a==b) ? putc("H") : putc("D"); | ^~~ | | | const char* a.cc:42:18: error: too few arguments to function 'int putc(int, FILE*)' 42 | (a==b) ? putc("H") : putc("D"); | ~~~~^~~~~ 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, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/stdio.h:612:12: note: declared here 612 | extern int putc (int __c, FILE *__stream) __nonnull ((2)); | ^~~~ a.cc:42:31: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 42 | (a==b) ? putc("H") : putc("D"); | ^~~ | | | const char* a.cc:42:30: error: too few arguments to function 'int putc(int, FILE*)' 42 | (a==b) ? putc("H") : putc("D"); | ~~~~^~~~~ /usr/include/stdio.h:612:12: note: declared here 612 | extern int putc (int __c, FILE *__stream) __nonnull ((2)); | ^~~~
s547046541
p03777
C++
#include <iostream> using namespace std; #define PrintLn(X) cout << X << endl #define Rep(i, n) for(int i = 0; i < (int)(n); ++i) int main(void) { char a, b; cin >> a >> b; PrintLn(a == b ? 'H' : 'D'); return 0; }
a.cc: In function 'int main()': a.cc:11:19: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'char') 11 | PrintLn(a == b ? 'H' : 'D'); | ^~ ~ | | | char a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ a.cc:11:19: note: candidate: 'operator==(int, int)' (built-in) 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ a.cc:11:19: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ In file included from /usr/include/c++/14/string:43, 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/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:11:22: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:11:22: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | PrintLn(a == b ? 'H' : 'D'); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^ /usr/inc
s021975271
p03777
C++
int main(){ char a,b; scanf("%c%c",&a,&b); if(a=='H'&&b=='H')printf("H\n"); else if(a=='D'&&b=='D')printf("H\n"); else printf("D\n"); }
a.cc: In function 'int main()': a.cc:3:9: error: 'scanf' was not declared in this scope 3 | scanf("%c%c",&a,&b); | ^~~~~ a.cc:4:27: error: 'printf' was not declared in this scope 4 | if(a=='H'&&b=='H')printf("H\n"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){ a.cc:5:32: error: 'printf' was not declared in this scope 5 | else if(a=='D'&&b=='D')printf("H\n"); | ^~~~~~ a.cc:5:32: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:6:14: error: 'printf' was not declared in this scope 6 | else printf("D\n"); | ^~~~~~ a.cc:6:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s562099355
p03777
C++
A,B = input().split() if A == B: print('H') else: print('D')
a.cc:1:1: error: 'A' does not name a type 1 | A,B = input().split() | ^
s608715872
p03777
C
#include<stdio.h> int main(void){ char a,b; scanf("%s %s",&a,&b); if( a == H || a == D && b == H || b == D ){ if( a == H && b == H){ printf("H"); } else if( a == H && b == D){ printf("D"); } else if( a == D && b == H){ printf("D"); } else if( a == D && b == D){ printf("H"); } }else{ printf("error"); } }
main.c: In function 'main': main.c:10:14: error: 'H' undeclared (first use in this function) 10 | if( a == H || a == D && b == H || b == D ){ | ^ main.c:10:14: note: each undeclared identifier is reported only once for each function it appears in main.c:10:24: error: 'D' undeclared (first use in this function) 10 | if( a == H || a == D && b == H || b == D ){ | ^
s230931586
p03777
C++
s = input() if s == "H H": print("H") elif s == "D H": print("D") elif s == "D D": print("H") else: print("D")
a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s915799575
p03777
C
#include <stdio.h> #include<string.h> int main(void){ char a,b; scanf("%c%c",&a,&b); if(a=='H'&&b=='H')print("H\n"); else if(a=='D'&&b=='D')printf("H\n"); else printf("D\n"); return 0; }
main.c: In function 'main': main.c:6:23: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 6 | if(a=='H'&&b=='H')print("H\n"); | ^~~~~ | printf
s311742628
p03777
C++
MOD=1000000007 def solve(): a,b=map(str,input().split()) if a=='H': print(b) else: if b=='H': print('D') else: print('H') if __name__ == "__main__": solve()
a.cc:1:1: error: 'MOD' does not name a type 1 | MOD=1000000007 | ^~~
s195704430
p03777
C++
#include <iostream> int main() {
a.cc: In function 'int main()': a.cc:4:2: error: expected '}' at end of input 4 | { | ~^
s951878663
p03777
C++
data = input().split() if data[0] == 'D' : if data[1] == 'D' : data[1] = 'H' else : data[1] = 'D' print(data[1])
a.cc:1:1: error: 'data' does not name a type 1 | data = input().split() | ^~~~
s622313646
p03777
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) #define print(x) cout<<x<<endl; int main() { string a, b; cin >> a, b; if (a = "H"&&b = "H")print("H"); else if (a = "H"&&b = "D")print("D"); else if (a = "D"&&b = "D")print("H"); else if (a = "D"&&b = "H")print("D"); }
a.cc: In function 'int main()': a.cc:9:20: error: no match for 'operator&&' (operand types are 'const char [2]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 9 | if (a = "H"&&b = "H")print("H"); | ~~~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | const char [2] a.cc:9:20: note: candidate: 'operator&&(bool, bool)' (built-in) 9 | if (a = "H"&&b = "H")print("H"); | ~~~^~~ a.cc:9:20: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166, from a.cc:1: /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:9:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:9:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:9:22: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:9:22: note: mismatched types 'const std::valarray<_Tp>' and 'const char [2]' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:9:22: note: mismatched types 'const std::valarray<_Tp>' and 'const char [2]' 9 | if (a = "H"&&b = "H")print("H"); | ^ /usr/include/c++/14/valarray:1206:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1206 | _DEFINE_BINARY_OPERATOR(&&, __logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1206:1: note: template argument deduction/substitution failed: a.cc:9:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 9 | if (a = "H"&&b = "H")print("H"); | ^ a.cc:10:9: error: 'else' without a previous 'if' 10 | else if (a = "H"&&b = "D")print("D"); | ^~~~ a.cc:10:25: error: no match for 'operator&&' (operand types are 'const char [2]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 10 | else if (a = "H"&&b = "D")print("D"); | ~~~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | const char [2] a.cc:10:25: note: candidate: 'operator&&(bool, bool)' (built-in) 10 | else if (a = "H"&&b = "D")print("D"); | ~~~^~~ a.cc:10:25: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:10:27: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 10 | else if (a = "H"&&b = "D")print("D"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:10:27: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'const char [2]' 10 | else if (a = "H"&&b = "D")print("D"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 415 | _DEFINE_EXPR_BINARY_OPERATOR(&&, struct std::__logical_and) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:415:5: note: template argument deduction/substitution failed: a.cc:10:27: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 10 | else if (a = "H"&&b = "D")print("D"); | ^ /usr/include/c++/14/bits/valarray_after.h:415:5: note: candidate: 'templat
s138015260
p03777
C++
#include<iostream> int main() { int W, a, b; std::cin >> W >> a >> b; int bigger = a => b ?? a : b; int smaller = a > b ?? b : a; if(bigger - (smaller + W) =< 0){ std::cout << 0; }else{ std::cout << bigger - (smaller + W); } return 0; }
a.cc: In function 'int main()': a.cc:7:19: error: expected primary-expression before '>' token 7 | int bigger = a => b ?? a : b; | ^ a.cc:7:24: error: expected primary-expression before '?' token 7 | int bigger = a => b ?? a : b; | ^ a.cc:7:31: error: expected ':' before ';' token 7 | int bigger = a => b ?? a : b; | ^ | : a.cc:7:31: error: expected primary-expression before ';' token a.cc:8:24: error: expected primary-expression before '?' token 8 | int smaller = a > b ?? b : a; | ^ a.cc:8:31: error: expected ':' before ';' token 8 | int smaller = a > b ?? b : a; | ^ | : a.cc:8:31: error: expected primary-expression before ';' token a.cc:10:30: error: expected primary-expression before '<' token 10 | if(bigger - (smaller + W) =< 0){ | ^
s287939483
p03777
C++
#include<iostream> char rev(char c){ if(c=='H'){ return 'D' }else{ return 'H' } } int main() { char a, b; std::cin >> a >> b; if(a=='H'){ std::cout << b; }else{ std::cout << rev(b); } return 0; }
a.cc: In function 'char rev(char)': a.cc:4:15: error: expected ';' before '}' token 4 | return 'D' | ^ | ; 5 | }else{ | ~ a.cc:6:15: error: expected ';' before '}' token 6 | return 'H' | ^ | ; 7 | } | ~
s140864519
p03777
C++
#include<iostream> char rev(char c){ if(c=='H'){ return 'D' }else{ return 'H' } } void main() { char a, b; std::cin >> a >> b; if(a=='H'){ std::cout << b; }else{ std::cout << rev(b); } }
a.cc: In function 'char rev(char)': a.cc:4:15: error: expected ';' before '}' token 4 | return 'D' | ^ | ; 5 | }else{ | ~ a.cc:6:15: error: expected ';' before '}' token 6 | return 'H' | ^ | ; 7 | } | ~ a.cc: At global scope: a.cc:10:1: error: '::main' must return 'int' 10 | void main() { | ^~~~
s729970970
p03777
C++
#include<iosteam> char rev(char c){ if(c=='H'){ return 'D' }else{ return 'H' } } void main() { char a, b; std::cin >> a >> b; if(a=='H'){ std::cout << b; }else{ std::cout << rev(b); } }
a.cc:1:9: fatal error: iosteam: No such file or directory 1 | #include<iosteam> | ^~~~~~~~~ compilation terminated.
s781679537
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String a = sc.nextLine(); String b = sc.nextLine(); if(a = H) { System.out.println(b); }else if(b = H) { System.out.println(D); }else { System.out.println(H); } } }
Main.java:10: error: cannot find symbol if(a = H) { ^ symbol: variable H location: class Main Main.java:10: error: incompatible types: String cannot be converted to boolean if(a = H) { ^ Main.java:12: error: cannot find symbol }else if(b = H) { ^ symbol: variable H location: class Main Main.java:12: error: incompatible types: String cannot be converted to boolean }else if(b = H) { ^ Main.java:13: error: cannot find symbol System.out.println(D); ^ symbol: variable D location: class Main Main.java:15: error: cannot find symbol System.out.println(H); ^ symbol: variable H location: class Main 6 errors
s706111227
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String a = sc.nextLine(); String b = sc.nextLine(); if(a = "H") { System.out.println(b); }else if(b = "H") { System.out.println("D"); }else { System.out.println("H"); } } }
Main.java:10: error: incompatible types: String cannot be converted to boolean if(a = "H") { ^ Main.java:12: error: incompatible types: String cannot be converted to boolean }else if(b = "H") { ^ 2 errors
s135536932
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); char a = sc.nextLine(); char b = sc.nexrLine(); if(a = "H") System.out.println(b); else if(b = "H") System.out.println("D"); else System.out.println("H"); } }
Main.java:7: error: incompatible types: String cannot be converted to char char a = sc.nextLine(); ^ Main.java:8: error: cannot find symbol char b = sc.nexrLine(); ^ symbol: method nexrLine() location: variable sc of type Scanner Main.java:10: error: incompatible types: String cannot be converted to char if(a = "H") ^ Main.java:10: error: incompatible types: char cannot be converted to boolean if(a = "H") ^ Main.java:12: error: incompatible types: String cannot be converted to char else if(b = "H") ^ Main.java:12: error: incompatible types: char cannot be converted to boolean else if(b = "H") ^ 6 errors
s047538627
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); char a = sc.nextLine(); char b = sc.nexrLine(); if(a = "H") { System.out.println(b); }else if(b = "H") { System.out.println("D"); }else { System.out.println("H"); } } }
Main.java:7: error: incompatible types: String cannot be converted to char char a = sc.nextLine(); ^ Main.java:8: error: cannot find symbol char b = sc.nexrLine(); ^ symbol: method nexrLine() location: variable sc of type Scanner Main.java:10: error: incompatible types: String cannot be converted to char if(a = "H") { ^ Main.java:10: error: incompatible types: char cannot be converted to boolean if(a = "H") { ^ Main.java:12: error: incompatible types: String cannot be converted to char }else if(b = "H") { ^ Main.java:12: error: incompatible types: char cannot be converted to boolean }else if(b = "H") { ^ 6 errors
s516048794
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); char a = sc.nextLine(); char b = sc.nexrLine(); if(a = "H") { System.out.println(b); }else if(b = "H") { System.out.println("D"); else System.out.println("H"); } } }
Main.java:14: error: 'else' without 'if' else ^ 1 error
s328647058
p03777
Java
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); char a = sc.nextLine(); char b = sc.nexrLine(); if(a = "H") { System.out.println(b); }else if(b = "H") { System.out.println("D"); else System.out.println("H"); } }
Main.java:14: error: 'else' without 'if' else ^ Main.java:17: error: reached end of file while parsing } ^ 2 errors
s488984045
p03777
C
#include <stdio.h> int main (void) { int a,b,in; in=scanf("%d%d",&a,&b); if("a==b"){ printf("H");} elif ("a=H && b=D"){ printf("H");} else {printf("D");} return 0; }
main.c: In function 'main': main.c:9:1: error: implicit declaration of function 'elif' [-Wimplicit-function-declaration] 9 | elif ("a=H && b=D"){ | ^~~~ main.c:9:20: error: expected ';' before '{' token 9 | elif ("a=H && b=D"){ | ^ | ;
s833917342
p03777
C
#include <stdio.h> int main (void) { int a,b; in=scanf("%d%d",&a,&b); if("a==b"){ printf("H");} else { printf("D");} return 0; }
main.c: In function 'main': main.c:5:1: error: 'in' undeclared (first use in this function); did you mean 'int'? 5 | in=scanf("%d%d",&a,&b); | ^~ | int main.c:5:1: note: each undeclared identifier is reported only once for each function it appears in
s958948369
p03777
C++
#include <bits/stdc++.h> using namespace std; int main() { string a,t; cin>>a>>t; if(a=="H"&&t=="H"){ cout<<"H"<<endl; } if(a=="D"&&t=="H"){ cout<<"D"<<endl; } if(a=="H"&&t=="D"){ cout<<"D"<<endl; } if(a=="D"&&t=="D"){ cout<<"H"<<endl; } return 0;
a.cc: In function 'int main()': a.cc:19:18: error: expected '}' at end of input 19 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s922807649
p03777
C++
#include <iostream> int main(){ char a,b; cin>>a>>b; if(a == b){ cout<<"H"<<endl; } else{ cout<<"D"<<endl; } }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a>>b; | ^~~ | 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:7:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<"H"<<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:7:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<"H"<<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) | ^~~~ a.cc:10:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | cout<<"D"<<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:10:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | cout<<"D"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s944243483
p03777
Java
import java.util.Scanner; public class Sample { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); String a = scan.next(); String b =scan.next(); int c = 0; int d = 0; if(a.equals("H")){ c =0; } else if(a.equals("D")){ c = 1; } if(b.equals("H")){ d = 0; }else if(b.equals("D")){ d = 1; } if((c+d)%2==0){ System.out.println("H"); }else{ System.out.println("D"); } } }
Main.java:2: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s830081860
p03777
C++
#include <iostream> #include <algorithm> int main(){ char a,b; cin >> a>> b; if(a=='H' && b=='H') cout << 'H'; if(a=='H' && b=='D') cout << 'D'; if(a=='D' && b=='H') cout << 'D'; if(a=='D' && b=='D') cout << 'H'; return 0; }
a.cc: In function 'int main()': a.cc:6:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> a>> b; | ^~~ | 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:7:23: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | if(a=='H' && b=='H') cout << 'H'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | if(a=='H' && b=='D') cout << 'D'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:9:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | if(a=='D' && b=='H') cout << 'D'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:10:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | if(a=='D' && b=='D') cout << 'H'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s292392293
p03777
C++
#include <iostream> #include <algorithm> int main(){ char a,b; cin >> a, b; if(a=='H' && b=='H') cout << 'H'; if(a=='H' && b=='D') cout << 'D'; if(a=='D' && b=='H') cout << 'D'; if(a=='D' && b=='D') cout << 'H'; return 0; }
a.cc: In function 'int main()': a.cc:6:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> a, b; | ^~~ | 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:7:23: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | if(a=='H' && b=='H') cout << 'H'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | if(a=='H' && b=='D') cout << 'D'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:9:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | if(a=='D' && b=='H') cout << 'D'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:10:24: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | if(a=='D' && b=='D') cout << 'H'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s634578884
p03777
C++
#include <cstdio> #include <algorithm> char a,b; int main(){ scanf("%s",&a); scanf("%s",&b); int x,y; if(a=='H' && b=='H') cout << 'H'; if(a=='H' && b=='D') cout << 'D'; if(a=='D' && b=='H') cout << 'D'; if(a=='D' && b=='D') cout << 'H'; return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: 'cout' was not declared in this scope 9 | if(a=='H' && b=='H') cout << 'H'; | ^~~~ a.cc:10:24: error: 'cout' was not declared in this scope 10 | if(a=='H' && b=='D') cout << 'D'; | ^~~~ a.cc:11:24: error: 'cout' was not declared in this scope 11 | if(a=='D' && b=='H') cout << 'D'; | ^~~~ a.cc:12:24: error: 'cout' was not declared in this scope 12 | if(a=='D' && b=='D') cout << 'H'; | ^~~~
s793317981
p03777
C++
a,b = map(int, raw_input().split()) if a == "H": print b if a == "D": if b == "H": print "D" else: print "H"
a.cc:1:1: error: 'a' does not name a type 1 | a,b = map(int, raw_input().split()) | ^
s044098419
p03777
C++
using System; using System.Linq; using System.Numerics; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using System.IO; using System.Diagnostics; using System.Text.RegularExpressions; namespace CsTest { class Program { static void Main() { int[] ab = AtCoder.ReadInt32Array(); int a = ab[0]; int b = ab[1]; Console.WriteLine(a == b ? 'H' : 'D'); } } public class AtCoder { public static string[] ReadStringArray() => Console.ReadLine().Split(Array.Empty<char>(), StringSplitOptions.RemoveEmptyEntries); public static int[] ReadInt32Array() => ReadStringArray().Select(s => int.Parse(s)).ToArray(); public static long[] ReadInt64Array() => ReadStringArray().Select(s => long.Parse(s)).ToArray(); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Linq; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Numerics; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Collections.Generic; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Text; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'System' 6 | using System.Threading.Tasks; | ^~~~~~ a.cc:7:7: error: expected nested-name-specifier before 'System' 7 | using System.IO; | ^~~~~~ a.cc:8:7: error: expected nested-name-specifier before 'System' 8 | using System.Diagnostics; | ^~~~~~ a.cc:9:7: error: expected nested-name-specifier before 'System' 9 | using System.Text.RegularExpressions; | ^~~~~~ a.cc:23:6: error: expected ';' after class definition 23 | } | ^ | ; a.cc: In static member function 'static void CsTest::Program::Main()': a.cc:17:16: error: structured binding declaration cannot have type 'int' 17 | int[] ab = AtCoder.ReadInt32Array(); | ^~ a.cc:17:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:17:16: error: empty structured binding declaration a.cc:17:19: error: expected initializer before 'ab' 17 | int[] ab = AtCoder.ReadInt32Array(); | ^~ a.cc:18:21: error: 'ab' was not declared in this scope; did you mean 'a'? 18 | int a = ab[0]; | ^~ | a a.cc:21:13: error: 'Console' was not declared in this scope 21 | Console.WriteLine(a == b ? 'H' : 'D'); | ^~~~~~~ a.cc: At global scope: a.cc:25:5: error: expected unqualified-id before 'public' 25 | public class AtCoder | ^~~~~~
s814644796
p03777
C++
#include <bits/stdc++.h> using namespace std; int main(){ char a,b; cin >> a >> b; if(a==b){cout << H << endl;} else{cout << D << endl;} return 0; }
a.cc: In function 'int main()': a.cc:7:22: error: 'H' was not declared in this scope 7 | if(a==b){cout << H << endl;} | ^ a.cc:8:18: error: 'D' was not declared in this scope 8 | else{cout << D << endl;} | ^
s004693406
p03777
C++
int main (){ char a , b; cin >> a >> b; if ( a == ’H ’ && b == ’H ’) cout << ’H ’; if ( a == ’H ’ && b == ’D ’) cout << ’D ’; if ( a == ’D ’ && b == ’H ’) cout << ’D ’; if ( a == ’D ’ && b == ’D ’) cout << ’H ’; return 0; }
a.cc:4:12: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:4:15: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:4:25: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:4:28: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:4:39: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:4:42: error: extended character ’ is not valid in an identifier 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^ a.cc:5:12: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:5:15: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:5:25: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:5:28: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:5:39: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:5:42: error: extended character ’ is not valid in an identifier 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^ a.cc:6:12: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:6:15: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:6:25: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:6:28: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:6:39: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:6:42: error: extended character ’ is not valid in an identifier 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^ a.cc:7:12: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc:7:15: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc:7:25: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc:7:28: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc:7:39: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc:7:42: error: extended character ’ is not valid in an identifier 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^ a.cc: In function 'int main()': a.cc:3:2: error: 'cin' was not declared in this scope 3 | cin >> a >> b; | ^~~ a.cc:4:12: error: '\U00002019H' was not declared in this scope 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^~ a.cc:4:14: error: expected ')' before '\U00002019' 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ~ ^~ | ) a.cc:4:31: error: 'cout' was not declared in this scope 4 | if ( a == ’H ’ && b == ’H ’) cout << ’H ’; | ^~~~ a.cc:5:12: error: '\U00002019H' was not declared in this scope 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^~ a.cc:5:14: error: expected ')' before '\U00002019' 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ~ ^~ | ) a.cc:5:31: error: 'cout' was not declared in this scope 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^~~~ a.cc:5:39: error: '\U00002019D' was not declared in this scope 5 | if ( a == ’H ’ && b == ’D ’) cout << ’D ’; | ^~ a.cc:6:12: error: '\U00002019D' was not declared in this scope 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^~ a.cc:6:14: error: expected ')' before '\U00002019' 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ~ ^~ | ) a.cc:6:31: error: 'cout' was not declared in this scope 6 | if ( a == ’D ’ && b == ’H ’) cout << ’D ’; | ^~~~ a.cc:7:12: error: '\U00002019D' was not declared in this scope 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^~ a.cc:7:14: error: expected ')' before '\U00002019' 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ~ ^~ | ) a.cc:7:31: error: 'cout' was not declared in this scope 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^~~~ a.cc:7:39: error: '\U00002019H' was not declared in this scope 7 | if ( a == ’D ’ && b == ’D ’) cout << ’H ’; | ^~
s426581773
p03777
C++
#include<iostream> using namespace std; int main() { char a,b; cin>>a>>b; while(a!='H'||a!='D'||b!='H'||b!='D') { cin>>a>>b; } if(a=='H') { cout<<b; } if(a=='D') { if(b=='H') { cout<< a; } else {cout<<'H';} } return 0; } Submission
a.cc:25:1: error: 'Submission' does not name a type 25 | Submission | ^~~~~~~~~~
s972843720
p03777
C++
#include<iostream> using namespace std; int main() { string a,b; cin>>a>>b; while(a!='H'||a!='D'||b!='H'||b!='D') { cin>>a>>b; } if(a=='H') { cout<<b; } if(a=='D') { if(b=='H') { cout<< a; } else {cout<<'H';} } return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/string:43, 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/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const _CharT*' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') |
s024348654
p03777
C++
#include<iostream> using namespace std; int main() { string a,b; cin>>a>>b; while(a!='H'||a!='D'||b!='H'||b!='D') { cin>>a>>b; } if(a=='H') { cout<<b; } if(a=='D') { if(b=='H') { cout<< a; } else {cout<<'H';} } return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/string:43, 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/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:7:16: note: mismatched types 'const _CharT*' and 'char' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:7:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 7 | while(a!='H'||a!='D'||b!='H'||b!='D') |
s839031811
p03777
C++
#include<iostream> using namespace std; int main() { string a,b; cin>>a>>b; while(a!='H||a!='D'||b!='H||b!='D') { cin>>a>>b; } if(a=='H) { cout<<b; } if(a=='D') { if(b=='H') { cout<< a; } else {cout<<'H';} } return 0;
a.cc:7:16: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~~~~~~~ a.cc:7:25: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~~~~~~ a.cc:11:13: warning: missing terminating ' character 11 | if(a=='H) | ^ a.cc:11:13: error: missing terminating ' character 11 | if(a=='H) | ^~~ a.cc: In function 'int main()': a.cc:7:16: error: unable to find character literal operator 'operator""D' with 'int' argument 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~~~~~~~ a.cc:7:25: error: expected ')' before user-defined character literal 7 | while(a!='H||a!='D'||b!='H||b!='D') | ~ ^~~~~~~~ | ) a.cc:7:25: error: unable to find character literal operator 'operator""H' with 'int' argument 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~~~~~~ a.cc:7:36: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 7 | while(a!='H||a!='D'||b!='H||b!='D') | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ In file included from /usr/include/c++/14/string:43, 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/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:7:38: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:7:38: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:7:38: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:7:38: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:7:38: note: mismatched types 'const _CharT*' and 'char' 7 | while(a!='H||a!='D'||b!='H||b!='D') | ^~~ In file included from /usr/include/c++/14
s442000523
p03777
C++
#include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; while(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } return 0;
a.cc: In function 'int main()': a.cc:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if(a=="H") | ~^~~~~ a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(a=="D") | ~^~~~~ a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | if(b=="H") | ~^~~~~ a.cc:23:17: error: expected '}' at end of input 23 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s928796857
p03777
C++
#include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; while(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:9:18: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]') 9 | cin>>a>>" ">>b; | ~~~~~~^~~~~ | | | | | const char [2] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*' 9 | cin>>a>>" ">>b; | ^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'short int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(short int)((const char*)" ")' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(short unsigned int)((const char*)" ")' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(int)((const char*)" ")' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(unsigned int)((const char*)" ")' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'long int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(long int)((const char*)" ")' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(long unsigned int)((const char*)" ")' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(long long int)((const char*)" ")' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:9:20: error: cannot bind rvalue '(long long unsigned int)((const char*)" ")' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:9:20: error: invalid conversion from 'const void*' to 'void*' [-fpermissive] 9 | cin>>a>>" ">>b; | ^~~ | | | const void* a.cc:9:20: error: cannot bind rvalue '(void*)((const void*)((const char*)" "))' to 'void*&' /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [2]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [2]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [2]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_trait
s887660327
p03777
C++
#include<iostream> int main() { int a,b; cin>>a>>b; while(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } return 0; }
a.cc: In function 'int main()': a.cc:6:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>a>>b; | ^~~ | std::cin In file included from a.cc:2: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:7:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | while(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | if(a=="H") | ~^~~~~ a.cc:13:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 13 | cout<<b; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(a=="D") | ~^~~~~ a.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 17 | if(b=="H") | ~^~~~~ a.cc:18:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 18 | { cout<< a; } | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 20 | {cout<<"H";} | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s176284914
p03777
C++
while(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} }
a.cc:1:6: error: expected unqualified-id before 'while' 1 | while(a!="H"||a!="D"||b!="H"||b!="D") | ^~~~~ a.cc:5:7: error: expected unqualified-id before 'if' 5 | if(a=="H") | ^~ a.cc:9:7: error: expected unqualified-id before 'if' 9 | if(a=="D") | ^~
s875997527
p03777
C++
#include<iostream> using namespace std; int main() { int a,int b; cin>>a>>b; if(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: expected unqualified-id before 'int' 6 | int a,int b; | ^~~ a.cc:7:15: error: 'b' was not declared in this scope 7 | cin>>a>>b; | ^ a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if(a!="H"||a!="D"||b!="H"||b!="D") | ~^~~~~ a.cc:11:18: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]') 11 | cin>>a>>" ">>b; | ~~~~~~^~~~~ | | | | | const char [2] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*' 11 | cin>>a>>" ">>b; | ^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'short int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(short int)((const char*)" ")' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(short unsigned int)((const char*)" ")' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(int)((const char*)" ")' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(unsigned int)((const char*)" ")' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'long int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(long int)((const char*)" ")' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(long unsigned int)((const char*)" ")' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(long long int)((const char*)" ")' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:11:20: error: cannot bind rvalue '(long long unsigned int)((const char*)" ")' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:11:20: error: invalid conversion from 'const void*' to 'void*' [-fpermissive] 11 | cin>>a>>" ">>b; | ^~~ | | | const void* a.cc:11:20: error: cannot bind rvalue '(void*)((const void*)((const char*)" "))' to 'void*&' /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [2]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [2]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [2]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c+
s571261823
p03777
C++
#include<iostream> using namespace std; int main() { int a,int b; cin>>a>>" ">>b; scanf(); if(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } return 0; }
a.cc: In function 'int main()': a.cc:7:13: error: expected unqualified-id before 'int' 7 | int a,int b; | ^~~ a.cc:8:13: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]') 8 | cin>>a>>" ">>b; | ~~~~~~^~~~~ | | | | | const char [2] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:2: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*' 8 | cin>>a>>" ">>b; | ^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'short int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(short int)((const char*)" ")' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(short unsigned int)((const char*)" ")' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(int)((const char*)" ")' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(unsigned int)((const char*)" ")' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'long int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(long int)((const char*)" ")' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(long unsigned int)((const char*)" ")' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(long long int)((const char*)" ")' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const char* a.cc:8:15: error: cannot bind rvalue '(long long unsigned int)((const char*)" ")' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:8:15: error: invalid conversion from 'const void*' to 'void*' [-fpermissive] 8 | cin>>a>>" ">>b; | ^~~ | | | const void* a.cc:8:15: error: cannot bind rvalue '(void*)((const void*)((const char*)" "))' to 'void*&' /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [2]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [2]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [2]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const char [2]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_t
s077582139
p03777
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std int main() { int a,b,w; cin>>w>>a>>b; cout<<min(fabs(b-a),fabs(b-a-w)); return 0; }
a.cc:4:20: error: expected ';' before 'int' 4 | using namespace std | ^ | ; 5 | int main() | ~~~
s903058998
p03777
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace int main() { int a,b,w; cin>>w>>a>>b; cout<<max(fabs(b-a),fabs(b-a-w)); return 0; }
a.cc:5:1: error: expected identifier before 'int' 5 | int main() | ^~~ a.cc:4:16: error: expected ';' before 'int' 4 | using namespace | ^ | ; 5 | int main() | ~~~ a.cc: In function 'int main()': a.cc:8:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin>>w>>a>>b; | ^~~ | 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:9:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | cout<<max(fabs(b-a),fabs(b-a-w)); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:9:10: error: 'max' was not declared in this scope; did you mean 'std::max'? 9 | cout<<max(fabs(b-a),fabs(b-a-w)); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s519026761
p03777
C++
#include<iostream> int main() { char a,b; cin>>a>>b; if(a=='H') cout<<b<<endl; else if (b=='H') cout<<"D"<<endl; else cout<<"H"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a>>b; | ^~~ | 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:7:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<b<<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:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<b<<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) | ^~~~ a.cc:8:22: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | else if (b=='H') cout<<"D"<<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:8:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | else if (b=='H') cout<<"D"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:9:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | else cout<<"H"<<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:9:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 9 | else cout<<"H"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s864595173
p03777
C++
#include<iostream> int main() { char a,b; scanf("%c%c",&a,&b); if(a=='H') cout<<b<<endl; else if (b=='H') cout<<"D"<<endl; else cout<<"H"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<b<<endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<b<<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) | ^~~~ a.cc:8:22: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | else if (b=='H') cout<<"D"<<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:8:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | else if (b=='H') cout<<"D"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:9:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | else cout<<"H"<<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:9:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 9 | else cout<<"H"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s214209068
p03777
C++
#include<stdio.h> #include<iostream.h> using namespace; void main() { char a,char b; cin>>a>>" ">>b; if(a!="H"||a!="D"||b!="H"||b!="D") { cin>>a>>" ">>b; } if(a=="H") { cout<<b; } if(a=="D") { if(b=="H") { cout<< a; } else {cout<<"H";} } }
a.cc:2:9: fatal error: iostream.h: No such file or directory 2 | #include<iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s181319732
p03777
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char a[] = sc.next().toCharArray(); char b[] = sc.next().toCharArray(); if(a[0]==b[0]){ System.out.println("H"); }else{ System.out.println("D"); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s104052424
p03777
C++
#include <iostream> using namespace std; void main() { char a,b; cin>>a>>b; if (a == b) { cout<<"H"<<endl; }else{ cout<<"D"<<endl; } }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~
s492489834
p03777
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a =sc.next(); String b =sc.next(); if(a.equals("H")%%b.equals("H"))System.out.println("H"); if(a.equals("H")%%b.equals("D"))System.out.println("D"); if(a.equals("D")%%b.equals("H"))System.out.println("D"); if(a.equals("D")%%b.equals("D"))System.out.println("H"); } }
Main.java:7: error: illegal start of expression if(a.equals("H")%%b.equals("H"))System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a.equals("H")%%b.equals("D"))System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a.equals("D")%%b.equals("H"))System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a.equals("D")%%b.equals("D"))System.out.println("H"); ^ 4 errors
s667470169
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) Scanner sc = new Scanner(System.in); int x =sc.nextInt(); if(x<1200)System.out.println("ABC"); }else{ System.out.println("ARC"); } } }
Main.java:3: error: ';' expected public static void main(String[] args) ^ Main.java:6: error: illegal start of type if(x<1200)System.out.println("ABC"); ^ Main.java:6: error: illegal start of type if(x<1200)System.out.println("ABC"); ^ Main.java:6: error: <identifier> expected if(x<1200)System.out.println("ABC"); ^ Main.java:6: error: illegal start of type if(x<1200)System.out.println("ABC"); ^ Main.java:7: error: class, interface, enum, or record expected }else{ ^ Main.java:9: error: class, interface, enum, or record expected } ^ 7 errors
s215827374
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String a =sc.next(); String b =sc.next(); if(a.equals("H")%%b.equals("H"))System.out.println("H"); if(a.equals("H")%%b.equals("D"))System.out.println("D"); if(a.equals("D")%%b.equals("H"))System.out.println("D"); if(a.equals("D")%%b.equals("D"))System.out.println("H"); } }
Main.java:7: error: illegal start of expression if(a.equals("H")%%b.equals("H"))System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a.equals("H")%%b.equals("D"))System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a.equals("D")%%b.equals("H"))System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a.equals("D")%%b.equals("D"))System.out.println("H"); ^ 4 errors
s170460097
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String a =sc.next(); String b =sc.next(); if(a.equals("H")%% b.equals("H"))System.out.println("H"); if(a.equals("H")%% b.equals("D"))System.out.println("D"); if(a.equals("D")%% b.equals("H"))System.out.println("D"); if(a.equals("D")%% b.equals("D"))System.out.println("H"); } }
Main.java:7: error: illegal start of expression if(a.equals("H")%%?b.equals("H"))System.out.println("H"); ^ Main.java:7: error: illegal character: '\u3000' if(a.equals("H")%%?b.equals("H"))System.out.println("H"); ^ Main.java:7: error: ';' expected if(a.equals("H")%%?b.equals("H"))System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a.equals("H")%%?b.equals("D"))System.out.println("D"); ^ Main.java:8: error: illegal character: '\u3000' if(a.equals("H")%%?b.equals("D"))System.out.println("D"); ^ Main.java:8: error: ';' expected if(a.equals("H")%%?b.equals("D"))System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a.equals("D")%%?b.equals("H"))System.out.println("D"); ^ Main.java:9: error: illegal character: '\u3000' if(a.equals("D")%%?b.equals("H"))System.out.println("D"); ^ Main.java:9: error: ';' expected if(a.equals("D")%%?b.equals("H"))System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a.equals("D")%%?b.equals("D"))System.out.println("H"); ^ Main.java:10: error: illegal character: '\u3000' if(a.equals("D")%%?b.equals("D"))System.out.println("H"); ^ Main.java:10: error: ';' expected if(a.equals("D")%%?b.equals("D"))System.out.println("H"); ^ 12 errors
s729171504
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String a =sc.next(); String b =sc.next(); if(a.equals("H")%%b.equals("H"))System.out.println("H"); if(a.equals("H")%%b.equals("D"))System.out.println("D"); if(a.equals("D")%%b.equals("H"))System.out.println("D"); if(a.equals("D")%%b.equals("D"))System.out.println("H"); } }
Main.java:7: error: illegal start of expression if(a.equals("H")%%b.equals("H"))System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a.equals("H")%%b.equals("D"))System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a.equals("D")%%b.equals("H"))System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a.equals("D")%%b.equals("D"))System.out.println("H"); ^ 4 errors
s287341470
p03777
Java
import java.util.Scanner; public class HonestOrDishonest { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int a = Integer.parseInt(scn.next()); int b = Integer.parseInt(scn.next()); int H = Integer.parseInt(scn.next()); int D = Integer.parseInt(scn.next()); if ( a == H && b == H) System.out.println("H"); if ( a == H && b == D) System.out.println("D"); if ( a == D && b == H) System.out.println("D"); if ( a == D && b == D) System.out.println("H"); } }
Main.java:3: error: class HonestOrDishonest is public, should be declared in a file named HonestOrDishonest.java public class HonestOrDishonest { ^ 1 error
s619937080
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a =sc.nextInt(); int b =sc.nextInt(); if(a=="H" %% b=="H")System.out.println("H");{ if(a=="H" %% b=="D")System.out.println("D");{ if(a=="D" %% b=="H")System.out.println("D");{ if(a=="D" %% b=="D")System.out.println("H");{ } } } } } }
Main.java:7: error: illegal start of expression if(a=="H" %% b=="H")System.out.println("H");{ ^ Main.java:8: error: illegal start of expression if(a=="H" %% b=="D")System.out.println("D");{ ^ Main.java:9: error: illegal start of expression if(a=="D" %% b=="H")System.out.println("D");{ ^ Main.java:10: error: illegal start of expression if(a=="D" %% b=="D")System.out.println("H");{ ^ 4 errors
s288028854
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a =sc.nextInt(); int b =sc.nextInt(); if(a=="H" %% b=="H")System.out.println("H"); if(a=="H" %% b=="D")System.out.println("D"); if(a=="D" %% b=="H")System.out.println("D"); if(a=="D" %% b=="D")System.out.println("H"); } }
Main.java:7: error: illegal start of expression if(a=="H" %% b=="H")System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a=="H" %% b=="D")System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a=="D" %% b=="H")System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a=="D" %% b=="D")System.out.println("H"); ^ 4 errors
s141656385
p03777
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a =sc.nextInt(); int b =sc.nextInt(); if(a=="H" %% b=="H")System.out.println("H"); if(a=="H" %% b=="D")System.out.println("D"); if(a=="D" %% b=="H")System.out.println("D"); if(a=="D" %% b=="D")System.out.println("H");
Main.java:7: error: illegal start of expression if(a=="H" %% b=="H")System.out.println("H"); ^ Main.java:8: error: illegal start of expression if(a=="H" %% b=="D")System.out.println("D"); ^ Main.java:9: error: illegal start of expression if(a=="D" %% b=="H")System.out.println("D"); ^ Main.java:10: error: illegal start of expression if(a=="D" %% b=="D")System.out.println("H"); ^ Main.java:10: error: reached end of file while parsing if(a=="D" %% b=="D")System.out.println("H"); ^ 5 errors
s730626301
p03777
Java
import java.util.*; public class ABC056_A { public static void main(String[] args){ Scanner sc=new Scanner(System.in); String a=sc.next(),b=sc.next(); if(a.equals("H")&&b.equals("H"))System.out.println("H"); else if(a.equals("H")&&b.equals("D"))System.out.println("D"); else if(a.equals("D")&&b.equals("H"))System.out.println("D"); else if(a.equals("D")&&b.equals("D"))System.out.println("H"); } }
Main.java:2: error: class ABC056_A is public, should be declared in a file named ABC056_A.java public class ABC056_A { ^ 1 error
s717752295
p03777
Java
import java.util.*; public class ABC056_A { public static void main(String[] args){ Scanner sc=new Scanner(System.in); if(sc.next().equals("H")&&sc.next().equals("H"))System.out.println("H"); if(sc.next().equals("H")&&sc.next().equals("D"))System.out.println("D"); if(sc.next().equals("D")&&sc.next().equals("H"))System.out.println("D"); if(sc.next().equals("D")&&sc.next().equals("D"))System.out.println("H"); } }
Main.java:2: error: class ABC056_A is public, should be declared in a file named ABC056_A.java public class ABC056_A { ^ 1 error
s350546665
p03777
Java
package spring21; import java.util.*; public class ABC056_A { public static void main(String[] args){ Scanner sc=new Scanner(System.in); if(sc.next().equals("H")&&sc.next().equals("H"))System.out.println("H"); if(sc.next().equals("H")&&sc.next().equals("D"))System.out.println("D"); if(sc.next().equals("D")&&sc.next().equals("H"))System.out.println("D"); if(sc.next().equals("D")&&sc.next().equals("D"))System.out.println("H"); } }
Main.java:3: error: class ABC056_A is public, should be declared in a file named ABC056_A.java public class ABC056_A { ^ 1 error
s900525029
p03777
C++
#include<bits/stdc++.h> using namespace std; int main(void){ char a, b; cin >> a; cin >> b; cout << ((a=='D' ? 1 : 0)^(b=='D' ? 1 : 0)) ? 'D' : 'H' << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:58: error: invalid operands of types 'char' and '<unresolved overloaded function type>' to binary 'operator<<' 8 | cout << ((a=='D' ? 1 : 0)^(b=='D' ? 1 : 0)) ? 'D' : 'H' << endl; | ~~~~^~~~~~~
s170898957
p03777
C++
#include<bits/stdc++.h> using namespace std; int main(void){ char a, b; cin >> a; cin >> b; cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:26: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int') 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ | | | | std::basic_ostream<char> int a.cc:8:26: note: candidate: 'operator^(int, int)' (built-in) 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ a.cc:8:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bitset:1577:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator^(const bitset<_Nb>&, const bitset<_Nb>&)' 1577 | operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bitset:1577:5: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::bitset<_Nb>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:42: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:42: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::valarray<_Tp>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:42: note: 'std::basic_ostream<char>' is not derived from 'const std::valarray<_Tp>' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:42: note: mismatched types 'const std::valarray<_Tp>' and 'int' 8 | cout << (a=='D' ? 1 : 0)^(b=='D' ? 1 : 0) ? 'D' : 'H' << endl; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)' 146 | operator^(byte __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:146:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte' 146 | operator^(byte __l, byte __r) noexcept | ~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:94:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:144:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:191:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176: /usr/include/c++/14/future:170:20: note: candidate: 'constexpr std::launch std::operator^(launch, launch)' 170 | constexpr launch operator^(launch __x, launch __y) noexcept | ^~~~~~~~ /usr/include/c++/14/future:170:37: note: no known conversi
s241064690
p03777
C++
#include<bits/stdc++.h> using namespace std; int main(void){ char a, b; cin >> a; cin >> b; cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'bool') 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ~~~~~~~~~~~~~~~~^~~~~~~~~ | | | | | bool | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} a.cc:8:18: note: candidate: 'operator^(int, int)' (built-in) 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ~~~~~~~~~~~~~~~~^~~~~~~~~ a.cc:8:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bitset:1577:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator^(const bitset<_Nb>&, const bitset<_Nb>&)' 1577 | operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bitset:1577:5: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::bitset<_Nb>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:26: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:410:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 410 | _DEFINE_EXPR_BINARY_OPERATOR(^, struct std::__bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:410:5: note: template argument deduction/substitution failed: a.cc:8:26: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:26: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::valarray<_Tp>' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ /usr/include/c++/14/valarray:1201:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__bitwise_xor, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1201 | _DEFINE_BINARY_OPERATOR(^, __bitwise_xor) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1201:1: note: template argument deduction/substitution failed: a.cc:8:26: note: mismatched types 'const std::valarray<_Tp>' and 'bool' 8 | cout << (a=='D')^(b=='D') ? 'D' : 'H' << endl; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)' 146 | operator^(byte __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:146:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::byte' 146 | operator^(byte __l, byte __r) noexcept | ~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:94:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Fmtflags' 94 | operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:144:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Openmode' 144 | operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:191:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'std::_Ios_Iostate' 191 | operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/
s811523714
p03777
C++
#include<bits/stdc++.h> using namespace std; int main(void){ string a, b; cin >> a; cin >> b; cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ~^~~~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed: a.cc:8:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1274 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed: a.cc:8:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1441 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed: a.cc:8:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1613 | operator==(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)' 2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:8:17: note: 'std::string' {aka 'std::__cxx11::basic_string<c
s761788375
p03777
C++
#include<bites/stdc++.h> using namespace std; int main(void){ string a, b; cin >> a; cin >> b; cout << ((((a=='D' ? 1 : 0)+(b=='D' ? 1 : 0))&1) ? 'D' : 'H') << endl; return 0; }
a.cc:1:9: fatal error: bites/stdc++.h: No such file or directory 1 | #include<bites/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s777952012
p03777
Java
package spring21; public class ABC056_A { public static void main(String[] args){ char a='D',b='H'; if(a=='H'&&b=='H')System.out.println("H"); if(a=='H'&&b=='D')System.out.println("D"); if(a=='D'&&b=='H')System.out.println("D"); if(a=='D'&&b=='D')System.out.println("H"); } }
Main.java:3: error: class ABC056_A is public, should be declared in a file named ABC056_A.java public class ABC056_A { ^ 1 error
s102007698
p03777
Java
package spring21; public class ABC056_A { public static void main(String[] args){ char a='D',b='H'; if(a=='H'&&b=='H')System.out.println("H"); if(a=='H'&&b=='D')System.out.println("D"); if(a=='D'&&b=='H')System.out.println("D"); if(a=='D'&&b=='D')System.out.println("H"); } }
Main.java:3: error: class ABC056_A is public, should be declared in a file named ABC056_A.java public class ABC056_A { ^ 1 error
s399610753
p03777
Java
public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String a = sc.next() ; String b = sc.next() ; char A = a.charAt(0); char B = b.charAt(0); if(A == 'H' && B == 'H'){ System.out.println('H'); } if(A == 'H' && B == 'D'){ System.out.println('D'); } if(A == 'D' && B == 'H'){ System.out.println('D'); } if(A == 'D' && B == 'D'){ System.out.println('H'); } } }
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 2 errors
s004548927
p03777
Java
public class A11 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String a = sc.next() ; String b = sc.next() ; char A = a.charAt(0); char B = b.charAt(0); if(A == 'H' && B == 'H'){ System.out.println('H'); } if(A == 'H' && B == 'D'){ System.out.println('D'); } if(A == 'D' && B == 'H'){ System.out.println('D'); } if(A == 'D' && B == 'D'){ System.out.println('H'); } } }
Main.java:1: error: class A11 is public, should be declared in a file named A11.java public class A11 { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class A11 Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class A11 3 errors
s101077778
p03777
Java
public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String a = sc.next() ; String b = sc.next() ; char A = a.charAt(0); char B = b.charAt(0); if(A == 'H' && B == 'H'){ System.out.println('H'); } if(A == 'H' && B == 'D'){ System.out.println('D'); } if(A == 'D' && B == 'H'){ System.out.println('D'); } if(A == 'D' && B == 'H'){ System.out.println('H'); } } }
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 2 errors
s079212639
p03777
C++
inpt = raw_input().split() if inpt[0] == 'H': print inpt[1] elif inpt[0] == 'D': if inpt[1] == 'H': print 'D' elif inpt[1] == 'D': print 'H'
a.cc:1:1: error: 'inpt' does not name a type; did you mean 'int'? 1 | inpt = raw_input().split() | ^~~~ | int
s577107784
p03777
C++
a, b = input().split() if a == b: print("H") else: print("D")
a.cc:1:1: error: 'a' does not name a type 1 | a, b = input().split() | ^
s866263068
p03777
C++
#include<iostream> int main(){ string a,b; cin>>a>>b; if(a==b){ cout<<"H"<<endl; } else{ cout<<"D"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'string' was not declared in this scope 5 | string a,b; | ^~~~~~ a.cc:5:3: 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:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>a>>b; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:8: error: 'a' was not declared in this scope 7 | cin>>a>>b; | ^ a.cc:7:11: error: 'b' was not declared in this scope 7 | cin>>a>>b; | ^ a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 10 | cout<<"H"<<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:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 10 | cout<<"H"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:13:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 13 | cout<<"D"<<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:13:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 13 | cout<<"D"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s813589890
p03777
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; void solve() { char a, b; cin >> a >> b; if( a == "H" ){ cout << b << "\n"; } else { b == "H"? cout << "D\n" : cout << "H\n"; } } int main() { solve(); return 0; }
a.cc: In function 'void solve()': a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if( a == "H" ){ | ~~^~~~~~ a.cc:13:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 | b == "H"? cout << "D\n" : cout << "H\n"; | ~~^~~~~~
s228500637
p03777
C++
#include <iostream> using namespace std; int main(){ long long int X; int sum=0; cin>>X; for(int i=1 ;; i++){ //i=0だとわかりにくい sum+=i; if(sum>=X){ break; } cout<<i; } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | cin>>X; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include <iostream> a.cc:12:11: error: 'cout' was not declared in this scope 12 | cout<<i; | ^~~~ a.cc:12:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s065112130
p03777
C++
#include <iostream> using namespace std; int main(){ long long int X; int sum=0; cin>>X; for(int i=1 ; ; i++){ //i=0だとわかりにくい sum+=i; if(sum>=X){ break; } cout<<i<<endl; } return 0; }
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | cin>>X; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include <iostream> a.cc:12:11: error: 'cout' was not declared in this scope 12 | cout<<i<<endl; | ^~~~ a.cc:12:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:20: error: 'endl' was not declared in this scope 12 | cout<<i<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #include <iostream>
s487186644
p03777
Java
public class Judge{ public static void main(String[] args){ String a = new java.util.Scanner( System.in ).nextLine(); String b = new java.util.Scanner( System.in ).nextLine(); if( a.equals("H")){ if( b.equals("H")){ System.out.println("H"); } if( b.equals("D")){ System.out.println("D"); } } if( a.equals("D")){ if( b.equals("H")){ System.out.println("D"); } if(b.equals("D")){ System.out.println("H"); } } } }
Main.java:1: error: class Judge is public, should be declared in a file named Judge.java public class Judge{ ^ 1 error
s342436224
p03777
Java
package AtCoder; import java.util.*; public class NarrowRectanglesEasy { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int W=sc.nextInt(); int a=sc.nextInt(); int b=sc.nextInt(); int z=Math.abs(a-b); if(z<=W) { z=0; }else{ z=z-W; } System.out.println(z); } }
Main.java:3: error: class NarrowRectanglesEasy is public, should be declared in a file named NarrowRectanglesEasy.java public class NarrowRectanglesEasy { ^ 1 error
s400328783
p03777
C++
#include<bits/stdc++.h> using namespace std; main(){ char a,b; cin>>a; if(a=='H'){ cin>>b; cout<<b<<endl; } else{ cin>>b; if(b=="H")cout<<"D"<<endl; else cout<<"H"<<endl; } }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(b=="H")cout<<"D"<<endl; | ~^~~~~
s386056602
p03777
Java
import java.util.Scanner; public static void main(String[] args) { Scanner s = new Scanner(System.in); String x = ""; x = s.next(); char[] c = new char[2]; c[0] = x.charAt(0); c[1] = x.charAt(1); if(c[0] == c[1]){ System.out.println('H'); } else { System.out.println('D'); } }
Main.java:4: 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
s750770886
p03777
Java
import java.util.Scanner; public class Go { public static void main(String[] args) { Scanner s = new Scanner(System.in); String x = ""; x = s.next(); char[] c = new char[2]; c[0] = x.charAt(0); c[1] = x.charAt(1); if(c[0] == c[1]){ System.out.println('H'); } else { System.out.println('D'); } } }
Main.java:3: error: class Go is public, should be declared in a file named Go.java public class Go { ^ 1 error
s154505628
p03777
Java
public class Go { public static void main(String[] args) { Scanner s = new Scanner(System.in); String x = ""; x = s.next(); char[] c = new char[2]; c[0] = x.charAt(0); c[1] = x.charAt(1); if(c[0] == c[1]){ System.out.println('H'); } else { System.out.println('D'); } } }
Main.java:1: error: class Go is public, should be declared in a file named Go.java public class Go { ^ Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Go Main.java:4: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Go 3 errors
s080747257
p03777
Java
public static void main(String[] args) { Scanner s = new Scanner(System.in); String x = ""; x = s.next(); char[] c = new char[2]; c[0] = x.charAt(0); c[1] = x.charAt(1); if(c[0] == c[1]){ System.out.println('H'); } else { System.out.println('D'); } }
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
s551919076
p03777
C++
#include<cstdilo> int main(){ char w[2] = { 'H', 'D' }; char in1, in2; int a = 0; scanf("%c %c", &in1, &in2); if(in1 == 'D') a++; if(in2 == 'D') a = (a+1)%2; if(a == 0) printf("H"); if(a == 1) printf("D"); return 0; }
a.cc:1:9: fatal error: cstdilo: No such file or directory 1 | #include<cstdilo> | ^~~~~~~~~ compilation terminated.