submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s416602381
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String str1 = sc.next(); String str2 = sc.next(); int l1 = str1.length(); int l2 = str2.length(); for(int i=0; i<l2; i++) print(str1.charAt(i)); print(str2.charAt(i)); } if(l1 - l2 == 1){ print(str1.charAt( l1 ) ); } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
Main.java:13: error: illegal start of type if(l1 - l2 == 1){ ^ Main.java:13: error: <identifier> expected if(l1 - l2 == 1){ ^ Main.java:13: error: <identifier> expected if(l1 - l2 == 1){ ^ 3 errors
s399311837
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String str1 = sc.next(); String str2 = sc.next(); for(int i=0; i<str1.length() - 1; i++) print(str1.charAt(i)); print(str2.charAt(i)); } if(str1.length() - str2.length()== 1){ print(str1.charAt( str1.length() ) ); }else{ } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
Main.java:11: error: illegal start of type if(str1.length() - str2.length()== 1){ ^ Main.java:11: error: <identifier> expected if(str1.length() - str2.length()== 1){ ^ Main.java:11: error: ';' expected if(str1.length() - str2.length()== 1){ ^ Main.java:13: error: illegal start of type }else{ ^ 4 errors
s857058741
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String str1 = sc.next(); String str2 = sc.next(); for(int i=0; i<str1.length(); i++) print(str1.charAt(i)); print(str2.charAt(i)); } if(str1.length() % 2 == 1){ print(str1.charAt( str1.length() ) ); } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
Main.java:11: error: illegal start of type if(str1.length() % 2 == 1){ ^ Main.java:11: error: <identifier> expected if(str1.length() % 2 == 1){ ^ Main.java:11: error: ';' expected if(str1.length() % 2 == 1){ ^ 3 errors
s008096291
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String str1 = sc.next(); String str2 = sc.next(); for(int i=0; i<str1.length(); i++){ String []word1 = str1.substring(i, i+1); } for(int i=0; i<str2.length(); i++){ String []word2 = str2.substring(i, i+1); } for(int i=0; i<str1.length(); i++){ print( word1[i] ); print( word2[i] ); } if(str1.length() % 2 == 1){ print( word1[ str1.length() ] ); } } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
Main.java:7: error: incompatible types: String cannot be converted to String[] String []word1 = str1.substring(i, i+1); ^ Main.java:10: error: incompatible types: String cannot be converted to String[] String []word2 = str2.substring(i, i+1); ^ Main.java:14: error: cannot find symbol print( word1[i] ); ^ symbol: variable word1 location: class Main Main.java:15: error: cannot find symbol print( word2[i] ); ^ symbol: variable word2 location: class Main Main.java:18: error: cannot find symbol print( word1[ str1.length() ] ); ^ symbol: variable word1 location: class Main 5 errors
s204235013
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String []str = sc.next(); for(int i=0; i<str.length()/2; i++){ print( str[i] ); print( str[i+ (str.length()/2) +1 ] ); } if( str.length() % 2 == 1 ){ print( str[str.length()] ); } } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); }}
Main.java:4: error: incompatible types: String cannot be converted to String[] String []str = sc.next(); ^ Main.java:5: error: cannot find symbol for(int i=0; i<str.length()/2; i++){ ^ symbol: method length() location: variable str of type String[] Main.java:7: error: cannot find symbol print( str[i+ (str.length()/2) +1 ] ); ^ symbol: method length() location: variable str of type String[] Main.java:9: error: cannot find symbol if( str.length() % 2 == 1 ){ ^ symbol: method length() location: variable str of type String[] Main.java:10: error: cannot find symbol print( str[str.length()] ); ^ symbol: method length() location: variable str of type String[] 5 errors
s140208448
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); int O = sc.next(); int E = sc.next(); for (int i = 0; i < O.length(); i++) { print(O.charAt(i)); if (i < E.length()) print(E.charAt(i)); } } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); } }
Main.java:4: error: incompatible types: String cannot be converted to int int O = sc.next(); ^ Main.java:5: error: incompatible types: String cannot be converted to int int E = sc.next(); ^ Main.java:6: error: int cannot be dereferenced for (int i = 0; i < O.length(); i++) { ^ Main.java:7: error: int cannot be dereferenced print(O.charAt(i)); ^ Main.java:8: error: int cannot be dereferenced if (i < E.length()) print(E.charAt(i)); ^ Main.java:8: error: int cannot be dereferenced if (i < E.length()) print(E.charAt(i)); ^ 6 errors
s308345506
p03760
Java
class Main { public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); int O = sc.next(); int E = sc.next(); for (int i = 0; i < O.length; i++) { print(O.charAt(i)); if (i < E.length) print(E.charAt(i)); } } /* 以下、標準出力用関数 */ static public void print(byte what) { System.out.print(what); System.out.flush(); } static public void print(boolean what) { System.out.print(what); System.out.flush(); } static public void print(char what) { System.out.print(what); System.out.flush(); } static public void print(int what) { System.out.print(what); System.out.flush(); } static public void print(long what) { System.out.print(what); System.out.flush(); } static public void print(float what) { System.out.print(what); System.out.flush(); } static public void print(double what) { System.out.print(what); System.out.flush(); } static public void print(String what) { System.out.print(what); System.out.flush(); } static public void print(Object... variables) { StringBuilder sb = new StringBuilder(); for (Object o : variables) { if (sb.length() != 0) { sb.append(" "); } if (o == null) { sb.append("null"); } else { sb.append(o.toString()); } } System.out.print(sb.toString()); } static public void println() { System.out.println(); } static public void println(byte what) { System.out.println(what); System.out.flush(); } static public void println(boolean what) { System.out.println(what); System.out.flush(); } static public void println(char what) { System.out.println(what); System.out.flush(); } static public void println(int what) { System.out.println(what); System.out.flush(); } static public void println(long what) { System.out.println(what); System.out.flush(); } static public void println(float what) { System.out.println(what); System.out.flush(); } static public void println(double what) { System.out.println(what); System.out.flush(); } static public void println(String what) { System.out.println(what); System.out.flush(); } static public void println(Object... variables) { print(variables); println(); } static public void println(Object what) { if (what == null) { System.out.println("null"); } else if (what.getClass().isArray()) { printArray(what); } else { System.out.println(what.toString()); System.out.flush(); } } static public void printArray(Object what) { if (what == null) { System.out.println("null"); } else { String name = what.getClass().getName(); if (name.charAt(0) == '[') { switch (name.charAt(1)) { case '[': System.out.println(what); break; case 'L': Object poo[] = (Object[]) what; for (int i = 0; i < poo.length; i++) { if (poo[i] instanceof String) { System.out.println("[" + i + "] \"" + poo[i] + "\""); } else { System.out.println("[" + i + "] " + poo[i]); } } break; case 'Z': boolean zz[] = (boolean[]) what; for (int i = 0; i < zz.length; i++) { System.out.println("[" + i + "] " + zz[i]); } break; case 'B': byte bb[] = (byte[]) what; for (int i = 0; i < bb.length; i++) { System.out.println("[" + i + "] " + bb[i]); } break; case 'C': char cc[] = (char[]) what; for (int i = 0; i < cc.length; i++) { System.out.println("[" + i + "] '" + cc[i] + "'"); } break; case 'I': int ii[] = (int[]) what; for (int i = 0; i < ii.length; i++) { System.out.println("[" + i + "] " + ii[i]); } break; case 'J': long jj[] = (long[]) what; for (int i = 0; i < jj.length; i++) { System.out.println("[" + i + "] " + jj[i]); } break; case 'F': float ff[] = (float[]) what; for (int i = 0; i < ff.length; i++) { System.out.println("[" + i + "] " + ff[i]); } break; case 'D': double dd[] = (double[]) what; for (int i = 0; i < dd.length; i++) { System.out.println("[" + i + "] " + dd[i]); } break; default: System.out.println(what); } } else { System.out.println(what); } } System.out.flush(); } }
Main.java:4: error: incompatible types: String cannot be converted to int int O = sc.next(); ^ Main.java:5: error: incompatible types: String cannot be converted to int int E = sc.next(); ^ Main.java:6: error: int cannot be dereferenced for (int i = 0; i < O.length; i++) { ^ Main.java:7: error: int cannot be dereferenced print(O.charAt(i)); ^ Main.java:8: error: int cannot be dereferenced if (i < E.length) print(E.charAt(i)); ^ Main.java:8: error: int cannot be dereferenced if (i < E.length) print(E.charAt(i)); ^ 6 errors
s424419587
p03760
C++
#include<iostream> using namespace std; int main(){ char a[100001]; char b[100001]; char c[100001]; cin>>a>>b; int j=1,k=0,l=1; for(int i = 0;i<a.length();i++){ c[k]=a[i]; c[l]=b[i]; k+=2;l+=2; } for(int i = 0;i<a.length();i++){ cout<<c[i]; } }
a.cc: In function 'int main()': a.cc:9:23: error: request for member 'length' in 'a', which is of non-class type 'char [100001]' 9 | for(int i = 0;i<a.length();i++){ | ^~~~~~ a.cc:14:23: error: request for member 'length' in 'a', which is of non-class type 'char [100001]' 14 | for(int i = 0;i<a.length();i++){ | ^~~~~~
s932186694
p03760
C++
#include <bits/stdc++.h> using namespace std; signed main(){ string o,e; cin>>o>>e; string ans=""; rep(i,o.size()+e.size()){ ans+=(i%2?e.at(i/2):o.at(i/2)); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'i' was not declared in this scope 6 | rep(i,o.size()+e.size()){ | ^ a.cc:6:5: error: 'rep' was not declared in this scope 6 | rep(i,o.size()+e.size()){ | ^~~
s386797203
p03760
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s,t; cin>>s>>t; f(i,t.size()){ cout<<s[i]<<t[i]; } if(t.size()<s.size()) cout<<s[s.size()-1]; puts(""); return 0; }
a.cc: In function 'int main()': a.cc:6:11: error: 'i' was not declared in this scope 6 | f(i,t.size()){ | ^ a.cc:6:9: error: 'f' was not declared in this scope 6 | f(i,t.size()){ | ^
s288357922
p03760
C++
#include<iostream> using namespace std; int main(){ string S,T; cin>>S>>T; for(auto &x:S,auto &t:T){ cout<<x<<t; } cout<<endl; }
a.cc: In function 'int main()': a.cc:7:17: error: expected primary-expression before 'auto' 7 | for(auto &x:S,auto &t:T){ | ^~~~ a.cc:7:17: error: expected ')' before 'auto' 7 | for(auto &x:S,auto &t:T){ | ~ ^~~~ | ) a.cc:7:24: error: found ':' in nested-name-specifier, expected '::' 7 | for(auto &x:S,auto &t:T){ | ^ | :: a.cc:7:23: error: 't' has not been declared 7 | for(auto &x:S,auto &t:T){ | ^ a.cc:7:26: error: qualified-id in declaration before ')' token 7 | for(auto &x:S,auto &t:T){ | ^
s783738747
p03760
C++
#include<iostream> using namespace std; int main(){ string S,T; cin>>S>>T; for(auto &x:S,auto &t:yT){ cout<<x<<t; } cout<<endl; }
a.cc: In function 'int main()': a.cc:7:17: error: expected primary-expression before 'auto' 7 | for(auto &x:S,auto &t:yT){ | ^~~~ a.cc:7:17: error: expected ')' before 'auto' 7 | for(auto &x:S,auto &t:yT){ | ~ ^~~~ | ) a.cc:7:24: error: found ':' in nested-name-specifier, expected '::' 7 | for(auto &x:S,auto &t:yT){ | ^ | :: a.cc:7:23: error: 't' has not been declared 7 | for(auto &x:S,auto &t:yT){ | ^ a.cc:7:27: error: qualified-id in declaration before ')' token 7 | for(auto &x:S,auto &t:yT){ | ^
s366951431
p03760
C++
#include <iostream> #include <array> #include <vector> #include <iomanip> #include <string> #include <cmath> #include <algorithm> #include <queue> #include <map> #include <set> using namespace std; typedef pair<int,int> P; typedef long long LL; const LL INF=300000000; const LL MOD=1000000007; int main(){ string o,e; cin>>o>>e; string ans; for(int i=0;i<o.size;++i){ if(i%2==0){ ans.push_back(o[i]); } else ans.push_back(e[i]); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:25:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 25 | for(int i=0;i<o.size;++i){ | ~~^~~~ | ()
s031879938
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,t; cin>>s>>t; int i,n=s.size(),m=t.size(); for(i=0;i<m+n;i++){ if(i%2==0) cout<s.at(i/2); else cout<<t.at((i-1)/2); } }
a.cc: In function 'int main()': a.cc:11:11: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 11 | cout<s.at(i/2); | ~~~~^~~~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} | std::ostream {aka std::basic_ostream<char>} a.cc:11:11: note: candidate: 'operator<(int, int)' (built-in) 11 | cout<s.at(i/2); | ~~~~^~~~~~~~~~ a.cc:11:11: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1224: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>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1317: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>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 11 | cout<s.at(i/2); | ^ 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:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 11 | cout<s.at(i/2); | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 11 | cout<s.at(i/2); | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:11:20: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:11:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 11 | cout<s.at(i/2); | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_st
s592548700
p03760
C++
#include <iostream> std::string O, E; int main() { std::cin >> O >> E; for (int i=0; i<E.size(); ++i) { std::cout << O[i] << E[i]; } std::cout << ( (O.size() - E.size() == 1) ? O.back() : "" ) << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:10:45: error: operands to '?:' have different types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char*' 10 | std::cout << ( (O.size() - E.size() == 1) ? O.back() : "" ) << '\n'; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
s712692180
p03760
C
#include<stdio.h> int main(){ char O[51], E[51], p[101]; int len = 0; while(E[len]){ len++; } for (i = 0; i < len; i++){ p[2*i] = O[i]; p[2*i + 1] = E[i]; } p[2*i] = '\0'; printf("%s\n", p); return 0; }
main.c: In function 'main': main.c:11:8: error: 'i' undeclared (first use in this function) 11 | for (i = 0; i < len; i++){ | ^ main.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
s004772331
p03760
C++
#include<iostream> #include<vector> #include<algorithm> #include<complex> using namespace std; int main(){ char a[51], b[51]; cin >> a >> b; for (int i = 0; i < strlen(a); i++){ cout << a[i]; if (b[i] != '\0'){ cout << b[i]; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:29: error: 'strlen' was not declared in this scope 9 | for (int i = 0; i < strlen(a); i++){ | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<complex> +++ |+#include <cstring> 5 | using namespace std;
s260567882
p03760
C++
//#define _GRIBCXX_DEBUG #include <bits/stdc++.h> # define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; template<typename integer> integer __lcm(integer a, integer b) { return (a * b) / __gcd(a, b); } int main() { string odd, evn; cin >> odd >> evn; size_t t = max(odd.size(), evn.size()); rep (i, t) { if (i < odd.size()) { cout << odd[i]; } if (i < evn.size()) { cout << evn[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:11:12: note: to match this '{' 11 | int main() { | ^
s529123905
p03760
C++
#include<bits/stdc++.h> using namespace std; int main() { char a[110],b[110],t1=0,t2=0; scanf("%s%s",a,b); int len=max(strlen(a),strlen(b)); for(int i=0;i<len*2;i++) { if(i%2==0) if(a[t]!=' ') cout<<a[t1++]; else if(a[t]!=' ') cout<<b[t2++]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:30: error: 't' was not declared in this scope 11 | if(a[t]!=' ') | ^
s173268023
p03760
C
#include<stdio.h> int N, M; char O[51]; int main(){ c=getchar(); while(c!=10){ O[N]=c; c=getchar(); N++; } c=getchar(); while(c!=10){ putchar(O[M]); putchar(c); c=getchar(); M++; } if(N!=M){ putchar(O[N-1]); } putchar(10); }
main.c: In function 'main': main.c:5:3: error: 'c' undeclared (first use in this function) 5 | c=getchar(); | ^ main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
s115581535
p03760
C++
ome Tasks Submit Clarifications Results Standings Custom Test Editorial Submission #3809874 Source code Copy #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { int i,j,k,as=0,bs=0; string a,b; cin>>a>>b; string c; for(i=0;i<a.size();i++){ cout<<a[i]; if(i<b.size()) cout<<b[i]; } return 0; }
a.cc:9:12: error: stray '#' in program 9 | Submission #3809874 | ^ a.cc:1:1: error: 'ome' does not name a type 1 | ome | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:12: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__(
s306245354
p03760
C++
#include<bits/stdc++.h> using namespace std ; int main (){ string sa,sb ,sc ; getline (cin ,sa ); getline (cin,sb); int i ,j = 0,k = 0 .len ; len = sa .size()+ sb .size(); for (i = 0 ; i < len ; i ++){ if (i %2 == 1)sc + = sb [ j ++]; else sc + = sa [ k ++]; } cout << sc ; return 0 ; }
a.cc: In function 'int main()': a.cc:7:29: error: request for member 'len' in '0', which is of non-class type 'int' 7 | int i ,j = 0,k = 0 .len ; | ^~~ a.cc:8:9: error: 'len' was not declared in this scope 8 | len = sa .size()+ sb .size(); | ^~~ a.cc:10:36: error: expected primary-expression before '=' token 10 | if (i %2 == 1)sc + = sb [ j ++]; | ^ a.cc:11:27: error: expected primary-expression before '=' token 11 | else sc + = sa [ k ++]; | ^
s345236092
p03760
C++
#include < bits / stdc ++.h > using namespace std ; int main (){ string sa,sb ,sc ; getline (cin ,sa ); getline (cin,sb); int i ,j = 0,k = 0 .len ; len = sa .size()+ sb .size(); for (i = 0 ; i < len ; i ++){ if (i %2 == 1)sc + = sb [ j ++]; else sc + = sa [ k ++]; } cout << sc ; return 0 ; }
a.cc:1:10: fatal error: bits / stdc ++.h : No such file or directory 1 | #include < bits / stdc ++.h > | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s700633455
p03760
C++
#include < bits / stdc ++。h > using namespace std ; int main (){ string sa,sb ,sc ; getline (cin ,sa ); getline (cin,sb); int i ,j = 0,k = 0 .len ; len = sa .size()+ sb .size(); for (i = 0 ; i < len ; i ++){ if (i %2 == 1)sc + = sb [ j ++]; else sc + = sa [ k ++]; } cout << sc ; return 0 ; }
a.cc:1:10: fatal error: bits / stdc ++。h : No such file or directory 1 | #include < bits / stdc ++。h > | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s976918928
p03760
C++
#include < bits / stdc ++。h > 使用命名空间std ; int main (){ string sa ,sb ,sc ; getline (cin ,sa ); getline (cin ,sb ); int i ,j = 0 ,k = 0 ,len ; len = sa 。size ()+ sb 。size (); for (i = 0 ; i < len ; i ++){ if (i %2 == 1 )sc + = sb [ j ++]; else sc + = sa [ k ++]; } cout << sc ; 返回0 ; }
a.cc:1:10: fatal error: bits / stdc ++。h : No such file or directory 1 | #include < bits / stdc ++。h > | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s244440871
p03760
C++
using namespace std; #if __has_include("print.hpp") #include "print.hpp" #endif #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() typedef long long ll; typedef pair<int, int> p; int main(){ string o, e; cin >> o >> e; for (int i = 0; i < int(e.size()); i++) { cout << o[i] << e[i]; } if(o.size() > e.size()) { cout << o[int(o.size()-1)] << endl; }else{ cout << endl; } }
a.cc:11:9: error: 'pair' does not name a type 11 | typedef pair<int, int> p; | ^~~~ a.cc: In function 'int main()': a.cc:14:3: error: 'string' was not declared in this scope 14 | string o, e; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:15:3: error: 'cin' was not declared in this scope 15 | cin >> o >> e; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:15:10: error: 'o' was not declared in this scope 15 | cin >> o >> e; | ^ a.cc:15:15: error: 'e' was not declared in this scope 15 | cin >> o >> e; | ^ a.cc:17:5: error: 'cout' was not declared in this scope 17 | cout << o[i] << e[i]; | ^~~~ a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:21:4: error: 'cout' was not declared in this scope 21 | cout << o[int(o.size()-1)] << endl; | ^~~~ a.cc:21:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:21:34: error: 'endl' was not declared in this scope 21 | cout << o[int(o.size()-1)] << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:23:5: error: 'cout' was not declared in this scope 23 | cout << endl; | ^~~~ a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:23:13: error: 'endl' was not declared in this scope 23 | cout << endl; | ^~~~ a.cc:23:13: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s783032363
p03760
C++
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <utility> using Int = long long; using namespace std; #define REP(i,n) for(int i=0;i<n;i++) int main() { string O, E; cin >> O >> E; int m = min(O.size(), E.size()); for (int i = 0; i < m; i++) { cout << O[i] << E[i]; } if (m < O.size()) { cout << O[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:19: error: 'i' was not declared in this scope 17 | cout << O[i]; | ^
s248432272
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O, E; cin >> O >> E; if (O.length() == E.length()) { for (int i = 0; i < O.length(); i++) { cout << O[i] << E[i] << flush; } } else { for (int i = 0; i < O.length() - 1; i++) { cout << O[i] << E[i] << flush; } cout << E[size() - 1] << flush; } cout << endl; }
a.cc: In function 'int main()': a.cc:15:19: error: no matching function for call to 'size()' 15 | cout << E[size() - 1] << flush; | ~~~~^~ In file included from /usr/include/c++/14/string:53, 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/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidate expects 1 argument, 0 provided
s452100103
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O, E; cin >> O >> E; E = E +''; for (int i = 0; i < O.length(); i++) { cout << O[i] << E[i] << flush; } cout << endl; }
a.cc:7:10: error: empty character constant 7 | E = E +''; | ^~
s832920230
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O, E; cin >> O >> E; E +=''; for (int i = 0; i < O.length(); i++) { cout << O[i] << E[i] << flush; } cout << endl; }
a.cc:7:7: error: empty character constant 7 | E +=''; | ^~
s911385252
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O, E; cin >> O >> E; E[E.size() - 1] ==''; for (int i = 0; i < O.length(); i++) { cout << O[i] << E[i] << flush; } cout << endl; }
a.cc:7:21: error: empty character constant 7 | E[E.size() - 1] ==''; | ^~
s647010029
p03760
C++
#include<bits/stdc++.h> using namespace std; string a,b; int main(){ cin>>a>>b; int len=max(a.length(),b.length()); for(int i=0;i<len;i++) if(a[i]!='\0')putchar(a[i]); if(b[i]!='\0')putchar(b[i]); } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'i' was not declared in this scope 9 | if(b[i]!='\0')putchar(b[i]); | ^ a.cc: At global scope: a.cc:11:5: error: 'cout' does not name a type 11 | cout<<endl; | ^~~~ a.cc:12:5: error: expected unqualified-id before 'return' 12 | return 0; | ^~~~~~ a.cc:13:1: error: expected declaration before '}' token 13 | } | ^
s099985306
p03760
C++
#include<bits/stdc++.h> using namespace std; int main(){ string o, e; cin >> o >> e; string s = ""; for(int i = 0; i < max(e.size(), o.size(); i++){ s += o[i] + e[i]; } cout << s << endl; }
a.cc: In function 'int main()': a.cc:7:44: error: expected ')' before ';' token 7 | for(int i = 0; i < max(e.size(), o.size(); i++){ | ~ ^ | )
s241381267
p03760
C++
#include<cstring> using namespace std; int main(){ char ch1[50],ch2[50]; while(cin>>ch1>>ch2){ int m=strlen(ch1); int n=strlen(ch2); for(int i=0;i<m;i++) {cout<<ch1[i]; cout<<ch2[i];} if(m>n) for(int j=n;j<m;j++) cout<<ch1[j]; else for(int k=m;k<n;k++) cout<<ch2[k]; cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | while(cin>>ch1>>ch2){ | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cstring> +++ |+#include <iostream> 2 | using namespace std; a.cc:9:3: error: 'cout' was not declared in this scope 9 | {cout<<ch1[i]; | ^~~~ a.cc:9:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:13:2: error: 'cout' was not declared in this scope 13 | cout<<ch1[j]; | ^~~~ a.cc:13:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:5: error: 'cout' was not declared in this scope 16 | cout<<ch2[k]; | ^~~~ a.cc:16:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:2: error: 'cout' was not declared in this scope 17 | cout<<endl; | ^~~~ a.cc:17:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:8: error: 'endl' was not declared in this scope 17 | cout<<endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<cstring> +++ |+#include <ostream> 2 | using namespace std;
s519720199
p03760
C++
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> using namespace std; int main(){ int i , j , h , w; char lei = '0', a[51][51]; while (cin >> h >> w){ for(i = 0;i < h;i++) { for(j = 0;j < w;j++) cin>>a[i][j]; } for(i = 0;i < h;i++) { for(j = 0;j < w;j++) { lei='0'; if(a[i][j]=='.') { if(a[i-1][j-1]=='#') lei++; if(a[i][j-1]=='#') lei++; if(a[i+1][j-1]=='#') lei++; if(a[i-1][j]=='#') lei++; if(a[i+1][j]=='#') lei++; if(a[i-1][j+1]=='#') lei++; if(a[i][j+1]=='#') lei++; if(a[i+1][j+1]=='#') lei++; a[i][j]=lei; } else a[i][j]='#'; } } for(i = 0;i < h;i++) { for(j = 0;j < w;j++) cout<<a[i][j]; cout<<endl; } } return 0; } 选择文件
a.cc:58:4: error: '\U00009009\U000062e9\U00006587\U00004ef6' does not name a type 58 | 选择文件 | ^~~~~~~~
s452830231
p03760
C++
#include<bits/stdc++.h> using namespace std; string s1,s2; int main(void) { getline(cin,s1); getline(cin,s2); cout<<s1[0]; for(int i=0;i<s1.size()+s2.size()-1;++i) i%2?cout<<s1[i/2+1]:s2[i/2+1]; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: operands to '?:' have different types 'std::basic_ostream<char>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 10 | i%2?cout<<s1[i/2+1]:s2[i/2+1];
s597353429
p03760
C
#include<stdio.h> char odd[51], even[51]; int main(void) { int i; gets_s(odd, 51); gets_s(even, 51); for (i = 0; i <= 50; i++) { if (odd[i] == '\n') { printf("\n"); break; } putchar(odd[i]); putchar(even[i]); } return 0; }
main.c: In function 'main': main.c:9:9: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration] 9 | gets_s(odd, 51); | ^~~~~~
s256115424
p03760
C++
#include <bits/stdc++.h> #include <algorithm> using namespace std; int main() { string o,e; cin>>o>>e; for(int i=0;i<o.size();i++){ if(o.size>e.size() && i==o.size-1) cout<<o[i]; else cout<<o[i]<<e[i]; } }
a.cc: In function 'int main()': a.cc:10:14: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 10 | if(o.size>e.size() && i==o.size-1) cout<<o[i]; | ~~^~~~ | () a.cc:10:36: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 10 | if(o.size>e.size() && i==o.size-1) cout<<o[i]; | ~~^~~~ | ()
s086611106
p03760
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<array> using namespace std; int main(){ string a,b; cin >> a >> b; for(int i = 0;i < b.size;i++){ cout << a[i] << b[i]; } if(a.size() != b.size()) cout << a[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 11 | for(int i = 0;i < b.size;i++){ | ~~^~~~ | () a.cc:15:15: error: 'i' was not declared in this scope 15 | cout << a[i]; | ^
s048245911
p03760
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<array> using namespace std; int main(){ string a,b; cin >> a >> b; for(int i = 0;i < b.size;i++){ cout << a[i] << b[i] } if(a.size() != b.size()) cout << a[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:11:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 11 | for(int i = 0;i < b.size;i++){ | ~~^~~~ | () a.cc:12:27: error: expected ';' before '}' token 12 | cout << a[i] << b[i] | ^ | ; 13 | } | ~ a.cc:15:15: error: 'i' was not declared in this scope 15 | cout << a[i]; | ^
s572545090
p03760
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<array> using namespace std; int main(){ string a,b; cin >> a >> b; for(int i = 0;i < a.size();i++){ cout << a[i] if(b.size() >= i) cout << b[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:12:19: error: expected ';' before 'if' 12 | cout << a[i] | ^ | ; 13 | if(b.size() >= i) | ~~
s379302585
p03760
C++
#include<bits/stdc++.h> using namespace std; char a[52],b[52]; int main() { cin>>a; cin>>b; int i,x=strlen(a),y=strlen(b),l=min(la,lb),k=max(la,lb); for(i=0;i<=l-1;i++) cout<<a[i]<<b[i]; if(x>y) for(i=l;i<=k-1;i++) cout<<a[i]; else for(i=l;i<=k-1;i++) cout<<b[i]; return 0; }//dasddsdas
a.cc: In function 'int main()': a.cc:8:39: error: 'la' was not declared in this scope; did you mean 'l'? 8 | int i,x=strlen(a),y=strlen(b),l=min(la,lb),k=max(la,lb); | ^~ | l a.cc:8:42: error: 'lb' was not declared in this scope; did you mean 'l'? 8 | int i,x=strlen(a),y=strlen(b),l=min(la,lb),k=max(la,lb); | ^~ | l a.cc:12:16: error: 'k' was not declared in this scope 12 | for(i=l;i<=k-1;i++) | ^ a.cc:15:20: error: 'k' was not declared in this scope 15 | for(i=l;i<=k-1;i++) | ^
s887812451
p03760
C++
#include<bits/stdc++.h> using namespace std; string a,b; int main(){ cin<<a>>b; for(int i=0;i<max(a.size(),b.size());i++){ cout<<a[i]; if(b[i]!=0) cout<<b[i]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 5 | cin<<a>>b; | ~~~^~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:5:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 5 | cin<<a>>b; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:5:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 5 | cin<<a>>b; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed
s279107536
p03760
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll #define REP(i,n) for(ll i=0;i<n;++i) #define SORT(name) sort(name.begin(), name.end()) #define ZERO(p) memset(p, 0, sizeof(p)) #define MINUS(p) memset(p, -1, sizeof(p)) #if 1 # define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__) #else # define DBG(fmt, ...) #endif const ll LLINF = (1LL<<60); const int INF = (1LL<<30); const double DINF = std::numeric_limits<double>::infinity(); const int MOD = 1000000007; #define MAX_N 110 signed main() { string O, E; cin >> O >> E; REP(i, O.length()) { if(i >= E.length()) { printf("%c", O[i]) } else { printf("%c%c", O[i], E[i]); } } printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:30:31: error: expected ';' before '}' token 30 | printf("%c", O[i]) | ^ | ; 31 | } else { | ~
s427733557
p03760
C++
#include<iostream> #include<string> #include<cstring> using namespace std; int main() { string a,b; cin>>a>>b; int s1=a.size(); int s2=b.size(); if(s1==s2) for(int i=0;i<s1;i++)cout<<a[i]<<b[i]; else { for(int i=0;i<s2;i++)cout<<<a[i]<<b[i]; cout<<a[s1-1]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:36: error: expected primary-expression before '<' token 14 | for(int i=0;i<s2;i++)cout<<<a[i]<<b[i]; | ^
s828557192
p03760
C++
#include<iostream> #include<algorithm> #include<string> #include<map> #include<set> #include<vector> #include<string.h> #include<math.h> #include<stdio.h> #include<queue> #include<utility> #include<cstdio> #include<cstring> #include<new> #include<new.h> #include<float.h> #include<ctype.h> #include<cfloat> #include<cmath> #include<cctype> #include<errno.h> #include<cerrno> #include<memory> #include<memory.h> #include<assert.h> #include<cassert> #include<deque> #include<sstream> #define fo(i,w,n) for(int i=(int) w;i<(int) n;i++) #define qui queue<int> #define vit vector<int> #define ll long long #define pb push_back #define lb lower_bound #define ub upper_bound #define prq priority_queue #define pii pair<int,int> #define mp make_pair #define sz size() #define em empty() #define ct continue #define ms multiset #define all(a) (a).begin(),(a).end() #define pf push_front #define ppf pop_front() using namespace std; int main() { string a,b; cin>>a>>b; fo(i,0,max(a.sz,b.sz)){ if(i<a.sz)cout<<a[i]; if(i<b.sz)cout<<b[i]; } return 0; }
a.cc:15:9: fatal error: new.h: No such file or directory 15 | #include<new.h> | ^~~~~~~ compilation terminated.
s445375197
p03760
C++
#include<bits/stdc++.h> using namespace std; int main() { string a,b; int len1,len2,minn; cin>>a>>b; len1=a.length(); len2=b.length(); minn=min(len1,len2); maxx=max(len1,len2); for(int i=0;i<minn;i++) cout<<a[i]<<b[i]; if(len1>len2) for(int i=minn;i<maxx;i++) cout<<a[i]; else for(int i=minn;i<maxx;i++) cout<<b[i]; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'maxx' was not declared in this scope 11 | maxx=max(len1,len2); | ^~~~
s106868348
p03760
C++
#include<queue> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; char a[51],b[51]; int main() { cin>>a>>b; for (int i=0;i<=strlen(a)-1;i++) { cout<<a[i] if (b[i]!=' ') cout<<b[i]; } // system("pause"); return 0; }
a.cc: In function 'int main()': a.cc:13:27: error: expected ';' before 'if' 13 | cout<<a[i] | ^ | ; 14 | if (b[i]!=' ') cout<<b[i]; | ~~
s526710682
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O,E,a; int o,e; cin >> O >> E; o=O.size(); e=E.size(); if(o==e){ for(int i=0;i<e;i++){ a+=O.at(i)+E.at(i); } } else{ for(int i=0;i<e;i++){ a+=O.at(i)+E.at(i); } a+=O.at(o-1); } cout << a << endl; } }
a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s183469416
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string O,E,a,o,e; cin >> O >> E; o=O.size(); e=E.size(); if(o==e){ for(int i=0;i<e;i++){ a+=O.at(i)+E.at(i); } } else{ for(int i=0;i<e;i++){ a+=O.at(i)+E.at(i); } a+=O.at(o-1); } cout << a << endl; } }
a.cc: In function 'int main()': a.cc:10:18: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 10 | for(int i=0;i<e;i++){ | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1224: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>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1317: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>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:10:19: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:10:19: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ 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:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:10:19: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:10:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | for(int i=0;i<e;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/inc
s064260813
p03760
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ABC_058_B { public static void main(String[] args) throws IOException { BufferedReader oi = new BufferedReader(new InputStreamReader(System.in)); String[] odd = oi.readLine().split(""); String[] even = oi.readLine().split(""); int od = odd.length; int ev = even.length; String a=odd[0]; for(int i=1; i < od + ev; i++) { if(i%2==1) a = a + odd[i/2]; else a = a + even[i/2]; } System.out.println(a); } }
Main.java:5: error: class ABC_058_B is public, should be declared in a file named ABC_058_B.java public class ABC_058_B { ^ 1 error
s018529637
p03760
C++
#include<bits/stdc++.h> using namespace std; string a,b; int main() { cin>>a>>b; for(int s=0;s<min(a.size(),b.size());s++) { cout<<a[s]<<b[s]; } if(a.size()!=b.size()) { if(a.size()>b.size()) { for(int s=min(a.size(),b.size()),s<a.size();s++) { cout<<a[s]; } } else for(int s=min(a.size(),b.size()),s<b.size();s++) { cout<<a[s]; } } }
a.cc: In function 'int main()': a.cc:15:59: error: expected ';' before '<' token 15 | for(int s=min(a.size(),b.size()),s<a.size();s++) | ^ | ; a.cc:15:59: error: expected primary-expression before '<' token a.cc:21:51: error: expected ';' before '<' token 21 | for(int s=min(a.size(),b.size()),s<b.size();s++) | ^ | ; a.cc:21:51: error: expected primary-expression before '<' token
s369405829
p03760
C++
#include<iostream> #include<cmath> #include<cstring> #include<algorithm> #include<vector> using namespace std; int main() { char a[50],b[50],x,y=0,o,p; gets(a); gets(b); o=strlen(a); p=strlen(b); if(o-p==1) { y++; } for(x=0;x<p;x++) { cout<<a[x]; cout<<b[x]; } if(y==1) { cout<<a[o]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(a); | ^~~~ | getw
s754491850
p03760
C++
#include<iostream> #include<cmath> #include<cstring> #include<algorithm> #include<vector> using namespace std; int main() { char a[50],b[50],x,y=0,o,p; gets(a); gets(b); o=strlen(a); p=strlen(b); if(o-p==1) { y++; } for(x=0;x<p;x++) { cout<<a[x]; cout<<b[x]; } if(y==1) { cout<<a[o]; } cout<<endl; }
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(a); | ^~~~ | getw
s348043572
p03760
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Main main=new Main(); main.run(); } void run() { Scanner sc=new Scanner(System.in); String[] Odd=sc.next().split(""); String[] Even=sc.next().split(""); int length=Odd.length+Even.length; int indexO=0; int indexE=0; StringBuilder result=new StringBuilder(); while(true) { if(indexO<=Odd.length-1) { result.append(Odd[indexO]); } if(indexE<=Even.length-1) { result.append(Even[indexE]); } if(indexO>=Odd.length-1 && indexE>=Even.length-1) { break; }else { indexO++; indexE++; } } System.out.println(result.toString()); } }
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:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s615649676
p03760
C++
#include <iostream> using namespace std; int main(void){ // Your code here! string s, t; cin >> s >> t; for (int i = 0; i < t.length(); i++) { cout << s[i] << t[i]; } if (s.length() - t.length) cout << s[s.length() - 1] << endl; }
a.cc: In function 'int main()': a.cc:10:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 10 | if (s.length() - t.length) cout << s[s.length() - 1] << endl; | ~~^~~~~~ | ()
s550215356
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; bool mutch; if(a.size() == b.size()){ mutch = true; } else{ mutch = false; } for(int i = 0;i < a.size;i++){ cout << a.at(i); if(mutch = true || i != a.size()-1) cout << b.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:14:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 14 | for(int i = 0;i < a.size;i++){ | ~~^~~~ | ()
s373330269
p03760
C++
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; bool mutch; if(a.size() == b.size()){ mutch = true; } else{ mutch = false; } for(int i = 0;i < a.size){ cout << a.at(i); if(mutch = true || i != a.size()-1) cout << b.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:14:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 14 | for(int i = 0;i < a.size){ | ~~^~~~ | () a.cc:14:33: error: expected ';' before ')' token 14 | for(int i = 0;i < a.size){ | ^ | ;
s696725197
p03760
C++
#include <iostream> using namespace std; int main(void){ str a[50]; str b[50]; int l = lenght(str) for (int i = l; i <= l;i++) { cout << a[i] << b[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:4:3: error: 'str' was not declared in this scope; did you mean 'std'? 4 | str a[50]; | ^~~ | std a.cc:5:6: error: expected ';' before 'b' 5 | str b[50]; | ^~ | ; a.cc:6:11: error: 'lenght' was not declared in this scope 6 | int l = lenght(str) | ^~~~~~ a.cc:7:19: error: 'i' was not declared in this scope 7 | for (int i = l; i <= l;i++) { | ^
s540074595
p03760
C++
#include <bits/stdc++.h> using namespace std; int main(){ char a[50],b[50],e[100]; int c = 0,d = 0,f = 0; cin >> a >> b; c = strlen(a); d = strlen(b); for(int S = 0;S < c;S += 0){ e[S] += a[f]; e[S+1] += b[f]; f++; S += 2; } if(c != d){ e[S] += a[f]; } for(int S = 0;S < strlen(e);S++){ cout << e[S] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:5: error: 'S' was not declared in this scope 18 | e[S] += a[f]; | ^
s315768273
p03760
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include<cstdio> #include<bits/stdc++.h> using namespace std; using ll =long long; int main (void) { string O,E; string ans; cin >> O; cin >> E; for (int i;i<O.size();i++){ ans += O[i]; if (E[i]='') { cout << ans; return 0; } ans += E[i]; } cout << ans; }
a.cc:18:14: error: empty character constant 18 | if (E[i]='') { | ^~
s778865160
p03760
C++
#include <bits/stdc++.h> using namespace std ; int main() { string s,c; cin>>s>>c; for(int i=0;i<s.size();i++) { cout<<s[i]; if(i<O.size())cout<<c[i]; } return 0; }
a.cc: In function 'int main()': a.cc:10:14: error: 'O' was not declared in this scope 10 | if(i<O.size())cout<<c[i]; | ^
s981028644
p03760
C++
#include<bits/stdc++.h> using namespace std; string a,b; int sa,sb; int main() { cin>>a>>b; sa=a.length(); sb=b.length(); if(sa==sb) { for(i=1;i<=sa;i++) cout<<a[i]<<b[i]; } else { for(i=1;i<=sb;i++) cout<<a[i]<<b[i]; cout<<a[sa]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: 'i' was not declared in this scope 12 | for(i=1;i<=sa;i++) | ^ a.cc:17:13: error: 'i' was not declared in this scope 17 | for(i=1;i<=sb;i++) | ^
s429003805
p03760
C++
#include<iostream> #include<cstdio> using namespace std; char a[60],b[60]; int lena,lenb,lenn,lenx; int main() { cin>>a>>b; lena=strlen(a); lenb=strlen(b); lenn=min(lena,lenb); lenx=max(lena,lenb); for(int i=0;i<=lenn-1;i++) cout<<a[i]<<b[i]; if(lena>lenb) for(int i=lenn;i<=lenx-1;i++) cout<<a[i]; else for(int i=lenn;i<=lenx-1;i++) cout<<b[i]; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: 'strlen' was not declared in this scope 9 | lena=strlen(a); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdio> +++ |+#include <cstring> 3 | using namespace std;
s345272919
p03760
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> using namespace std; string a,b; int main() { int l; cin>>a>>b; l=strlen(a); for(int i=0;i<l;i++) cout<<a[i]<<b[i]; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 13 | l=strlen(a); | ^ | | | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/cstring:43, from a.cc:6: /usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)' 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~
s042604830
p03760
Java
import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String O = sc.next(); String E = sc.next(); for(int i = 0; i < O.length() - 1; i++) { char o = O.charAt(i); char e = E.charAt(i); System.out.print(o); System.out.print(e); } System.out.print(O.charAt(O.length() -1)); if(E.length() == O.length()) System.out.println(E.charAt(E.length() - 1); } }
Main.java:16: error: ')' or ',' expected if(E.length() == O.length()) System.out.println(E.charAt(E.length() - 1); ^ 1 error
s272604173
p03760
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string o,e; cin>>o>>e; for(int i=0;i<o.length();i++) cout<<o[i]<<b[i]; system ("pause"); return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: 'b' was not declared in this scope 10 | cout<<o[i]<<b[i]; | ^
s109008094
p03760
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair<ll, int> P; #define MOD (1000000007ll) #define l_ength size ll sq(ll x){ return x*x; } void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } bool isvowel(char c){ int i; string v="aeiou"; for(i = (v.size()-1); i>=0; --i){ if(c == v[i]){ return true; } } return false; } ll manhattan(ll x1, ll y1, ll x2, ll y2){ return ((ll)(abs(x1-x2)+abs(y1-y2))); } ll digit(ll x){ ll ans = 0ll; if(!x){ return 0ll; } while(x>0){ ans++; x /= 10; } return ans; } ll f(ll a, ll b){ return max(digit(a),digit(b)); } int main(void){ int n,i; string o,e; cin >> o; cin >> e; n = e.l_ength(); for(i=0; i<n; i++){ cout << o[i] << e[i]; } if(o.length > n){ cout << o[n]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:59:14: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 59 | if(o.length > n){ | ~~^~~~~~ | ()
s263481673
p03760
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <stack> #include <queue> #include <functional> #include <math.h> #include <stdlib.h> #include <map> #include <deque> #include <sys/timeb.h> #include <fstream> using namespace std; #define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repr(i,0,n) #define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--) #define reprev(i,n) reprrev(i,0,n) #define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define mp make_pair #define mt make_tuple #define INF 1050000000 #define INFL 1100000000000000000LL #define EPS (1e-10) #define MOD 1000000007 #define PI 3.1415926536 #define RMAX 4294967295 typedef long long ll; typedef pair<int, int> Pi; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<bool> vb; typedef vector<char> vc; typedef vector<string> vs; typedef vector<double> vd; typedef vector<Pi> vPi; typedef vector<vector<int> > vvi; typedef vector<vector<bool> > vvb; typedef vector<vector<ll> > vvll; typedef vector<vector<char> > vvc; typedef vector<vector<string> > vvs; typedef vector<vector<double> > vvd; typedef vector<vector<Pi> > vvPi; typedef priority_queue<int, vector<int>, greater<int> > pqli; typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll; typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP; struct Edge { int from, to, cost; bool operator<(Edge e) { return cost < e.cost; } }; typedef vector<Edge> Edges; typedef vector<Edges> Graph; template <class T> using vec = vector<T>; template<class T> using pql = priority_queue<T, vector<T>, greater<T>>; string debug_show(Pi a) { return "(" + to_string(a.first) + "," + to_string(a.second) + ")"; } template<class T> struct augEdge { T from, to; int cost; bool operator<(augEdge e) { return cost < e.cost; } bool operator>(augEdge e) { return cost > e.cost; } }; template<class T> using augGraph = vector<augEdge<T>>; int main() { cin.tie(0); ios::sync_with_stdio(false); string s, t; cin >> s >> t; if (s.size() == t.size()) { rep(i, s.size()) { cout << s[i]; cout << t[i]; } cout << endl; } else { cout << s[0]; rep(i, s.size() - 1) cout << t[i]; cout << s[i + 1]; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:98:35: error: 'i' was not declared in this scope 98 | cout << s[i + 1]; | ^ a.cc: At global scope: a.cc:103:9: error: expected unqualified-id before 'return' 103 | return 0; | ^~~~~~ a.cc:104:1: error: expected declaration before '}' token 104 | } | ^
s718871954
p03760
C++
#include<string> #include<vector> #include<math.h> #include<map> using namespace std; int main(void){ string a,b; cin>>a>>b; if(a.size()>b.size()) cout<<"GREATER"<<endl; else if(a.size()<b.size()) cout<<"LESS"<<endl; else if(a>b) cout<<"GREATER"<<endl; else if(a<b) cout<<"LESS"<<endl; else if(a==b) cout<<"EQURL"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin>>a>>b; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include<map> +++ |+#include <iostream> 5 | using namespace std; a.cc:9:27: error: 'cout' was not declared in this scope 9 | if(a.size()>b.size()) cout<<"GREATER"<<endl; | ^~~~ a.cc:9:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:9:44: error: 'endl' was not declared in this scope 9 | if(a.size()>b.size()) cout<<"GREATER"<<endl; | ^~~~ a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 4 | #include<map> +++ |+#include <ostream> 5 | using namespace std; a.cc:10:32: error: 'cout' was not declared in this scope 10 | else if(a.size()<b.size()) cout<<"LESS"<<endl; | ^~~~ a.cc:10:32: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:10:46: error: 'endl' was not declared in this scope 10 | else if(a.size()<b.size()) cout<<"LESS"<<endl; | ^~~~ a.cc:10:46: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:11:18: error: 'cout' was not declared in this scope 11 | else if(a>b) cout<<"GREATER"<<endl; | ^~~~ a.cc:11:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:11:35: error: 'endl' was not declared in this scope 11 | else if(a>b) cout<<"GREATER"<<endl; | ^~~~ a.cc:11:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:12:18: error: 'cout' was not declared in this scope 12 | else if(a<b) cout<<"LESS"<<endl; | ^~~~ a.cc:12:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:32: error: 'endl' was not declared in this scope 12 | else if(a<b) cout<<"LESS"<<endl; | ^~~~ a.cc:12:32: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:13:19: error: 'cout' was not declared in this scope 13 | else if(a==b) cout<<"EQURL"<<endl; | ^~~~ a.cc:13:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:13:34: error: 'endl' was not declared in this scope 13 | else if(a==b) cout<<"EQURL"<<endl; | ^~~~ a.cc:13:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s566577840
p03760
C++
#include <iostream> #include <string> using namespace std; string a,b; int main() { cin >> a >> b; string c(a.size() + b.size()); for(int i = 0; i < a.size(); ++i) { c[i * 2] = a[i]; } for(int i = 0; i < b.size(); ++i) { c[i * 2 + 1] = b[i]; } cout << c << endl; }
a.cc: In function 'int main()': a.cc:8:31: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(std::__cxx11::basic_string<char>::size_type)' 8 | string c(a.size() + b.size()); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = long unsigned int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:8:21: note: cannot convert '(a.std::__cxx11::basic_string<char>::size() + b.std::__cxx11::basic_string<char>::size())' (type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}) to type 'const char*' 8 | string c(a.size() + b.size()); | ~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(c
s423338191
p03760
C
#include<stdio.h> #include<string.h> int main() { char o[50]= {'\0'},f[50]= {'\0'}; int i,a=0,b=0,u,p; while(~scanf("%s%s",o,f)) { getchar(); u=strlen(o); p=strlen(f); if(u==p||u-p==1) { for(i=0; i<50; i++) { printf("%c%c",o[i],f[i]); } printf("\n"); } for(i=0; i<50; i++) { o[i]='\0'; f[i]='\0'; }a } }
main.c: In function 'main': main.c:24:15: error: expected ';' before '}' token 24 | }a | ^ | ; 25 | } | ~
s218919423
p03760
C
#include<stdio.h> #include<string.h> int main() { int i; char c; char str1[20],str2[20],str3[40]; gets(str1); gets(str2); for(i=0;(c=str1[i]!='\0');i++) { strcpy(str3[2*i],str1[i]); strcpy(str3[2*i+1],str2[i]); } str3[2i]='\0'; for(i=0;(c=str3[i])!='\0';i++) printf("%s",str3[i]); return 0; }
main.c: In function 'main': main.c:8:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | gets(str1); | ^~~~ | fgets main.c:12:28: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 12 | strcpy(str3[2*i],str1[i]); | ~~~~^~~~~ | | | char In file included from main.c:2: /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:12:38: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 12 | strcpy(str3[2*i],str1[i]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:13:28: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 13 | strcpy(str3[2*i+1],str2[i]); | ~~~~^~~~~~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:13:40: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 13 | strcpy(str3[2*i+1],str2[i]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:15:12: error: array subscript is not an integer 15 | str3[2i]='\0'; | ^
s194396673
p03760
C
#include<stdio.h> #include<string.h> int main() { int i; char c; char str1[20],str2[20],str3[40]; gets(str1); gets(str2); for(i=0;(c=str1[i]!='\0');i++) { strcpy(str3[2*i],str1[i]); strcpy(str3[2*i+1],str2[i]); } str3[2i]='\0'; for(i=0;(c=str3[i])!='\0';i++) printf("%s",str3[i]); return 0; }
main.c: In function 'main': main.c:8:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | gets(str1); | ^~~~ | fgets main.c:12:28: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 12 | strcpy(str3[2*i],str1[i]); | ~~~~^~~~~ | | | char In file included from main.c:2: /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:12:38: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 12 | strcpy(str3[2*i],str1[i]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:13:28: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 13 | strcpy(str3[2*i+1],str2[i]); | ~~~~^~~~~~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:13:40: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 13 | strcpy(str3[2*i+1],str2[i]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:15:12: error: array subscript is not an integer 15 | str3[2i]='\0'; | ^
s851650100
p03760
C
#include<stdio.h> #include<string.h> int main() { char o[50]= {'\0'},f[50]= {'\0'}; int i,a=0,b=0,u,i; while(~scanf("%s%s",o,f)) { getchar(); u=strlen(o);i=strlen(f); if(u==i||u-i==1) { for(i=0; i<50; i++) { printf("%c",o[i]); printf("%c",f[i]); if(o[i]=='\0'||f[i]=='\0') { printf("\n"); break; } } for(i=0; i<50; i++) { o[i]='\0'; f[i]='\0'; } } } }
main.c: In function 'main': main.c:6:21: error: redeclaration of 'i' with no linkage 6 | int i,a=0,b=0,u,i; | ^ main.c:6:9: note: previous declaration of 'i' with type 'int' 6 | int i,a=0,b=0,u,i; | ^
s391991639
p03760
C++
#include<stdio.h> int main() { char O[510], E[500], a[1010], c; int i, j; scanf("%s%s", O, E); j = 0; int lo=strlen(O); int le=strlen(E); for(i = 0; i<lo; i++) { a[j] = O[i]; j += 2; } j = 1; for(i = 0; i<le; i++) { a[j] = E[i]; j += 2; } a[j] = '\0'; printf("%s", a); }
a.cc: In function 'int main()': a.cc:8:12: error: 'strlen' was not declared in this scope 8 | int lo=strlen(O); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<stdio.h> +++ |+#include <cstring> 2 | int main()
s087957921
p03760
C
#include<stdio.h> #include<string.h> int main() { int i,x,y,len,len1,len2; char a[51],b[51]; while(scanf("%s",a)!=EOF) { x=0;y=0; getchar() scanf("%s",b); getchar() len1=strlen(a); len2=strlen(b); len=len1+len2; for(i=0;i<len2;i++) { if(i%2==0) printf("%c",a[x++]); else printf("%c",b[y++]); } printf("\n"); memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); } return 0; }
main.c: In function 'main': main.c:10:26: error: expected ';' before 'scanf' 10 | getchar() | ^ | ; 11 | scanf("%s",b); | ~~~~~ main.c:12:26: error: expected ';' before 'len1' 12 | getchar() | ^ | ; 13 | len1=strlen(a); | ~~~~
s548223088
p03760
C
#include<stdio.h> #include<string.h> int main() { int i,x,y,len,len1,len2; char a[51],b[51]; while(scanf("%s",a)!=EOF) { x=0;y=0; getchar() scanf("%s",f); getchar() len1=strlen(a); len2=strlen(b); len=len1+len2; for(i=0;i<len;i++) { if(i%2==0) printf("%c",a[x++]); else printf("%c",b[y++]); } printf("\n"); memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); } return 0; }
main.c: In function 'main': main.c:10:26: error: expected ';' before 'scanf' 10 | getchar() | ^ | ; 11 | scanf("%s",f); | ~~~~~ main.c:12:26: error: expected ';' before 'len1' 12 | getchar() | ^ | ; 13 | len1=strlen(a); | ~~~~
s285334924
p03760
C
#include<stdio.h> int main() { char O[50],E[50]; scanf("%s%s",&O,&E); strlen(O)-strlen(E)=1||0; int i; for(i=0;i<50;i++) printf("%c%c",O[i],E[i]); }
main.c: In function 'main': main.c:6:5: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 6 | strlen(O)-strlen(E)=1||0; | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen' 1 | #include<stdio.h> +++ |+#include <string.h> 2 | int main() main.c:6:5: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch] 6 | strlen(O)-strlen(E)=1||0; | ^~~~~~ main.c:6:5: note: include '<string.h>' or provide a declaration of 'strlen' main.c:6:24: error: lvalue required as left operand of assignment 6 | strlen(O)-strlen(E)=1||0; | ^
s067054952
p03760
C
#include <stdio.h> int main() { char o[100]= {'\0'},f[100]= {'\0'}; int i,a=0,b=0; while(1) { scanf("%s",o); getchar(); scanf("%s",f); getchar(); for(i=0; i<100000; i++) { printf("%c",o[i]); printf("%c",f[i]); if(o[i]=='\0'||f[i]=='\0') { printf("\n"); break; } } } }
main.c:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include | ^ main.c:2:1: error: expected identifier or '(' before '<' token 2 | <stdio.h> | ^
s685027304
p03760
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <numeric> using namespace std; const double PI = acos(-1.0); const string alp = "abcdefghijklmnopqrstuvwxyz"; const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main(){ string o,e; REP(i,o.length()){ cout >> o[i] >> e[i]; } if(o.length()!=e.length())cout<<e.back(); cout >> endl; return 0; }
a.cc: In function 'int main()': a.cc:17:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 17 | cout >> o[i] >> e[i]; a.cc:17:10: note: candidate: 'operator>>(int, int)' (built-in) a.cc:17:10: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:17:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 17 | cout >> o[i] >> e[i]; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:17:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = char&]': a.cc:17:16: required from here 17 | cout >> o[i] >> e[i]; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:20:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 20 | cout >> endl; | ~~~~~^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:20:11: note: couldn't deduce template parameter '_IntegerType' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout >> endl; | ^~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:20:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 2
s600088455
p03760
C++
#include<iostream> #include<string> #include<cstdio> #include<cstdlib> #include<algorithm> #include<cmath> using namespace std; int main(){ string s,t; cin>>s>>t; for(int i=0;i<s.size();i++){ cout<<s[i]; if(i==s.size-1 && s.size()>t.size())cout<<t[i]<<endl; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 13 | if(i==s.size-1 && s.size()>t.size())cout<<t[i]<<endl; | ~~^~~~ | ()
s459296438
p03760
C++
#include <iostream> using namespace std; int main(){ string a,b,c; cin>>a>>b; for(int i=0;i<b.size();i++){ c+=a[i]; c+=b[i]; } } if(a.size()>b.size()){ c+=a[a.size()-1]; } cout<<c<<endl; return 0; }
a.cc:11:9: error: expected unqualified-id before 'if' 11 | if(a.size()>b.size()){ | ^~ a.cc:14:9: error: 'cout' does not name a type 14 | cout<<c<<endl; | ^~~~ a.cc:15:9: error: expected unqualified-id before 'return' 15 | return 0; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s210428505
p03760
C++
#include <iostream> using namespace std; int main(){ string a,b,c; cin>>a>>b; for(int i=0;i<b.size();i++){ c+=a[i]; c+=b[i]; } } if(a.size()>b.size()){ c+=a[i+1]; } cout<<c<<endl; return 0; }
a.cc:11:9: error: expected unqualified-id before 'if' 11 | if(a.size()>b.size()){ | ^~ a.cc:14:9: error: 'cout' does not name a type 14 | cout<<c<<endl; | ^~~~ a.cc:15:9: error: expected unqualified-id before 'return' 15 | return 0; | ^~~~~~ a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s833611012
p03760
C++
#include <bits/stdc++.h> using namespace std; int main(){ string O,E,M; cin >> O >> E; for(int i=0;i<O.size();i++) { M[i]=O[i]; } for(int i=1;i<E.size();i+2) M[i]=E[i]; } cout << M << endl; return 0; }
a.cc:16:2: error: 'cout' does not name a type 16 | cout << M << endl; | ^~~~ a.cc:18:3: error: expected unqualified-id before 'return' 18 | return 0; | ^~~~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s871057400
p03760
C++
#include <bits/stdc++.h> using namespace std; int main(){ string O,E,M; cin >> O >> E; for(int i=0;i<O.size(),i++) { M[i]=O[i]; } for(int i=1;i<E.size(),i+2) M[i]=E[i]; } cout << M << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:28: error: expected ';' before ')' token 8 | for(int i=0;i<O.size(),i++) | ^ | ; a.cc:12:28: error: expected ';' before ')' token 12 | for(int i=1;i<E.size(),i+2) | ^ | ; a.cc: At global scope: a.cc:16:2: error: 'cout' does not name a type 16 | cout << M << endl; | ^~~~ a.cc:18:3: error: expected unqualified-id before 'return' 18 | return 0; | ^~~~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s288752839
p03760
C++
> xyz > abc#include <iostream> #include <stdio.h> #include <string> #include <cstdlib> #include <cmath> #include <math.h> #include <vector> #include <algorithm> using namespace std; int main(){ string o, e; cin >> o; cin >> e; for(int i=0; i<o.length()-1; i++){ cout << o.at(i) << e.at(i); } if(e.length() == o.length()) cout << o.at(o.length()) << e.at(o.length()) << endl; else cout << o.at(o.length()) << endl; return 0; }
a.cc:2:6: error: stray '#' in program 2 | > abc#include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before '>' token 1 | > xyz | ^ In file included from /usr/include/wchar.h:53, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40, from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:4: /usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h:6:9: error: '__mbstate_t' does not name a type 6 | typedef __mbstate_t mbstate_t; | ^~~~~~~~~~~ /usr/include/wchar.h:104:59: error: 'size_t' has not been declared 104 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:109:8: error: 'size_t' does not name a type 109 | extern size_t wcslcpy (wchar_t *__restrict __dest, | ^~~~~~ /usr/include/wchar.h:61:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 60 | # include <bits/types/locale_t.h> +++ |+#include <cstddef> 61 | #endif /usr/include/wchar.h:115:8: error: 'size_t' does not name a type 115 | extern size_t wcslcat (wchar_t *__restrict __dest, | ^~~~~~ /usr/include/wchar.h:115:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:126:59: error: 'size_t' has not been declared 126 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:133:63: error: 'size_t' has not been declared 133 | extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:142:25: error: 'size_t' has not been declared 142 | size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:150:27: error: 'size_t' has not been declared 150 | size_t __n, locale_t __loc) __THROW; | ^~~~~~ /usr/include/wchar.h:159:8: error: 'size_t' does not name a type 159 | extern size_t wcsxfrm (wchar_t *__restrict __s1, | ^~~~~~ /usr/include/wchar.h:159:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:174:8: error: 'size_t' does not name a type 174 | extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, | ^~~~~~ /usr/include/wchar.h:174:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:212:8: error: 'size_t' does not name a type 212 | extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) | ^~~~~~ /usr/include/wchar.h:212:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:216:8: error: 'size_t' does not name a type 216 | extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) | ^~~~~~ /usr/include/wchar.h:216:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:247:8: error: 'size_t' does not name a type 247 | extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; | ^~~~~~ /usr/include/wchar.h:247:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:265:8: error: 'size_t' does not name a type 265 | extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) | ^~~~~~ /usr/include/wchar.h:265:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:272:59: error: 'size_t' has not been declared 272 | extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) | ^~~~~~ /usr/include/wchar.h:275:38: error: 'size_t' has not been declared 275 | size_t __n) | ^~~~~~ /usr/include/wchar.h:283:63: error: 'size_t' has not been declared 283 | extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:288:58: error: 'size_t' has not been declared 288 | const wchar_t *__restrict __s2, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:292:63: error: 'size_t' has not been declared 292 | extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:296:53: error: 'size_t' has not been declared 296 | extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:302:59: error: 'size_t' has not been declared 302 | const wchar_t *__restrict __s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:317:27: error: 'mbstate_t' does not name a type 317 | extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; | ^~~~~~~~~ /usr/include/wchar.h:321:8: error: 'size_t' does not name a type 321 | extern size_t mbrtowc (wchar_t *__restrict __pwc, | ^~~~~~ /usr/include/wchar.h:321:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:326:8: error: 'size_t' does not name a type 326 | extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, | ^~~~~~ /usr/include/wchar.h:326:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:330:8: error: 'size_t' does not name a type 330 | extern size_t __mbrlen (const char *__restrict __s, size_t __n, | ^~~~~~ /usr/include/wchar.h:330:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:332:8: error: 'size_t' does not name a type 332 | extern size_t mbrlen (const char *__restrict __s, size_t __n, | ^~~~~~ /usr/include/wchar.h:332:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:362:8: error: 'size_t' does not name a type 362 | extern size_t mbsrtowcs (wchar_t *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:362:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:368:8: error: 'size_t' does not name a type 368 | extern size_t wcsrtombs (char *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:368:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:376:8: error: 'size_t' does not name a type 376 | extern size_t mbsnrtowcs (wchar_t *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:376:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:382:8: error: 'size_t' does not name a type 382 | extern size_t wcsnrtombs (char *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:382:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:396:42: error: 'size_t' has not been declared 396 | extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:695:59: error: 'size_t' has not been declared 695 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:718:8: error: '__FILE' does not name a type; did you mean 'ENFILE'? 718 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ | ENFILE /usr/include/wchar.h:725:19: error: '__FILE' was not declared in this scope; did you mean 'ENFILE'? 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~~~~ | ENFILE /usr/include/wchar.h:725:27: error: '__fp' was not declared in this scope 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~~ /usr/include/wchar.h:725:33: error: expected primary-expression before 'int' 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~ /usr/include/wchar.h:725:43: error: expression list treated as compound expression in initializer [-fpermissive] 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^ /usr/include/wchar.h:732:22: error: '__FILE' was not declared in this scope; did you mean 'ENFILE'? 732 | extern int fwprintf (__FILE *__restrict __stream, | ^~~~~~ | ENFILE /usr/include/wchar.h:732:30: error: expected primary-expression before '__restrict' 732 | extern int fwprintf (__FILE *__restrict __stream, | ^~~~~~~~~~ /usr/include/wchar.h:733:22: error: expected primary-expression before 'const' 733 | const wchar_t *__restrict __format, ...) | ^~~~~ /usr/include/wchar.h:733:58: error: expected primary-expression before '...' token 733 | const wchar_t *__restrict __format, ...) |
s930901006
p03760
C++
#include <iostream> #include <vector> #include <queue> #include <sstream> #include <algorithm> #include <bitset> #include <limits> #include <map> #include <set> #include <iomanip> #include <cmath> using namespace std; typedef long long int ll; typedef std::numeric_limits<double> dbl; const long long int LL_INF=1LL<<60; vector<string> split(const string& input, char delimiter) { stringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } //#define DEBUG ll A, B, M, N, D, K, Q, W, H, T, X, Y; int main() { string s1, s2; cin >> s1 >> s2; int i1 = 0; i2 = 0; for (int i = 0; i < s1.size(); ++i) { if (i % 2 == 0) { cout << s1[i1]; i1++; } else { cout << s2[i2]; i2++; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:17: error: 'i2' was not declared in this scope; did you mean 'i1'? 38 | int i1 = 0; i2 = 0; | ^~ | i1
s101570866
p03760
C++
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; namespace AtCoder { class MainClass { int a, b, c; void Solve() { a = io.nextInt(); b = io.nextInt(); c = io.nextInt(); bool isBeauty = (b - a) == (c - b); io.o(isBeauty ? "YES" : "NO"); } int ManhattanDis(int x1, int y1, int x2, int y2) { return Math.Abs(x1 - x2) + Math.Abs(y1 - y2); } public static void Main(string[] args) { new MainClass().Stream(); } IO io = new IO(); void Stream() { Solve(); io.writeFlush(); } class IO { string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; public IO() { nextBuffer = new string[0]; BufferCnt = 0; Console.SetOut(sw); } public string next() { if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); BufferCnt = 0; return nextBuffer[BufferCnt++]; } public char nextChar() { return char.Parse(next()); } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } public string[] array() { return Console.ReadLine().Split(' '); } public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } private T convertType<T, U>() { return (T)Convert.ChangeType(typeof(U), typeof(T)); } public void i<T>(out T v) {//微妙かも if (typeEQ<T, int>()) { v = (T)Convert.ChangeType(nextInt(), typeof(T)); return; } if (typeEQ<T, long>()) { v = (T)Convert.ChangeType(nextLong(), typeof(T)); return; } if (typeEQ<T, double>()) { v = (T)Convert.ChangeType(nextDouble(), typeof(T)); return; } if (typeEQ<T, char>()) { v = (T)Convert.ChangeType(nextChar(), typeof(T)); return; } v = (T)Convert.ChangeType(next(), typeof(T)); return;//string } public void o<T>(T v) { Console.WriteLine(v); } public void o<T>(T[] a) { foreach (T v in a) Console.WriteLine(v); } public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } public void writeFlush() { Console.Out.Flush(); } } class Mathf { public int mod = 1000000007;//10^9+7 public long Pow(long a, long b) { if (b == 0) return 1; if (b % 2 == 1) return (a % mod * Pow(a % mod, b - 1) % mod) % mod; else return Pow(a * a % mod, b / 2) % mod; } public long Fact(long n) { return n != 0 ? (n % mod * (Fact(n - 1) % mod) % mod) : 1; } public long C(long n, long r) { if (r == 0 || n == r) return 1; else return (Fact(n) % mod * Pow((Fact(n - r) % mod * Fact(r) % mod) % mod, mod - 2) % mod) % mod; } public int GCD(int a, int b) { if (a < b) Swap(ref a, ref b); return b == 0 ? a : GCD(b, a % b); } public int GCD(int[] array) { return array.Aggregate((v, next) => GCD(v, next)); } public void Swap<T>(ref T a, ref T b) { T tmp = a; a = b; b = tmp; } public T Max<T>(params T[] v) { return v.Max(); } public T Min<T>(params T[] v) { return v.Min(); } } } }
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.Collections; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Collections.Generic; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Diagnostics; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.IO; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'System' 6 | using System.Linq; | ^~~~~~ a.cc:7:7: error: expected nested-name-specifier before 'System' 7 | using System.Text; | ^~~~~~ a.cc:27:15: error: expected ':' before 'static' 27 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~~~~ | : a.cc:27:33: error: 'string' has not been declared 27 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~~~ a.cc:27:42: error: expected ',' or '...' before 'args' 27 | public static void Main(string[] args) { new MainClass().Stream(); } | ^~~~ a.cc:28:9: error: 'IO' does not name a type 28 | IO io = new IO(); | ^~ a.cc:32:13: error: 'string' does not name a type 32 | string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; | ^~~~~~ a.cc:32:53: error: expected unqualified-id before '[' token 32 | string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; | ^ a.cc:33:13: error: 'StreamWriter' does not name a type 33 | StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; | ^~~~~~~~~~~~ a.cc:34:19: error: expected ':' before 'IO' 34 | public IO() { nextBuffer = new string[0]; BufferCnt = 0; Console.SetOut(sw); } | ^~~ | : a.cc:35:19: error: expected ':' before 'string' 35 | public string next() { | ^~~~~~~ | : a.cc:35:20: error: 'string' does not name a type 35 | public string next() { | ^~~~~~ a.cc:43:19: error: expected ':' before 'char' 43 | public char nextChar() { return char.Parse(next()); } | ^~~~~ | : a.cc:44:19: error: expected ':' before 'int' 44 | public int nextInt() { return int.Parse(next()); } | ^~~~ | : a.cc:45:19: error: expected ':' before 'long' 45 | public long nextLong() { return long.Parse(next()); } | ^~~~~ | : a.cc:46:19: error: expected ':' before 'double' 46 | public double nextDouble() { return double.Parse(next()); } | ^~~~~~~ | : a.cc:47:19: error: expected ':' before 'string' 47 | public string[] array() { return Console.ReadLine().Split(' '); } | ^~~~~~~ | : a.cc:47:20: error: 'string' does not name a type 47 | public string[] array() { return Console.ReadLine().Split(' '); } | ^~~~~~ a.cc:48:19: error: expected ':' before 'char' 48 | public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } | ^~~~~ | : a.cc:48:24: error: expected unqualified-id before '[' token 48 | public char[] arrayChar() { return Array.ConvertAll(array(), char.Parse); } | ^ a.cc:49:19: error: expected ':' before 'int' 49 | public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } | ^~~~ | : a.cc:49:23: error: expected unqualified-id before '[' token 49 | public int[] arrayInt() { return Array.ConvertAll(array(), int.Parse); } | ^ a.cc:50:19: error: expected ':' before 'long' 50 | public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } | ^~~~~ | : a.cc:50:24: error: expected unqualified-id before '[' token 50 | public long[] arrayLong() { return Array.ConvertAll(array(), long.Parse); } | ^ a.cc:51:19: error: expected ':' before 'double' 51 | public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } | ^~~~~~~ | : a.cc:51:26: error: expected unqualified-id before '[' token 51 | public double[] arrayDouble() { return Array.ConvertAll(array(), double.Parse); } | ^ a.cc:52:20: error: expected ':' before 'bool' 52 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^~~~~ | : a.cc:52:26: error: expected ';' at end of member declaration 52 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^~~~~~ | ; a.cc:52:32: error: expected unqualified-id before '<' token 52 | private bool typeEQ<T, U>() { return typeof(T).Equals(typeof(U)); } | ^ a.cc:53:20: error: expected ':' before 'T' 53 | private T convertType<T, U>() { return (T)Convert.ChangeType(typeof(U), typeof(T)); } | ^~ | : a.cc:53:21: error: 'T' does not name a type 53 | private T convertType<T, U>() { return (T)Convert.ChangeType(typeof(U), typeof(T)); } | ^ a.cc:54:19: error: expected ':' before 'void' 54 | public void i<T>(out T v) {//微妙かも | ^~~~~ | : a.cc:54:25: error: variable or field 'i' declared void 54 | public void i<T>(out T v) {//微妙かも | ^ a.cc:54:25: error: expected ';' at end of member declaration 54 | public void i<T>(out T v) {//微妙かも | ^ | ; a.cc:54:26: error: expected unqualified-id before '<' token 54 | public void i<T>(out T v) {//微妙かも | ^ a.cc:61:19: error: expected ':' before 'void' 61 | public void o<T>(T v) { Console.WriteLine(v); } | ^~~~~ | : a.cc:61:25: error: variable or field 'o' declared void 61 | public void o<T>(T v) { Console.WriteLine(v); } | ^ a.cc:61:25: error: expected ';' at end of member declaration 61 | public void o<T>(T v) { Console.WriteLine(v); } | ^ | ; a.cc:61:26: error: expected unqualified-id before '<' token 61 | public void o<T>(T v) { Console.WriteLine(v); } | ^ a.cc:62:19: error: expected ':' before 'void' 62 | public void o<T>(T[] a) { foreach (T v in a) Console.WriteLine(v); } | ^~~~~ | : a.cc:62:25: error: variable or field 'o' declared void 62 | public void o<T>(T[] a) { foreach (T v in a) Console.WriteLine(v); } | ^ a.cc:62:25: error: expected ';' at end of member declaration 62 | public void o<T>(T[] a) { foreach (T v in a) Console.WriteLine(v); } | ^ | ; a.cc:62:26: error: expected unqualified-id before '<' token 62 | public void o<T>(T[] a) { foreach (T v in a) Console.WriteLine(v); } | ^ a.cc:63:19: error: expected ':' before 'void' 63 | public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } | ^~~~~ | : a.cc:63:25: error: variable or field 'o' declared void 63 | public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } | ^ a.cc:63:25: error: expected ';' at end of member declaration 63 | public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } | ^ | ; a.cc:63:26: error: expected unqualified-id before '<' token 63 | public void o<T>(List<T> l) { foreach (T v in l) sw.WriteLine(v); } | ^ a.cc:64:19: error: expected ':' before 'void' 64 | public void writeFlush() { Console.Out.Flush(); } | ^~~~~ | : a.cc:65:10: error: expected ';' after class definition 65 | } | ^ | ; a.cc:68:19: error: expected ':' before 'int' 68 | public int mod = 1000000007;//10^9+7 | ^~~~ | : a.cc:69:19: error: expected ':' before 'long' 69 | public long Pow(long a, long b) { | ^~~~~ | : a.cc:74:19: error: expected ':' before 'long' 74 | public long Fact(long n) { return n != 0 ? (n % mod * (Fact(n - 1) % mod) % mod) : 1; } | ^~~~~ | : a.cc:75:19: error: expected ':' before 'long' 75 | public long C(long n, long r) { | ^~~~~ | : a.cc:79:19: error: expected ':' before 'int' 79 | public int GCD(int a, int b) { if (a < b) Swap(ref a, ref b); return b == 0 ? a : GCD(b, a % b); } |
s058891715
p03760
C
#include<stdio.h> #include<string.h> int main(void){ char O[51], E[51], A[102]; int i; scanf("%s", O); scanf("%s", E); j = strlen(O); for(i = 0; i < j; i++){ A[i * 2] = O[i]; A[i * 2 + 1] = E[i]; } printf("%s\n", A); return 0; }
main.c: In function 'main': main.c:10:3: error: 'j' undeclared (first use in this function) 10 | j = strlen(O); | ^ main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
s185237701
p03760
Java
import java.util.Scanner; public class { public static void main (String[] args){ Scanner scan = new Scanner(System.in); String kisupas = scan.nextLine(); String gusupas = scan.nextLine(); String[] kisu = kisupas.split("", 0); String[] gusu = gusupas.split("", 0); for(int i=0; i<kisu.length; i++){ System.out.print(kisu[i]); if(i != gusu.length) System.out.print(gusu[i]); } } }
Main.java:3: error: <identifier> expected public class { ^ 1 error
s931220563
p03760
Java
import java.util.Scanner; public class d{ public static void main (String[] args){ Scanner scan = new Scanner(System.in); String kisupas = scan.nextLine(); String gusupas = scan.nextLine(); String[] kisu = kisupas.split("", 0); String[] gusu = gusupas.split("", 0); for(int i=0; i<kisu.length; i++){ System.out.print(kisu[i]); if(i != gusu.length) System.out.print(gusu[i]); } } }
Main.java:3: error: class d is public, should be declared in a file named d.java public class d{ ^ 1 error
s742057434
p03760
Java
import java.util.Scanner; public class d{ public static void main (String[] args){ Scanner scan = new Scanner(System.in); String kisupas = scan.nextLine(); String gusupas = scan.nextLine(); String[] kisu = kisupas.split("", 0); String[] gusu = gusupas.split("", 0); for(int i=0; i<kisu.length; i++){ System.out.print(kisu[i]); if(i != gusu.length) System.out.print(gusu[i]); } } }
Main.java:3: error: class d is public, should be declared in a file named d.java public class d{ ^ 1 error
s454307234
p03760
Java
import java.util.Scanner; public class d{ public static void main (String[] args){ Scanner scan = new Scanner(System.in); String kisupas = scan.nextLine(); String gusupas = scan.nextLine(); String[] kisu = kisupas.split("", 0); String[] gusu = gusupas.split("", 0); for(int i=0; i<kisu.length; i++){ System.out.print(kisu[i]); if(i != gusu.length) System.out.print(gusu[i]); } } }
Main.java:3: error: class d is public, should be declared in a file named d.java public class d{ ^ 1 error
s453371465
p03760
C++
#include<iostream> #include<string> using namespace std; int main(){ string a,b,c; cin>>a>>b; if(a.size()==b.size()){ for(int i=0;i<a.size();i++){ c=c+a[i]; c=c+b[i]; } } if(a.size()!=b.size()){ for(int i=0;i<b.size();i++){ c=c+a[i]; c=c+b[i]; } c=c+a[a.size-1]; } cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:18:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 18 | c=c+a[a.size-1]; | ~~^~~~ | ()
s248558724
p03760
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; int main(){ string a,b; cin>>a>>b; for(int i=0;i<a.size();i++){ cout<<a[i]; cout<<b[i]: } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:27: error: expected ';' before ':' token 10 | cout<<b[i]: | ^ | ;
s601022922
p03760
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; int main(){ string a,b; cin>>a>>b; for(int i=0;i<a;i++){ cout<<a[i]; cout<<b[i]: } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 8 | for(int i=0;i<a;i++){ | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | int In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:8:23: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3901 | operator<(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const _CharT*' and 'int' 8 | for(int i=0;i<a;i++){ | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2600 | operator<(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed: a.cc:8:23: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 8 | for(int i=0;i<a;i++){ | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'int' to 'const std::error_code&' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)' 507 | operator<(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'int' to 'const std::error_condition&' 507 | operator<(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ a.cc:10:27: error: expected ';' before ':' token 10 | cout<<b[i]: | ^ | ;
s750665450
p03760
C++
#include <iostream> using namespace std; int main(){ string a, b; cin >> a >> b; queue<char> q1, q2; for(char c : a) q1.push(c); for(char c : b) q2.push(c); string ans; for(int i = 0; ; i++){ if(q1.size() == 0 && q2.size() == 0) break; if(i % 2 == 0) ans += q1.front(), q1.pop(); else ans += q2.front(), q2.pop(); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:5: error: 'queue' was not declared in this scope 7 | queue<char> q1, q2; | ^~~~~ a.cc:2:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 1 | #include <iostream> +++ |+#include <queue> 2 | using namespace std; a.cc:7:11: error: expected primary-expression before 'char' 7 | queue<char> q1, q2; | ^~~~ a.cc:8:21: error: 'q1' was not declared in this scope 8 | for(char c : a) q1.push(c); | ^~ a.cc:9:21: error: 'q2' was not declared in this scope 9 | for(char c : b) q2.push(c); | ^~ a.cc:12:12: error: 'q1' was not declared in this scope 12 | if(q1.size() == 0 && q2.size() == 0) break; | ^~ a.cc:12:30: error: 'q2' was not declared in this scope 12 | if(q1.size() == 0 && q2.size() == 0) break; | ^~ a.cc:13:31: error: 'q1' was not declared in this scope 13 | if(i % 2 == 0) ans += q1.front(), q1.pop(); | ^~ a.cc:14:21: error: 'q2' was not declared in this scope 14 | else ans += q2.front(), q2.pop(); | ^~
s008466363
p03760
C++
# -*- coding: utf-8 -*- import sys import subprocess import json import time import math import re import sqlite3 O = input() E = input() res = "" for i in range(len(O)): res += O[i] if i < len(E): res += E[i] print(res)
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:3:1: error: 'import' does not name a type 3 | import sys | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
s607013523
p03760
C++
#include<bits/stdc++.h> #include<string> #include<cctype> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ string O,E; int i; cin >> O >> E; if(O.size()==E.size()){ rep(i,O.size()){ cout << O[i] << E[i]; } }ekse{ rep(i,E.size()){ cout << O[i] << E[i]; } cout << O[O.size()-1]; } cout << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:15:4: error: 'ekse' was not declared in this scope 15 | }ekse{ | ^~~~