submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s117019491
p00110
C++
/* AOJ_0110: Alphametic */ #include <iostream> #include <string> #include <cstdlib> #include <vector> using namespace std; int Alp_calc(string); string convert_Xtoi(string, int); string calc_AddofNumString(string, string); int main(void) { string str; int result; while (1) { cin >> str; if (cin.eof()) { bre...
a.cc: In function 'std::string calc_AddofNumString(std::string, std::string)': a.cc:76:9: error: 'reverse' was not declared in this scope 76 | reverse(str1.begin(), str1.end()); | ^~~~~~~
s878325299
p00110
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(a) (a).begin(),(a).end() #define pb push_back #define INF 99999999 int c; bool ng(string a[100]){ rep(i,c){ if(a[i]=='0'&&a[i].size()!=1)return true; } return false; } int mai...
a.cc: In function 'bool ng(std::string*)': a.cc:11:16: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 11 | if(a[i]=='0'&&a[i].size()!=1)return true; | ~~~~^~~~~ | | | | | char ...
s694137841
p00110
C++
#include <iostream> #include <string> using namespace std; int check(int,int); int main(){ string s; string a,b,c; int an,bn,cn; int A,B,C; int i,tmp; int X; while(1){ cin<<s;s+='e'; a=b=c="";an=bn=cn=0; i=0;while(s[i]=='+'){ a+=s[i];an++; i++; } i++;while(s[i]=='='){ b+=s[i];bn++; i++;...
a.cc: In function 'int main()': a.cc:16:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 16 | cin<<s;s+='e'; | ~~~^~~ | | | | | std::string {a...
s471667718
p00110
C++
#include <iostream> #include <string> using namespace std; int check(int,int); int main(){ string s; string a,b,c; int an,bn,cn; int A,B,C; int i,tmp; int X; while(1){ cin>>s;s+='e'; a=b=c="";an=bn=cn=0; i=0;while(s[i]=='+'){ a+=s[i];an++; i++; } i++;while(s[i]=='='){ b+=s[i];bn++; i++;...
a.cc: In function 'int main()': a.cc:32:23: error: 'x' was not declared in this scope 32 | for(X=0;X<10;x++;){ | ^ a.cc:32:26: error: expected ')' before ';' token 32 | for(X=0;X<10;x++;){ | ~ ^ | ) a.cc:32:2...
s626161539
p00110
C++
#include <iostream> #include <string> using namespace std; int check(int,int); int isNum(int c){ if(48<=c && c<=57){ return c-48; } return -1; } int main(){ string s; string a,b,c; int an,bn,cn; int A,B,C; int i,tmp; int X; while(1){ cin>>s;s+='e'; a=b=c="";an=bn=cn=0; i=0;while(s[i]=='+'){ a+...
a.cc: In function 'int main()': a.cc:39:26: error: expected ')' before ';' token 39 | for(X=0;X<10;X++;){ | ~ ^ | ) a.cc:39:27: error: expected primary-expression before ')' token 39 | for(X=0;X<10;X++;){ | ...
s513359974
p00110
C++
#include <iostream> #include <string> using namespace std; int check(int,int); int isNum(int c){ if(48<=c && c<=57){ return c-48; } return -1; } int main(){ string s; string a,b,c; int an,bn,cn; int A,B,C; int i,tmp; int X; while(1){ cin>>s;s+='e'; a="";b="";c="";an=0;bn=0;cn=0; i=0;while(s[i]=='...
a.cc: In function 'int main()': a.cc:39:26: error: expected ')' before ';' token 39 | for(X=0;X<10;X++;){ | ~ ^ | ) a.cc:39:27: error: expected primary-expression before ')' token 39 | for(X=0;X<10;X++;){ | ...
s198726945
p00110
C++
import sys for s in sys.stdin: p=s.split("=") ans="NA" st=0 tmp=p[0].split("+") if tmp[0][0]=="X" or tmp[1][0]=="X" or p[1][0]=="X": st=1 for i in range(st,10): a=eval(p[0].replace("X",str(i))) b=eval(p[1].replace("X",str(i))) if a==b: ans=i ...
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s362238388
p00110
C++
# define _CRT_SECURE_NO_WARNINGS 1 # include <iostream> # include <string> # include <vector> # include <algorithm> # include <cstdlib> # include <cstdio> # include <cstring> # include <cstdlib> # include <iomanip> # include <queue> # include <sstream> # include <climits> # include <cmath> # include <list> # include <f...
a.cc:22:10: warning: "M_PI" redefined 22 | # define M_PI 3.141592 | ^~~~ In file included from /usr/include/c++/14/cmath:47, from a.cc:14: /usr/include/math.h:1121:10: note: this is the location of the previous definition 1121 | # define M_PI 3.14159265358979323846 /* pi *...
s172576277
p00110
C++
import sys import re for line in sys.stdin: line=re.split('[+=]',line) flag=True for i in range(10): if(line[0][0]=='X'or line[1][0]=='X'or line[2][0]=='X')and i==0:continue cnt=0 for j in range(2): s=line[j] s=s.replace('X',str(i)) cnt+=int(s) s=line[2] s=s.replace('X',str(i)) if cnt==int(s): ...
a.cc:4:23: warning: multi-character character constant [-Wmultichar] 4 | line=re.split('[+=]',line) | ^~~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s977207946
p00110
C++
while expr = gets if expr.chomp == "" break end flag = false a1, a2, ans = expr.chomp.split(/[\+|=]/) (0..9).each do |i| tmp_a1 = a1.gsub("X", i.to_s).to_i tmp_a2 = a2.gsub("X", i.to_s).to_i tmp_ans = ans.gsub("X", i.to_s).to_i if (tmp_a1 + tmp_a2 == tmp_ans) puts i flag...
a.cc:7:37: error: stray '\' in program 7 | a1, a2, ans = expr.chomp.split(/[\+|=]/) | ^ a.cc:9:4: error: too many decimal points in number 9 | (0..9).each do |i| | ^~~~ a.cc:1:1: error: expected unqualified-id before 'while' 1 | while expr = gets ...
s038014352
p00110
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a; while (cin >> a) { int d, e = 0; a += "+"; string l=""; for (int i = 0; i < 10; i++) { string h = "",b[3]; int c = 0; string f = "", o = ""; for (int j = 0; j < a.length(); j++) { if (a[j] == '...
a.cc: In function 'int main()': a.cc:85:17: error: jump to label 'stop' 85 | stop:; | ^~~~ a.cc:17:78: note: from here 17 | if (h[0] == '0'&&h.length()!=1) goto stop; | ...
s794245303
p00110
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a; while (cin >> a) { int d, e = 0; a += "+"; string l=""; for (int i = 0; i < 10; i++) { string h = "",b[3]; int c = 0; string f = "", o = ""; for (int j = 0; j < a.length(); j++) { if (a[j] == '...
a.cc: In function 'int main()': a.cc:85:17: error: jump to label 'stop' 85 | stop:; | ^~~~ a.cc:17:78: note: from here 17 | if (h[0] == '0'&&h.length()!=1) goto stop; | ...
s041555683
p00110
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a="sdghjkl"; while (cin >> a) { int d, e = 0; a += "+"; string l=""; for (int i = 0; i < 10; i++) { string h = "",b[3]; int c = 0; string f = "", o = ""; for (int j = 0; j < a.size(); j++) { if (a...
a.cc: In function 'int main()': a.cc:86:17: error: jump to label 'stop' 86 | stop:; | ^~~~ a.cc:17:78: note: from here 17 | if (h[0] == '0'&&h.length()!=1) goto stop; | ...
s710929706
p00110
C++
while e = gets equation = e.chomp.sub!(/=/, '+').split('+') flag = false for i in 0..9 sec1, sec2, sec3 = "", "", "" sec1 = equation[0].gsub("X", i.to_s) sec2 = equation[1].gsub("X", i.to_s) sec3 = equation[2].gsub("X", i.to_s) if sec1.to_i + sec...
a.cc:5:14: error: too many decimal points in number 5 | for i in 0..9 | ^~~~ a.cc:1:1: error: expected unqualified-id before 'while' 1 | while e = gets | ^~~~~
s579952807
p00110
C++
using System; class A{ static void Main(){ while(true){ tring poikas=Console.ReadLine(); if(poikas==null){break;} var shiki=poikas.Split('='); var ko=shiki.Split('+'); var left=ko[0],right=ko[1],ans=ko[2]; for(int i=0;i<10;i++){ ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:45:2: error: expected ';' after class definition 45 | } | ^ | ; a.cc: In static member function 'static void A::Main()': a.cc:5:13: error: 'tring' was not declared in this scope 5 | ...
s017069438
p00110
C++
using System; class A{ static void Main(){ while(true){ string poikas=Console.ReadLine(); if(poikas==null){break;} var shiki=poikas.Split('='); var ko=shiki.Split('+'); var left=ko[0],right=ko[1],ans=ko[2]; for(int i=0;i<10;i++){ ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:45:2: error: expected ';' after class definition 45 | } | ^ | ; a.cc: In static member function 'static void A::Main()': a.cc:5:13: error: 'string' was not declared in this scope 5 | ...
s611516653
p00110
C++
#include <iostream> #include <sstream> #include <string> using namespace std; int main( void ) { string in; while ( cin >> in ) { bool found = false; for ( int i = 0; i < 10; i++ ) { string ex = in; replace( ex.begin(), ex.end(), 'X', (char)('0'+i) ); replace( ex.begin(), ex.end(), '+', ' ' ); repl...
a.cc: In function 'int main()': a.cc:14:25: error: 'replace' was not declared in this scope 14 | replace( ex.begin(), ex.end(), 'X', (char)('0'+i) ); | ^~~~~~~
s835559246
p00110
C++
#include<stdio.h> #include<string.h> char*p,E0[128],E1[128],da[128],db[128],dc[128],X; C(){ int ia,ib,ic,v; for(v=ia=ib=ic=0;dc[ic];){ if(da[ia]) v+=da[ia++]-'0'; if(db[ib]) v+=db[ib++]-'0'; if(v%10+'0'!=dc[ic++]) return 0; v/=10; } if(v||da[ia]||db[ib]) return 0; return 1; } main(){ for(;~scan...
a.cc:4:1: error: ISO C++ forbids declaration of 'C' with no type [-fpermissive] 4 | C(){ | ^ a.cc:19:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 19 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:28:25: error: 'strrev' was not declared in this scope; did you m...
s169837431
p00110
C++
#include <stdio.h> #include <ctype.h> #include <stdlib.h>> int main(void) { char str[256]; int xpos[256]; int xcnt; int n; while (fgets(str, 256, stdin) != NULL){ xcnt = 0; for (int i = 0; str[i] != '\n'; i++){ if (str[i] == 'X'){ xpos[xcnt++] = i; } } int i; for (i = '0'; i <= '9'; i++){...
a.cc:3:20: warning: extra tokens at end of #include directive 3 | #include <stdlib.h>> | ^ a.cc: In function 'int main()': a.cc:33:42: error: 'a' was not declared in this scope 33 | continue;a | ^
s714844761
p00110
C++
import java.util.Scanner; //Alphametic public class AOJ0110 { static char[] s; static int id; static boolean exp(){ int a = fact(); if(a==-1)return false; while(true){ char c = s[id++]; if(c=='=')break; int x = fact(); if(x==-1)return false; a+=x; } int b = fact(); if(b==-1)return fals...
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:4:1: error: expected unqualified-id before 'public' 4 | public class AOJ0110 { | ^~~~~~
s177252413
p00110
C++
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String line = sc.next(); boolean flag = false; for (char c = '0'; c <= '9'; ++c) { String temp = line; temp =...
a.cc:1:1: error: 'import' does not name a type 1 | import java.math.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1...
s235959883
p00110
C++
#include <iostream> #include <string> #include <sstream> void replace(std::string& text,std::string bef,std::string aft){ std::string::size_type pos = 0; while(pos = text.find(pos,bef)){ if(pos!=std::string::npos)break; text.replace(pos,bef.length(),aft); pos += aft.length; } return ; } int main(){...
a.cc: In function 'void replace(std::string&, std::string, std::string)': a.cc:6:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::find(std::__cxx11::basic_string<char>::size_type&, std::string&)' 6 | while(pos = text.find(pos,bef)){ | ~~~~~~~~~^~~~~~~~~ In file in...
s243613016
p00110
C++
#include <iostream> #include <string.h> using namespace std; #define X(a) (a=='X'?i:a-'0') int resX(char *p[3]){ int c[10]={0},i,x[10]={0}; while(*p[2]){ for(i=0;i<10;i++) if(X(*p[0]) + X(*p[1]) + c[i] == X(*p[2])) c[i] = 0; else if(X(*p[0]) + X(*p[1]) - 10 + c[i] == X(*p[2])) c[i] = 1; else x[i] = 1; ...
a.cc: In function 'int main()': a.cc:25:17: error: 'strrev' was not declared in this scope; did you mean 'strsep'? 25 | strrev(buf); | ^~~~~~ | strsep
s264609874
p00110
C++
#include <iostream> #include <vector> #include <cstdio> using namespace std; int main(){ string s; while(cin>>s){ vector<int> v; int ans=-1;int f=0; for(int i=s.size()-1,frag=0;i>-1;--i){ if(s[i]=='X'||('0'<=s[i]&&s[i]<='9')){ ++frag; if(s[i]=='X'){ v.push_back(i); if(i==0&&frag>=2)f=1; ...
a.cc: In function 'int main()': a.cc:16:34: error: 'dd' was not declared in this scope 16 | }dd | ^~
s085441534
p00110
C++
#include <iostream> #include <cstring> #include <ctype> int main() { const int N = 128; char str[N]; while (std::cin >> str) { int cs[N] = {0}, vs[N] = {0}; int sFlag = 1, cDigit = 0, maxDigit = 0;; for (int i = strlen(str) - 1; i >= 0; --i) { if (isdigit(str[i])) { cs[cDigit] += sFlag * (str[i] -...
a.cc:3:10: fatal error: ctype: No such file or directory 3 | #include <ctype> | ^~~~~~~ compilation terminated.
s222362142
p00110
C++
import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { String line = sc.nextLine(); int plusPos = line.indexOf('+'); ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.math.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1...
s246532604
p00110
C++
#include <iostream> #include <string> #include <vector> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef long long ll; typedef unsigned uint; typedef unsigned long ul; typedef unsigned long long ull; #define all(c) (c).begin(), (c).end() #define loop(i,a,b) for(...
a.cc: In function 'bool check(int, std::string)': a.cc:34:9: error: 'reverse' was not declared in this scope 34 | reverse(all(ss[i])); | ^~~~~~~
s647353619
p00111
Java
import java.util.HashMap; import java.util.Map; import java.util.Scanner; //Doctor's Memorable Codes public class AOJ0111 { public static void main(String[] args) { Map<String, Character> t = new HashMap<String, Character>(); t.put("101", ' '); t.put("000000", '\''); t.put("000011", ','); t.put("10010001",...
Main.java:6: error: class AOJ0111 is public, should be declared in a file named AOJ0111.java public class AOJ0111 { ^ 1 error
s125757286
p00111
Java
import java.io.File; import java.io.FileReader; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import java.util.HashMap; /* PETER POTTER PETER PIPER PICKED A PECK OF PICKLED PEPPERS. A PECK OF PICKLED PEPPERS PETER PIPER PICKED. IF PETER PIPER PICKED A PECK OF PICKLED PEP...
Main.java:122: error: class vol1_0111 is public, should be declared in a file named vol1_0111.java public class vol1_0111 ^ 1 error
s164905948
p00111
Java
class AsciiCode { String name; static HashMap<String,String> a2b; static HashMap<String,String> a2d; AsciiCode() { a2b = new HashMap<String,String>(); a2d = new HashMap<String,String>(); a2b.put("A","00000"); a2b.put("B","00001"); a2b.put("C","00010"); a2b.put("D","00011"); a2b.put("E","0010...
Main.java:4: error: cannot find symbol static HashMap<String,String> a2b; ^ symbol: class HashMap location: class AsciiCode Main.java:5: error: cannot find symbol static HashMap<String,String> a2d; ^ symbol: class HashMap location: class AsciiCode Main.java:112: error: cannot f...
s042045708
p00111
Java
class AsciiCode { String name; static HashMap<String,String> a2b; static HashMap<String,String> a2d; AsciiCode() { a2b = new HashMap<String,String>(); a2d = new HashMap<String,String>(); a2b.put("A","00000"); a2b.put("B","00001"); a2b.put("C","00010"); a2b.put("D","00011"); a2b.put("E","0010...
Main.java:4: error: cannot find symbol static HashMap<String,String> a2b; ^ symbol: class HashMap location: class AsciiCode Main.java:5: error: cannot find symbol static HashMap<String,String> a2d; ^ symbol: class HashMap location: class AsciiCode Main.java:112: error: cannot f...
s999329114
p00111
Java
class AsciiCode { String name; static HashMap<String,String> a2b; static HashMap<String,String> a2d; AsciiCode() { a2b = new HashMap<String,String>(); a2d = new HashMap<String,String>(); a2b.put("A","00000"); a2b.put("B","00001"); a2b.put("C","00010"); a2b.put("D","00011"); a2b.put("E","0010...
Main.java:4: error: cannot find symbol static HashMap<String,String> a2b; ^ symbol: class HashMap location: class AsciiCode Main.java:5: error: cannot find symbol static HashMap<String,String> a2d; ^ symbol: class HashMap location: class AsciiCode Main.java:112: error: cannot f...
s276844306
p00111
Java
public class Main { public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line; AsciiCode ac = new AsciiCode(); while((line = br.readLine()) != null) { String bin = ac.s2c(line); String s = ac.decode(bin); ...
Main.java:3: error: cannot find symbol public static void main(String args[]) throws IOException { ^ symbol: class IOException location: class Main Main.java:19: error: cannot find symbol static HashMap<String,String> a2b; ^ symbol: class Ha...
s453912292
p00111
Java
public class Main { static final Node root = new Node(); static { String[] zo = { "101", "000000", "000011", "10010001", "010001", "000001", "100101", "10011010", "0101", "0001", "110", "01001", "10011011", "010000", "0111", "10011000", "0110", "00100", "10011001", "10011110", "00101", "111", "10011111"...
Main.java:76: error: cannot find symbol EnumMap<Signal, Tree> node = new EnumMap<Signal, Tree>(Signal.class); ^ symbol: class EnumMap location: class Node Main.java:19: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:19: error: cann...
s873963238
p00111
C
#include<stdio.h> #include<stdlib.h> #include<string.h> void conv(char *s,char c); void cc(char *t,char *o,char *out); int main(void){ char in[100]={""},o[1000]={""},s[20]={""},out[1000]={""},t[20]={""}; int i,l,step=0,f=0; while(scanf("%s",in)!=EOF){ step=0; i=0; while(o[i]!=NULL){ o[i]=NULL; ...
main.c: In function 'main': main.c:18:27: warning: comparison between pointer and integer 18 | while(o[i]!=NULL){ | ^~ main.c:19:29: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 19 | o...
s151469177
p00111
C
#include<stdio.h> #include<stdlib.h> #include<string.h> void conv(char *s,char c); void cc(char *t,char *o,char *out); int main(void){ char in[100]={""},o[1000]={""},s[20]={""},out[1000]={""},t[20]={""}; int i,l,step=0,f=0; while(scanf("%s",in)!=EOF){ step=0; f=0; i=0; while(o[i]!=NULL){ o[i]=NULL...
main.c: In function 'main': main.c:18:27: warning: comparison between pointer and integer 18 | while(o[i]!=NULL){ | ^~ main.c:19:29: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 19 | o...
s405309633
p00111
C
#include<stdio.h> #include<stdlib.h> #include<string.h> void conv(char *s,char c); void cc(char *t,char *o,char *out); int main(void){ char in[100]={""},o[1000]={""},s[20]={""},out[1000]={""},t[20]={""}; int i,l,step=0,f=0; while(scanf("%s",in)!=EOF){ step=0; f=0; i=0; while(o[i]!=NULL){ o[i]=NULL...
main.c: In function 'main': main.c:18:27: warning: comparison between pointer and integer 18 | while(o[i]!=NULL){ | ^~ main.c:19:29: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 19 | o...
s108065974
p00111
C++
type Binary = String main = interact $ unlines.map (readNumLine.concat.map (toBin code_charTable)).lines toBin :: [(Char,String)] -> Char -> String toBin list char = case lookup char list of Just b -> b Nothing -> "" readNumLine :: String -> String readNumLine (x:xs) = rnl [x]...
a.cc:19:18: error: stray '\' in program 19 | bin2dec = foldl (\x y -> 2*x +y) 0.map (\x -> read [x]) | ^ a.cc:19:41: error: stray '\' in program 19 | bin2dec = foldl (\x y -> 2*x +y) 0.map (\x -> read [x]) | ^ a.cc:31:40: error: too many decimal...
s889356030
p00111
C++
nclude<bits/stdc++.h> using namespace std; int main(){ map<string,char>t2; map<char,string>t1; t1['A']="00000";t1['R']="10001"; t1['B']="00001";t1['S']="10010"; t1['C']="00010";t1['T']="10011"; t1['D']="00011";t1['U']="10100"; t1['E']="00100";t1['V']="10101"; t1['F']="00101";t1['W']="10110"; t1['G']="00110";t1...
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<bits/stdc++.h> | ^~~~~~ a.cc: In function 'int main()': a.cc:4:2: error: 'map' was not declared in this scope 4 | map<string,char>t2; | ^~~ a.cc:4:6: error: 'string' was not declared in this scope 4 | map<string,char>t2; | ^...
s436913707
p00111
C++
#! python.exe dic = {} for idx, c in enumerate("ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"): dic[c] = str(format(idx,'b').zfill(5)) decode = {"101" : " ", "0101" : "C", "0110" : "K", "00110" : "S", "000000" : "'", "0001" : "D", "00100" : "L", "00111" : "T", "000011" : ",", ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #! python.exe | ^ a.cc:14:2: error: invalid preprocessing directive #print 14 | #print(dic) | ^~~~~ a.cc:29:19: error: empty character constant 29 | tmp = '' | ^~ a.cc:30:10: error: invalid preprocessing ...
s210915347
p00111
C++
#include<cstdlib> #include<string> using namespace std; string tbl01[]={ "101","000000","000011","10010001","010001","000001","100101","10011010", "0101","0001","110","01001","10011011","010000","0111","10011000", "0110","00100","10011001","10011110","00101","111","10011111","1000", "00110","00111","10011100","1001...
a.cc: In function 'std::string fromAB(std::string&)': a.cc:33:17: error: 'itoa' was not declared in this scope 33 | itoa(c,t,2); sprintf(u,"%05s",t); | ^~~~ a.cc: In function 'int main()': a.cc:40:23: error: 'cin' was not declared in this scope 40 | while(getline(cin,...
s335258391
p00111
C++
#include<cstdlib> #include<cstring> #include<string> using namespace std; void itoa0(int value, char *buff ,int tmp){ char *p; int mod; p = buff; do{ mod = value % tmp + 48; *p++ = (char)mod; value /= tmp; }while(value); *p = '\0'; strrev(buff); } string tbl01[]={ "101","000000","000011","10010001","010...
a.cc: In function 'void itoa0(int, char*, int)': a.cc:16:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'? 16 | strrev(buff); | ^~~~~~ | strsep a.cc: In function 'int main()': a.cc:55:23: error: 'cin' was not declared in this scope 55 | while(get...
s301385568
p00111
C++
#include <string> #include <bitset> #include <map> #include <cstring> #include <windows.h> using namespace std; const char *t1=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const char *v1[]={"101","000000","000011","10010001","010001","000001","100101","10011010","0101","0001","110","01001","10011011","010000","0111","10011000"...
a.cc:5:10: fatal error: windows.h: No such file or directory 5 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s063919277
p00111
C++
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <map> #include <string> using namespace std; int main(){ map<string,char> table; table["101"]=' '; table["000000"]=(char)39; table["000011"]=','; table["10010001"]='-'; table["010001"]='.'; table["000001"]='?'; table["100101...
a.cc: In function 'int main()': a.cc:58:17: error: 'table2' was not declared in this scope; did you mean 'table'? 58 | table2['A'+i]=ms; | ^~~~~~ | table a.cc:60:9: error: 'table2' was not declared in this scope; did you mean 'table'? 60 | table2...
s318419501
p00111
C++
#include <iostream> #include <cstdio> #include <cstring> #include <map> #include <string> using namespace std; map<char,string> m; map<string,char> n; int main() { m.insert( map<char,string>::value_type('A',"00000") ); m.insert( map<char,string>::value_type('B',"00001") ); m.insert( map<char,string>::value_type('...
a.cc: In function 'int main()': a.cc:78:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 78 | gets(t); | ^~~~ | getw
s518803531
p00111
C++
#include <iostream> #include <cstdio> #include <cstring> #include <map> #include <string> using namespace std; map<char,string> m; map<string,char> n; int main() { m.insert( map<char,string>::value_type('A',"00000") ); m.insert( map<char,string>::value_type('B',"00001") ); m.insert( map<char,string>::value_type('...
a.cc: In function 'int main()': a.cc:78:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 78 | gets(t); | ^~~~ | getw
s880014108
p00111
C++
#include "iostream" #include "map" #include "string" using namespace std; map< char, string > toBits; map< string, char > toChar; #define INSB( k, s ) (toBits.insert( map<char, string>::value_type(k, s))) #define INSC( k, s ) (toChar.insert( map<string, char>::value_type(k, s))) string ToBits( char ch ) { string r...
a.cc:50:22: error: '_TCHAR' has not been declared 50 | int _tmain(int argc, _TCHAR* argv[]) | ^~~~~~
s058304147
p00112
Java
import java.util.Arrays; import java.util.Scanner; public class AMilkShop { public static void main(String[] args) { Scanner s = new Scanner(System.in); while(true){ int cnt = s.nextInt(); if(cnt==0) return; int[] times = new int[cnt]; for(int i=0 ; i<cnt ; i++) { times[i] = s.nextInt(); ...
Main.java:5: error: class AMilkShop is public, should be declared in a file named AMilkShop.java public class AMilkShop { ^ 1 error
s632342170
p00112
Java
mport java.util.Scanner; import java.util.Collections; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; ArrayList<Integer> list = new ArrayList<Integer>(); for (int...
Main.java:1: error: class, interface, enum, or record expected mport java.util.Scanner; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.Collections; ^ Main.java:3: error: class, interface, enum, or record expected import java.util.ArrayList; ^ 3 errors
s920189899
p00112
C
#include<iostream> #include<stdio.h> #include<algorithm> using namespace std; int main(){ int n,i,j,sum,sum2,x[10000],a; while(1){ sum=0; sum2=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%d",&x[i]); } sort(x,x+n); sum=x[0]; for(i=1;i<n;i++){ sum2+=s...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s528068890
p00112
C
#include <algorithm> using namespace std; int a[10000]; int main(){ int n,i; long long int z,r; for(;scanf("%d",&n),n;printf("%lld\n",r)){ for(i=0;i<n;i++)scanf("%d",a+i); sort(a,a+n); for(z=r=i=0;i<n-1;i++)z+=a[i],r+=z; } }
main.c:1:10: fatal error: algorithm: No such file or directory 1 | #include <algorithm> | ^~~~~~~~~~~ compilation terminated.
s487256927
p00112
C
#include <stdio.h> #define MAX_PEAPLE ( 10000 ) int needTime[ MAX_PEAPLE ]; int tmp[ MAX_PEAPLE ]; void sort( int data[], int size ); __int64 getWaitTime( int data[], int size ); int main( void ) { int n; int i; while( scanf( "%d", &n ) != EOF ) { if( n == 0 )break; for( i = 0; i < n; i++ ) { scanf(...
main.c:10:1: error: unknown type name '__int64'; did you mean '__int64_t'? 10 | __int64 getWaitTime( int data[], int size ); | ^~~~~~~ | __int64_t main.c:31:1: error: unknown type name '__int64'; did you mean '__int64_t'? 31 | __int64 getWaitTime( int data[], int size ) | ^~~~~~~ | __int64...
s075297713
p00112
C++
#include <cstdio> #include <algorithm> using namespace std; int main() { int n; while (scanf("%d", &n) != EOF){ int waitt[10000] = {0}; int i, j; long long sum; for (i = 0; i < n; i++) scanf("%d", waitt + i); sort(waitt, waitt + n); for (i = 0; i < n; i++){ for (j = 0; j <= i; j++){ sum += w...
a.cc: In function 'int main()': a.cc:19:48: error: invalid types 'int[int]' for array subscript 19 | sum += waitt[i][j]; | ^
s576501775
p00112
C++
#include <iostream> #include <vector> #include <algorithm> #define rep(X, Y) for( int (X) = 0; (X) < (Y); ++(X) ) int main(){ int i, cnt; std::vector<int> vec; while( std::cin >> cnt, cnt ){ while(cnt--) std::cin >> i, vec.push_back(i); std::sort( vec.begin(), vec.end() ); rep( i, 2 ) rep( l, vec.si...
a.cc: In function 'int main()': a.cc:21:42: error: no matching function for call to 'min(std::vector<int>::size_type, int)' 21 | std::cout << vec[std::min(vec.size() - 2, 0)] << std::endl; | ~~~~~~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/s...
s142117023
p00112
C++
int main(){ vector<unsigned long long> t(10001, 61); int p; int i; vector<unsigned long long> total(10001, 0); int matu = 0; while (1){ for (i = 0; i <= 10000; i++){ t[i] = 61; } for (i = 0; i <= 10000; i++){ total[i] = 0; } matu = 0; cin >> p; if (p == 0){ break; } for (i = 0; i...
a.cc: In function 'int main()': a.cc:4:9: error: 'vector' was not declared in this scope 4 | vector<unsigned long long> t(10001, 61); | ^~~~~~ a.cc:4:16: error: expected primary-expression before 'unsigned' 4 | vector<unsigned long long> t(10001, 61); | ^~~~~~~...
s377022080
p00112
C++
#include<iostream> #include<algorithm> using namespace std; int func(int dt[],int num){ unsigned long long int c=num; unsigned long long int time=0; for(int i=0;i<c-1;i++){ time+=(c-(i+1))*dt[i]; } return time; } int main(){ int n; while(1){ cin>>n; if(n==0)break; unsigned long long int cost[n]; unsi...
a.cc: In function 'int main()': a.cc:25:26: error: cannot convert 'long long unsigned int*' to 'int*' 25 | ans=func(cost,n); | ^~~~ | | | long long unsigned int* a.cc:5:14: note: initializing argument 1 of ...
s869570479
p00112
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main() { int n,a[10000]; while(true){ scanf("%d",&n); if(n==0)return 0; for(int i=0;i<n;i++)scanf("%d",&a[i]); long long int ans=0; sort(a,a+n); for(int i=0;i<n;i++)ans+=(ll)a[i]*(n-1-i); printf("%lld\n",ans); } }
a.cc: In function 'int main()': a.cc:14:27: error: 'll' was not declared in this scope 14 | for(int i=0;i<n;i++)ans+=(ll)a[i]*(n-1-i); | ^~
s890132476
p00112
C++
#include<iostream> #include<cstdio> #include<vector> #include<map> #include<climits> #include<algorithm> #include<string> #include<cstring> #include<cmath> #include<set> #include<stack> #include<functional> #include<queue> using namespace std; #define int long long long signed main(){ int N,T[10000]; while(cin...
a.cc: In function 'int main()': a.cc:15:23: error: 'long long long' is too long for GCC 15 | #define int long long long | ^~~~ a.cc:18:5: note: in expansion of macro 'int' 18 | int N,T[10000]; | ^~~ a.cc:15:23: error: 'long long long' is too long for GCC 15 | #define i...
s280557786
p00112
C++
#include<stdio.h> int main(){ int [10001]={}; int a=0.s=0; int n; while(1){ scanf("%d",&n); if(n==0)break; for(int i=0;i<n;i++) scanf("%d",&n[i]); for(int i=0;i<n;i++) for(int j=n-1;j>i;j--) if(n[j]<n[j-1]){int t=n[j];n[j]=n[j-1];n[j-1]=t;} if(n==1)s=0; else{ for(int i=1;i<n;i++) { a=a+n[i-1];s+=a; } } printf("%d\...
a.cc: In function 'int main()': a.cc:4:6: error: expected identifier before numeric constant 4 | int [10001]={}; | ^~~~~ a.cc:4:6: error: expected ']' before numeric constant 4 | int [10001]={}; | ^~~~~ | ] a.cc:4:5: error: structured binding declaration cannot have type 'int' ...
s354730880
p00112
C++
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(void) { int n; while(cin >> n, n){ int a = 0; long longint ans = 0; int time[10000]; for(int i = 0; i < n; i++){ cin >> time[i]; } sort(time, time + n); int temp = n; for(int j = 0; j < n-1; j++){ a = 0...
a.cc: In function 'int main()': a.cc:13:30: error: expected initializer before 'ans' 13 | long longint ans = 0; | ^~~ a.cc:26:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 26 | ans += a; | ...
s006312966
p00112
C++
#include<iostream> #include<algorithm> #include<cstring> using namespace std; int x[10000000]; int n, sum2; long long sum; int main() { while (true) { memset(x, 0, sizeof(x)); cin >> n; if (!n) { break; } for (int i = 0; i < n; i++) { cin >> x[i]; } sort(x, x + n); sum2 = 0; sum = 0; for (int i = ...
a.cc: In function 'int main()': a.cc:19:33: error: 'a' was not declared in this scope 19 | sum2 += a[i]; | ^
s774307325
p00112
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int n,i,sum,wait; vector<int> w; while(cin>>n,n){ w.assign(n,0); for(i=0;i<n;cin>>w[i],ut<<sum<<endl;++i); sort(w.begin(),w.end()); for(sum=wait=0,i=0;i<n-1;wait+=w[i],sum+=wait,++i); co } return 0; }
a.cc: In function 'int main()': a.cc:11:39: error: 'ut' was not declared in this scope 11 | for(i=0;i<n;cin>>w[i],ut<<sum<<endl;++i); | ^~ a.cc:11:52: error: expected ')' before ';' token 11 | for(i=0;i<n;cin>>w[i],ut<<sum<<endl;++i); ...
s736118871
p00112
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> using namespace std; int main() { int n;; while (cin >> n, n) { vector<long long> a(n); for (long long &x : a)cin >> x; sort(a.begin(), a.end()...
a.cc: In function 'int main()': a.cc:18:39: error: 'sum1' was not declared in this scope; did you mean 'sum'? 18 | for (long long &x : a)sum1+=sum,sum+=x; | ^~~~ | sum a.cc:21:25: error: 'sum1' was not declared in...
s884557006
p00112
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> using namespace std; int main() { int n;; while (cin >> n, n) { vector<long long> a(n); for (long long &x : a)cin >> x; sort(a.begin(), a.end()...
a.cc: In function 'int main()': a.cc:22:26: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int') 22 | cout << n==1?0:a[n - 2] << endl; | ~~~~~~~~~^~~ | | | | | int | ...
s102494838
p00112
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> using namespace std; int main() { int n;; while (cin >> n, n) { vector<long long> a(n); for (long long &x : a)cin >> x; sort(a.begin(), a.end()...
a.cc: In function 'int main()': a.cc:22:26: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int') 22 | cout << n==1?0:a[n - 2] << endl; | ~~~~~~~~~^~~ | | | | | int | ...
s155870781
p00112
C++
#include <iostream> using namespace std; int main() { int n, t[10000]; while(1) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) cin >> t[i]; sort(t, t+n); int ans = 0; for (int i = 0; i < n; i++) ans += ans + t[i] - t[0]; cout << ans << endl; } }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(t, t+n); | ^~~~ | short
s403168258
p00112
C++
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; int main(void){ int n; long long unsigned int sum; while (scanf("%d", &n), n){ vector<int> vec; for (int i=0; i<n; i++){ int x; scanf("%d", &x); vec.push_back(x); } sort(vec.begin(), vec.end()); ...
a.cc: In function 'int main()': a.cc:23:5: error: 'cout' was not declared in this scope 23 | cout << sum << endl; | ^~~~ a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <algorithm> +++ |+#include <iostream> 4...
s108038943
p00112
C++
#include <bits/stdc++.h> using namespace std; vector<int> list; int main(){ int n; while(cin>>n,n!=0){ list.clear(); for(int i=0;i<n;i++){ int tmp; cin>>tmp; list.push_back(tmp); } sort(list.begin(),list.end()); long long ans=0; long long pre=0; for(int i=0;i<n;i++){...
a.cc: In function 'int main()': a.cc:9:5: error: reference to 'list' is ambiguous 9 | list.clear(); | ^~~~ In file included from /usr/include/c++/14/list:65, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150, from a.cc:1: /usr/include/c++/14/bits/stl_list.h:...
s292475947
p00112
C++
#include <bits/stdc++.h> using namespace std; vector<int> list; int main(){ int n; while(cin>>n,n!=0){ list.clear(); for(int i=0;i<n;i++){ int tmp; cin>>tmp; list.push_back(tmp); } sort(list.begin(),list.end()); long long ans=0; long long pre=0; for(int i=0;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:8:5: error: reference to 'list' is ambiguous 8 | list.clear(); | ^~~~ In file included from /usr/include/c++/14/list:65, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150, from a.cc:1: /usr/include/c++/14/bits/stl_list.h:...
s169065888
p00112
C++
#include "bits/stdc++.h" #include<iostream> #include<cstdio> #include<cmath> #include<bitset> #include<algorithm> #include<vector> using namespace std; vector<int> list; int main(){ int n; while(cin>>n,n!=0){ list.clear(); for(int i=0;i<n;i++){ int tmp; cin>>tmp; list.push_back(tmp); ...
a.cc: In function 'int main()': a.cc:14:5: error: reference to 'list' is ambiguous 14 | list.clear(); | ^~~~ In file included from /usr/include/c++/14/list:65, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150, from a.cc:1: /usr/include/c++/14/bits/stl_list.h...
s900139709
p00112
C++
import java.util.Arrays; import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main(); } public Main() { sc = new Scanner(System.in); int lines = Integer.parseInt(sc.nextLine()); while (lines != 0) { int[] wait = new int[lines]; for (in...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-t...
s886825028
p00112
C++
#include <algorithm> using namespace std; const int MAX = 10000; int main() { int N; while (cin >> N, N) { int a[MAX]; for (int i=0; i<N; i++) cin >> a[i]; sort(&a[0], &a[N]); int sum = 0; for (int i=1; i<N; i++) sum += (N-i)*a[i-1]; cout << sum << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: 'cin' was not declared in this scope 8 | while (cin >> N, N) | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <algorithm> +++ |+#include <iost...
s537259124
p00112
C++
#include <iostream> #include <stdlib.h> #include <algorithm> using namespace std; int main(int argc, char **argv) { int n, *array, tmp; while(1){ cin >> n; if(n == 0){ break; } array = (int *)calloc(n, sizeof(int)); for(int i = 0; i < n; i++)[ cin >> array[i]; } sort(array, array+n); t...
a.cc: In function 'int main(int, char**)': a.cc:19:25: warning: capture of variable 'std::cin' with non-automatic storage duration 19 | cin >> array[i]; | ^~~ In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::istream std::cin' declared...
s807445703
p00112
C++
import java.io.*; import java.util.List; import java.util.ArrayList; public class Main{ public static void main(String args[]){ new Main(); } public Main(){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); List<Integer> nums = new ArrayList<Integer>(); try{ String line; whi...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.List; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:...
s196135362
p00112
C++
import java.io.*; import java.util.List; import java.util.ArrayList; public class Main{ public static void main(String args[]){ new Main(); } public Main(){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); List<int[]> nums = new ArrayList<int[]>(); List<Integer> ans = new ArrayLis...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.List; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:...
s212638994
p00112
C++
/* AizuOnline A0121 A Milk Shop */ #include <stdio.h> #include <stdlib.h> int int_lessp(int *a,int *b) { return(*a - *b); } main() { int i,c,n[10001]; long int sum; while(EOF!=scanf("%d",&c) && c > 0) { sum = 0; for(i=0;i<c;i++) scanf("%d",n+i); qsort(n,c,sizeof(int),int_le...
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 13 | main() | ^~~~ a.cc: In function 'int main()': a.cc:23:29: error: invalid conversion from 'int (*)(int*, int*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive] 23 | qsort(n,c,sizeof(i...
s549260574
p00112
C++
t['~~'];n,z;c(int*x){z=*1[&x]-*x;}main(s){for(;s=scanf("%d",&n)*n;printf("%d\n",s)){for(;s;)scanf("%d",t+--s);for(qsort(t,n,4,c);n;)s+=t[--n]*n;}exit(0);}
a.cc:1:3: warning: multi-character character constant [-Wmultichar] 1 | t['~~'];n,z;c(int*x){z=*1[&x]-*x;}main(s){for(;s=scanf("%d",&n)*n;printf("%d\n",s)){for(;s;)scanf("%d",t+--s);for(qsort(t,n,4,c);n;)s+=t[--n]*n;}exit(0);} | ^~~~ a.cc:1:1: error: 't' does not name a type 1 | t['~~'];n,z;c(int*x){z=*...
s870842128
p00112
C++
#include <iostream> #include <stdlib.h> using namespace std; int int_cmp(const void *a, const void *b){return *(int*)a - *(int*)b;} int main(){ int i,j,n,t[10010]; while(cin>>n,n){ __int64 s=0; for(i=0;i<n;i++)cin>>t[i]; qsort(t,n,sizeof(int),int_cmp); for(i=0;i<n;i++)s+=t[i]*(n-i-1); cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:8:1: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 8 | __int64 s=0; | ^~~~~~~ | __int64_t a.cc:11:17: error: 's' was not declared in this scope 11 | for(i=0;i<n;i++)s+=t[i]*(n-i-1); | ^ a.cc:12:7: error: 's' was n...
s584958571
p00112
C++
#include <iostream> using namespace std; int main() { for (;;) { int n, p[10000]; cin >> n; if (!n) return 0; for (int i = 0; i < n; i++) cin >> p[i]; sort(p, p+n); int s = 0; for (int i = 1; i < n; i++) s += p[i-1]*(n-i); cout << s << endl; } }
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(p, p+n); | ^~~~ | short
s412894476
p00112
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; while( cin >> n && n ){ vector< int > line; for( int i = 0; i < n; ++i ){ int d; cin >> d; line.push_back( d ); } sort( line.begin(), line.end() ); long long output = 0; for( int i = 0; i < n - 1...
a.cc: In function 'int main()': a.cc:21:42: error: '__debugbreak' was not declared in this scope 21 | if( output < 0 ) __debugbreak(); | ^~~~~~~~~~~~
s774824743
p00112
C++
/*****include*****/ #include <iostream> #include <fstream> /*****デバッグ定義*****/ //#define DEBUG /*****マクロ定義*****/ #define INF 30000 /*****名前空間*****/ using namespace std; /*****グローバル変数置き場*****/ int *time; int mini; bool *visited; int num; /*****その他関数置き場*****/ void dfs(int node,int wait,int total){ int i; visited[node...
a.cc:13:6: error: 'int* time' redeclared as different kind of entity 13 | int *time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s456098475
p00112
C++
#include <cstdio> #include <queue> using namespace std; int num[10005]; int main(){ int n; while(scanf("%d",&n) && n){ for(int i=0;i<n;i++){ int r; scanf("%d",&num[i]); } sort(num,num+n); int ans=0; for(int i=0;i<n;i++){ ans+=num[i]*(n-1-i); } printf("%d\n",ans); } }
a.cc: In function 'int main()': a.cc:12:17: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(num,num+n); | ^~~~ | short
s782496040
p00112
C++
#include<stdio.h> int main() { while(scanf("%d",&n)!=EOF) { int x[10000],fake,sum=0; for(int t=0;;t++) { scanf("%d",&x[t]); if(x[t]==0) { break; } if(t!=0||t<n) { for(int r=0;r<=t;r++) { if(x[t]<x[r]) { fake=x[t]; x[t]=x[r]; x[r]=fake; } } } } for(int ...
a.cc: In function 'int main()': a.cc:6:27: error: 'n' was not declared in this scope 6 | while(scanf("%d",&n)!=EOF) | ^
s460342641
p00112
C++
#include <iostream> #include <vector> using namespace std; int main(){int n,i,t;for(long int ans;cin>>n,n;cout<<ans<<endl){vector<int> m;for(ans=i=0;i++<n;m.push_back(t))cin>>t;sort(m.begin(),m.end());for(i=1;i<n;i++)ans+=m[i-1]*(n-i);}}
a.cc: In function 'int main()': a.cc:4:119: error: 'sort' was not declared in this scope; did you mean 'short'? 4 | int main(){int n,i,t;for(long int ans;cin>>n,n;cout<<ans<<endl){vector<int> m;for(ans=i=0;i++<n;m.push_back(t))cin>>t;sort(m.begin(),m.end());for(i=1;i<n;i++)ans+=m[i-1]*(n-i);}} | ...
s945140206
p00112
C++
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; int main(){ int TIME[11111],sum[11111],ret; int n; while(1){ cin >> n; if(!n)break; memset( TIME , 0 , sizeof(TIME) ); memset( sum , 0 , sizeof(sum) ); for(int i=0;i<n;i++){ cin >> TIME[i]; } sort( TIME ...
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset( TIME , 0 , sizeof(TIME) ); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cst...
s546203331
p00112
C++
) { ans += (n-(i+1))*T[i]; } cout << ans << endl; } }
a.cc:1:1: error: expected unqualified-id before ')' token 1 | ) | ^ a.cc:6:17: error: 'cout' does not name a type 6 | cout << ans << endl; | ^~~~ a.cc:7:9: error: expected declaration before '}' token 7 | } | ^ a.cc:8:1: error: expected decla...
s993250908
p00112
C++
#include <iostream> int a[10010]; int main() { while(1) { memset(a,0,sizeof(0)); int n; cin >> n; if(n==0)break; for(int i=0;i<n;i++)cin >> a[i]; ll ans=0ll; sort...
a.cc: In function 'int main()': a.cc:7:21: error: 'memset' was not declared in this scope 7 | memset(a,0,sizeof(0)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> ...
s704383968
p00112
C++
#include <iostream> #include <cstring> using namespace std; int a[10010]; int main() { while(1) { memset(a,0,sizeof(0)); int n; cin >> n; if(n==0)break; for(int i=0;i<n;i++)cin >> a[i]; ...
a.cc: In function 'int main()': a.cc:14:21: error: 'll' was not declared in this scope 14 | ll ans=0ll; | ^~ a.cc:15:21: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(a,a+n); | ^~~~ | ...
s067706405
p00113
Java
import java.util.ArrayList; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int p = sc.nextInt(); int q = sc.nextInt(); new B(p, q); } } int p, q; int aaaa = 2; String shousuu = ""; ArrayList<Integer> ...
Main.java:4: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s966582177
p00113
C
#include<stdio.h> #include<list> #include<algorithm> class s{ public: int num; int i; s(int n,int j){ num=n; i=j; } }; int main(){ using namespace std; int p,q,pn,i,pr,j; char ans[1000]; list<s> memo; list<s>::iterator it; pn=1; while(scanf("%d %d",&p,&q)!=EOF){ for(pr=0,p*=10,i=0;p%q...
main.c:2:9: fatal error: list: No such file or directory 2 | #include<list> | ^~~~~~ compilation terminated.
s043256594
p00113
C
main(p,q,l){for(;~scanf("%d%d",&p,&q);){int r[q]={l=1};for(;!r[p%=q];putchar(p/q+48))r[p]=l++,p*=10;for(puts(" ");p&&l;)putchar(--l?--r[p]>0?32:94:10);}}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(p,q,l){for(;~scanf("%d%d",&p,&q);){int r[q]={l=1};for(;!r[p%=q];putchar(p/q+48))r[p]=l++,p*=10;for(puts(" ");p&&l;)putchar(--l?--r[p]>0?32:94:10);}} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'p' defaults to 'int' [-...
s420436192
p00113
C++
import std.stdio; import std.algorithm; import std.string; import std.range; import std.array; import std.conv; import std.complex; import std.math; import std.ascii; import std.bigint; import std.container; string[] calc(int p, int q, RedBlackTree!int s) { auto r = p%q; if(r == 0){ s.clear(); return [to!string...
a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import std.algorithm; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1...
s737500893
p00113
C++
#include <iostream> #include <set> #include <vector> using namespace std; typedef long long LL; static const double EPS = 1e-9; #define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i) #define REP(i,n) FOR(i,0,n) int main(void){ int p,q; while(cin>>p>>q){ vector<int> mod; mod.push_back(p); int count=0; ...
a.cc: In function 'int main()': a.cc:25:14: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 25 | if(find(mod.begin(),mod.end(),p)!=mod.end()){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets...
s066153070
p00113
C++
/* AizuOnline A0113 Maximum Sum Sequence */ #include <stdio.h> long long hijosuu; long long josuu; int quo[100]; long long rem[100]; int js; // junkansetu start int je; // junkansetu end init() { hijosuu = 100LL; josuu = 32768LL; } // write junkansetu write_yamagata() { int i; pri...
a.cc:12:1: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive] 12 | init() | ^~~~ a.cc: In function 'int init()': a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type] 16 | } | ^ a.cc: At global scope: a.cc:18:1: error: ISO C++ forbids declaration ...
s139011499
p00113
C++
#include<iostream> #include<vector> void drawdown(int a,int size){ int i = 0; for (; i < a; i++)std::cout << " "; for (; i < size; i++)std::cout << "^"; std::cout << std::endl; } int main(){ int p, q; while (std::cin >> p >> q){ std::vector<int>r; r.push_back(0); while (true){ if (p / q == 0)p *= 10...
a.cc: In function 'int main()': a.cc:23:44: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 23 | auto it = std::find(r.begin(), r.end(), p); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included...
s622254933
p00113
C++
#include<iostream> #include<vector> void drawdown(int a,int size){ int i = 0; for (; i < a; i++)std::cout << " "; for (; i < size; i++)std::cout << "^"; std::cout << std::endl; } int main(){ int p, q; while (std::cin >> p >> q){ std::vector<int>r; r.push_back(0); while (true){ if (p / q == 0)p *= 10...
a.cc: In function 'int main()': a.cc:23:44: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 23 | auto it = std::find(r.begin(), r.end(), p); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included...
s868065811
p00113
C++
#include<iostream> #include<vector> void drawdown(int a,int size){ int i = 0; for (; i < a; i++)std::cout << " "; for (; i < size; i++)std::cout << "^"; std::cout << std::endl; } int main(){ int p, q; while (std::cin >> p >> q){ std::vector<int>r; r.push_back(0); while (true){ if (p / q == 0)p *= 10...
a.cc: In function 'int main()': a.cc:23:66: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 23 | std::vector<int>::iterator it = std::find(r.begin(), r.end(), p); | ~~~~~...
s694497104
p00114
Java
import java.util.Scanner; public class AOJ0114 { public static void main(String[] argv) { Scanner sc = new Scanner(System.in); int[] num = new int[6]; while (true) { for (int i=0;i<num.length;++i) { num[i] = Integer.parseInt(sc.next()); } if (max(num)!=0) { System.out.println(""+lcm(calc...
Main.java:4: error: class AOJ0114 is public, should be declared in a file named AOJ0114.java public class AOJ0114 { ^ 1 error
s588386504
p00114
C
#include <stdio.h> long long cal_lcm(long long a, long long b) { long long t; long long gcd; long long a_bak; a_bak = a; gcd = b; if (a < gcd){ t = a; a = gcd; gcd = t; } while (a % gcd != 0){ t = gcd; gcd = a % gcd; a = t; } ...
main.c: In function 'cal_lcm': main.c:24:17: error: 'a_' undeclared (first use in this function); did you mean 'a'? 24 | return (a_ bak * b / gcd); | ^~ | a main.c:24:17: note: each undeclared identifier is reported only once for each function it appears in main.c:...
s451010961
p00114
C
a,b,i,t;long long k=1;L(x,y){!y?k*=n/x:L(y,x%y);}main(n){for(;scanf("%d%d",&a,&b)*a;L(n,k),n=++i%3<1?printf("%lld\n",k),k=1:1)for(t=a;t-1;t=t*a%b)++n;}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,i,t;long long k=1;L(x,y){!y?k*=n/x:L(y,x%y);}main(n){for(;scanf("%d%d",&a,&b)*a;L(n,k),n=++i%3<1?printf("%lld\n",k),k=1:1)for(t=a;t-1;t=t*a%b)++n;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] mai...