submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s099887844
p01086
C++
#include <iostream> using namespace std; const int step[5] = {5, 7, 5, 7, 7}; int N; string S[40]; int solve() { for (int i = 0; i < N; ++i) { bool ok = true; int idx = i; for (int t = 0; t < 5; ++t) { int acc = 0; while (acc < step[t]) acc += S[idx++].size(); ...
a.cc: In function 'int solve()': a.cc:25:5: error: 'assert' was not declared in this scope 25 | assert(false); | ^~~~~~ a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 1 | #include <iostream> +++ |+#include <cassert> 2 | using...
s398351166
p01087
C
#include <stdio.h> #include <string.h> #define NLINE 17 // 式の行数の最大値 #define LEN 9 // 式の1行の長さの最大値 int n; // 式の行数 char buff[NLINE][LEN+1]; // 式を格納する配列 // line 行目を評価して値を返す関数 int calc(int line) { char c; // 処理内容を示す文字(数字 , *, + ) int level; // 現在の行の入れ子レベル int val; // 評価結果を入れる変数 int arg; // 演算の引数の値を入れる変数 level = strl...
main.c:5:1: error: unknown type name '\U00005f0f\U0000306e\U0000884c\U00006570\U0000306e\U00006700\U00005927\U00005024' 5 | 式の行数の最大値 | ^~~~~~~~~~~~~~~~ main.c:8:23: error: expected ';' before 'int' 8 | 式の1行の長さの最大値 | ^ | ; 9 | int n; | ~~~ ...
s714433979
p01087
C++
#include<iostream> #include<vector> #include<cassert> #include<string> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> #include<stack> #include<queue> #include<set> #include<map> #include<tuple> #include<numeric> #include <ctype.h> using namespace std; using pii = pair<int,int>; using ll = long ...
a.cc: In function 'int calc(std::vector<std::__cxx11::basic_string<char> >&, int&, int)': a.cc:47:9: error: 'function' was not declared in this scope 47 | function<int(int, int)> f; | ^~~~~~~~ a.cc:15:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by addi...
s177303153
p01087
C++
#include<iostream> #include<vector> #include<cassert> #include<string> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> using namespace std; using pii = pair<int,int>; using ll = long long; #define rep(i, j) for(int i=0; i < (int)(j); i++) #define repeat(i, j, k) for(int i = (j); i < (int)(k); i+...
a.cc: In function 'int calc(std::vector<std::__cxx11::basic_string<char> >&, int&, int)': a.cc:40:9: error: 'function' was not declared in this scope 40 | function<int(int, int)> f; | ^~~~~~~~ a.cc:9:1: note: 'std::function' is defined in header '<functional>'; this is probably fixable by addin...
s722770352
p01087
C++
#include <iostream> #include <string> #include <vector> #include <stack> int calc(char op, std::vector<int> xs) { switch (op) { case '+': { int v = xs.at(0); for (int i = 1; i < xs.size(); i++) { v += xs.at(i); } return v; } case '*': { int v = xs.at(0); for (int i = 1; i < xs.size(); i++) { v ...
a.cc: In function 'int main()': a.cc:52:38: error: 'count' is not a member of 'std'; did you mean 'cout'? 52 | int d = std::count(s.begin(), s.end(), '.'); | ^~~~~ | cout
s835586802
p01087
C++
#include <iostream> #include <string> #include <vector> #include <stack> int calc(char op, std::vector<int> xs) { switch (op) { case '+': { int v = xs.at(0); for (int i = 1; i < xs.size(); i++) { v += xs.at(i); } return v; } case '*': { int v = xs.at(0); for (int i = 1; i < xs.size(); i++) { v ...
a.cc: In function 'int main()': a.cc:52:38: error: 'count' is not a member of 'std'; did you mean 'cout'? 52 | int d = std::count(s.begin(), s.end(), '.'); | ^~~~~ | cout
s791359011
p01087
C++
#include<bits/stdc++.h> using namespace std; string s[100]; int n,j; int dfs(int p){ int res=0,o=s[j].size(); if(isdigit(s[j][p]))return s[j][p]-'0'; if(s[j][p]=='+') while(s[j+1].size()>o)j++,res+=dfs(p+1); else{ res=1; while(s[j+1].size()>o)j++,res*=dfs(p+1); } return res; } int main(){ ...
a.cc: In function 'int main()': a.cc:24:11: error: 'i' was not declared in this scope 24 | for(j=i=0;i<100;i++)s[i]=""; | ^ a.cc:25:9: error: 'i' was not declared in this scope 25 | for(i=0;i<n;i++)cin>>s[i]; | ^
s621904301
p01087
C++
def inp(): global n n = int(input()) return n def strinp(): l = 0 s = list(input()) for i in s: if i == '.': l += 1 else: c = i return [l,c] def calc(p): global f l = f[p][0] c = f[p][1] p += 1 if c == '+': ans = 0 for i in range(p,n): if f[i][0] == l: break elif f[i][0] == l+1: ...
a.cc:1:1: error: 'def' does not name a type 1 | def inp(): | ^~~
s061430350
p01087
C++
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 | ^
s874659074
p01087
C++
# ifdef _MSVC_LANG # define _SCL_SECURE_NO_WARNINGS # pragma warning( disable : 0325 ) // inline namespace Error # endif # include <iostream> # include <string> # include <iomanip> # include <cstdio> # include <array> # include <numeric> # include <algorithm> # include <vector> # include <functional> # include <fs...
a.cc:121:178: error: wrong number of template arguments (1, should be 2) 121 | template< template<class ...> class Container, class ... Args, typename = meta::coming::enable_if_t<!std::is_same< typename Container, typename std::basic_string> ::value> > | ...
s515000808
p01087
C++
# ifdef _MSVC_LANG # define _SCL_SECURE_NO_WARNINGS # pragma warning( disable : 0325 ) // inline namespace Error # endif # include <iostream> # include <string> # include <iomanip> # include <cstdio> # include <array> # include <numeric> # include <algorithm> # include <vector> # include <functional> # include <fs...
a.cc:121:178: error: wrong number of template arguments (1, should be 2) 121 | template< template<class ...> class Container, class ... Args, typename = meta::coming::enable_if_t<!std::is_same< typename Container, typename std::basic_string> ::value> > | ...
s801863013
p01087
C++
# ifdef _MSVC_LANG # define _SCL_SECURE_NO_WARNINGS # pragma warning( disable : 0325 ) // inline namespace Error # endif # include <iostream> # include <string> # include <iomanip> # include <cstdio> # include <array> # include <numeric> # include <algorithm> # include <vector> # include <functional> # include <fs...
a.cc:121:178: error: wrong number of template arguments (1, should be 2) 121 | template< template<class ...> class Container, class ... Args, typename = meta::coming::enable_if_t<!std::is_same< typename Container, typename std::basic_string> ::value> > | ...
s503638336
p01087
C++
# ifdef _MSVC_LANG # define _SCL_SECURE_NO_WARNINGS # pragma warning( disable : 0325 ) // inline namespace Error # endif # include <iostream> # include <string> # include <iomanip> # include <cstdio> # include <array> # include <numeric> # include <algorithm> # include <vector> # include <functional> # include <fs...
a.cc:121:178: error: wrong number of template arguments (1, should be 2) 121 | template< template<class ...> class Container, class ... Args, typename = meta::coming::enable_if_t<!std::is_same< typename Container, typename std::basic_string> ::value> > | ...
s594838386
p01087
C++
#include<algorithm> #include<string.h> #include<stdio.h> using namespace std; int suma(int d); int a; char s[100000]; int t(int d){ int ans=1; cin>>s; a--; while(a>=0){ if(strlen(s)<d) break; if(s[d-1]=='*') ans*=t(d+1); else if(s[d-1]=='+') ans*=suma(d+1); else{ ans*=s[d...
a.cc: In function 'int t(int)': a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin>>s; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<stdio.h> +++ |+#include <iostream> 4 | using namespace std;...
s220034832
p01087
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s420539310
p01087
C++
#!/usr/bin/env python from collections import deque import itertools as it import sys import math while True: n = input() lst = [] if n == 0: break if n == 1: num = input() print num continue for loop in range(n): S = raw_input() lst.append((len(S), ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python | ^ a.cc:3:1: error: 'from' does not name a type 3 | from collections import deque | ^~~~
s855640793
p01088
Java
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) using namespace std; int a=0; vector<string>sts; vector<int>ens; int getnum(){ if(sts[a]=="*"){ int num=1; int pe=ens[a]; a++; while(ens[a]==pe){ num*=getnum(); } a++; return num; } ...
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:2: error: illegal character: '#' #define FOR(i,a,b) for(int i=(a);i<(b);i++) ^ Main.java:2: error: class, interface, enum, or record expected...
s145075462
p01088
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s806141528
p01088
C++
#include <stdio.h> #include <Math.h> #include <iostream> #include <vector> #include <list> #include <map> #include <string> using namespace std; int ans_coin, ans_money; int const gohyaku = 0, hyaku = 1, goju = 2, ju = 3, go = 4, ichi = 5; int const val[6] = {500, 100, 50, 10, 5, 1}; int n; vector<int> storeVal; int T...
a.cc:2:10: fatal error: Math.h: No such file or directory 2 | #include <Math.h> | ^~~~~~~~ compilation terminated.
s177657416
p01088
C++
#include <stdio.h> #include <Math.h> #include <iostream> #include <vector> #include <list> #include <map> #include <string> using namespace std; int ans_coin, ans_money; int const gohyaku = 0, hyaku = 1, goju = 2, ju = 3, go = 4, ichi = 5; int const val[6] = {500, 100, 50, 10, 5, 1}; int n; vector<int> storeVal; int T...
a.cc:2:10: fatal error: Math.h: No such file or directory 2 | #include <Math.h> | ^~~~~~~~ compilation terminated.
s061572240
p01088
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; P dp[105][50005]; int p[100]; void Max(P &a,P b){a=max(a,b);} int main(){ int n; while(cin>>n && n){ memset(dp,-1,sizeof(dp)); for(int i=0;i<n;i++)cin>>p[i]; dp[0][0] = P(0,0); for(int i=0;i<n;i++){ for(int j=0;j<50000;j++...
a.cc: In function 'int main()': a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s791320611
p01088
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n,n){ vector<int> p(n); for(int i=0;i<n;i++) cin>>p[i]; const int INF=1e8; vector<vector<pair<int,int>>> dp(n+1,vector<pair<int,int>>(100000,make_pair(-INF,INF))); dp[0][0]=make_pair(0,0); ...
a.cc:42:26: error: 'dp' does not name a type 42 | } dp[i+1][to]=max(dp[i+1][to],make_pair(dp[i][j].first,dp[i][j].second-p[i])); | ^~ a.cc:43:21: error: expected declaration before '}' token 43 | } | ^ a.cc:44:21: ...
s200342197
p01088
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> #include<cstring...
a.cc: In function 'void gya()': a.cc:98:9: error: 'pr' was not declared in this scope; did you mean 'pa'? 98 | pr[0]=1; | ^~ | pa a.cc:102:35: error: 'inv' was not declared in this scope; did you mean 'int'? 102 | for(int i=0;i<100010;i++) inv[i]=beki(pr[i],inf-2); ...
s001249722
p01088
C++
#include <iostream> #include <algorithm> using namespace std; int n,p; pair<int,int> dp[101][50001]; int main() { while (cin>>n && n != 0) { memset(dp,-1,sizeof(dp)); dp[0][0] = pair<int,int>(0,0); for (int i = 0; i < n; i++) { cin>>p; for (int t = 0; t < 500*n; t+...
a.cc: In function 'int main()': a.cc:11:9: error: 'memset' was not declared in this scope 11 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cst...
s110128919
p01089
C++
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i) #define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i) #define each(a,b) for(auto& (a): (b)) #define all(v) (v).begi...
a.cc: In function 'void dfs(int, vvi&, vi&)': a.cc:46:5: error: reference to 'visit' is ambiguous 46 | visit[u] = true; | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80, from a.cc:1: /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<...
s626584095
p01090
C++
#include <iostream> #include <vector> using namespace std; template <int N> struct union_find { int par[N]; union_find() { for (int i = 0; i < N; ++i) par[i] = -1; } int find(int v) { if (par[v] < 0) return v; return par[v] = find(par[v]); } bool unite(int x, int y) { int ...
a.cc: In function 'int solve()': a.cc:61:9: error: 'sort' was not declared in this scope; did you mean 'short'? 61 | sort(begin(edges), end(edges)); | ^~~~ | short
s442946077
p01090
C++
#include <iostream> #include <vector> using namespace std; template <int N> struct union_find { int par[N]; union_find() { for (int i = 0; i < N; ++i) par[i] = -1; } int find(int v) { if (par[v] < 0) return v; return par[v] = find(par[v]); } bool unite(int x, int y) { int ...
a.cc: In function 'std::pair<int, int> kruskal(std::vector<edge>, int)': a.cc:53:5: error: 'sort' was not declared in this scope; did you mean 'short'? 53 | sort(begin(es), end(es)); | ^~~~ | short
s435670476
p01093
Java
import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; /** * Created by ctare on 2017/05/16. */ public class A2016 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Integer[] a = new Integer[n]; for (int ...
Main.java:8: error: class A2016 is public, should be declared in a file named A2016.java public class A2016 { ^ 1 error
s998828771
p01093
Java
import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; /** * Created by ctare on 2017/05/16. */ public class A2016 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); for(;;){ int n = sc.nextInt(); if(n == 0) break; ...
Main.java:8: error: class A2016 is public, should be declared in a file named A2016.java public class A2016 { ^ 1 error
s969872014
p01093
Java
import java.util.*; public class icpc2016_1_Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); // scanner?????????????????°????????? int n = scan.nextInt(); // int???????????°n?????????????????¨?????°????????? int min=1000001; // int?????...
Main.java:2: error: class icpc2016_1_Main is public, should be declared in a file named icpc2016_1_Main.java public class icpc2016_1_Main { ^ 1 error
s371747124
p01093
Java
import java.util.*; public class icpc2016_1_Main { public static void Main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int min=1000001; int data[] = new int [n] for(int i=0;i<n;++i){ data[i]=scan.nextInt(); } Arrays.sort(data); cul(data,n-1,min); System.out.pr...
Main.java:8: error: ';' expected int data[] = new int [n] ^ 1 error
s549985715
p01093
Java
import java.util.*; public class icpc2016_1_Main { public static void Main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int min=1000001; int data[] = new int [n] for(int i=0;i<n;++i){ data[i]=scan.nextInt(); } Arrays.sort(data); cul(data,n-1,min); System.out.pr...
Main.java:8: error: ';' expected int data[] = new int [n] ^ 1 error
s217145826
p01093
Java
import java.util.*; public class icpc2016_1_Main { public static void Main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int min=1000001; int data[] = new int [n]; for(int i=0;i<n;++i){ data[i]=scan.nextInt(); } Arrays.sort(data); cul(data,n-1,min); System.out.p...
Main.java:2: error: class icpc2016_1_Main is public, should be declared in a file named icpc2016_1_Main.java public class icpc2016_1_Main { ^ 1 error
s708368210
p01093
Java
import java.util.Scanner; public class Main { static Scanner sc; public static void main(String[] args) { sc = new Scanner(System.in); // ?????????????§??????? while(true) { int n = Integer.parseInt(GetSubStringLine()[0]); if (n == 0) { break; } ...
Main.java:23: error: ')' or ',' expected min = Math.abs(a[i]-a[j]; ^ 1 error
s755108745
p01093
Java
import java.util.*; public class Main{ public static void main(String args[]) throws Exception{ Scanner sc = new Scanner(System.in); int N = sc.nextInt();sc.nextLine(); while(N!=0){ int[] array = new int[N]; String s = sc.nextLine(); String[] a = s.split(" "...
Main.java:23: error: reached end of file while parsing } ^ 1 error
s065542513
p01093
Java
import java.util.*; public class Main{ public static void main(String args[]) throws Exception{ Scanner sc = new Scanner(System.in); int N = sc.nextInt();sc.nextLine(); while(N!=0){ int[] array = new int[N]; String s = sc.nextLine(); String[] a = s.split(" "...
Main.java:23: error: reached end of file while parsing } ^ 1 error
s847734880
p01093
Java
import java.util.*; public class Main{ public static void main(String args[]) throws Exception{ Scanner sc = new Scanner(System.in); int N = sc.nextInt();sc.nextLine(); while(N!=0){ int[] array = new int[N]; String s = sc.nextLine(); String[] a = s.split(" "...
Main.java:23: error: reached end of file while parsing } ^ 1 error
s049605873
p01093
C
#include <stdio.h> int cul(int d[], int n); int Main(void){ int n,i,min; scanf("%d",&n); int d[n]; for(i=0;i<n;++i){ scanf("%d",&d[i]); } min=cul(d,n); printf("%d\n",min); return 0; } int cul(int d[],int n){ int i,j,min=1000001,num; for(i=0;i<n;++i){ for(j=i;j...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s426295093
p01093
C
#include <stdio.h> int cul(int d[], int n); int Main(void){ int n,i,min; scanf("%d",&n); int d[n]; for(i=0;i<n;++i){ scanf("%d",&d[i]); } min=cul(d,n); printf("%d\n",min); return 0; } int cul(int d[],int n){ int i,j,min=1000001,num; for(i=0;i<n;++i){ for(j=i;j...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s958615006
p01093
C
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner (System.in); int d = 1000000; for(int n = sc.nextInt(); n !=0; n = sc.nextInt()) { int[] score = new int[n]; for(int i = 0;i<n;i++) { score[i] = sc.nextInt(); } for(int i=0; i<n-1;i++...
main.c:1:1: error: unknown type name 'import' 1 | import java.util.Scanner; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.Scanner; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class Main { | ^~...
s089497185
p01093
C
#include <stddio.h> int main(void) { int n,m,min,a[1000]; int i,j,s; while(scanf("%d",&n)){ if(n==0) break; for(i=0;i<n;i++){ scanf("%d",&a[i]); } min=0; for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ s=a[i]-a[j]; if(s<min) ...
main.c:1:10: fatal error: stddio.h: No such file or directory 1 | #include <stddio.h> | ^~~~~~~~~~ compilation terminated.
s676465742
p01093
C
#include <stddio.h> int main(void) { int n,min,a[1000]; int i,j,s; while(scanf("%d",&n)){ if(n==0) break; for(i=0;i<n;i++){ scanf("%d",&a[i]); } min=0; for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ s=a[i]-a[j]; if(s<min) ...
main.c:1:10: fatal error: stddio.h: No such file or directory 1 | #include <stddio.h> | ^~~~~~~~~~ compilation terminated.
s021001684
p01093
C
#include <stdio.h> int main(void) { int n, a[1010]; int i, j, s; while(1){ scanf("%d", &n); if(n==0) { break; } int min=1000000; for(i=0;i<n;i++) { scanf("%d", &a[i]); } for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { s=a[i]-a[j]; if(sa<0) { s*=-...
main.c: In function 'main': main.c:25:8: error: 'sa' undeclared (first use in this function); did you mean 's'? 25 | if(sa<0) | ^~ | s main.c:25:8: note: each undeclared identifier is reported only once for each function it appears in
s410729497
p01093
C++
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s188224065
p01093
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main (){ int n; while(cin>>n && n){ vector<int> v(n); int ans=INT_MAX; for(int i=0;i<n;i++)cin>>v[i]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(i!=j)ans=min(ans,abs(v[i]-v[j])); } } cout<<ans<<endl; } ...
a.cc: In function 'int main()': a.cc:10:25: error: 'INT_MAX' was not declared in this scope 10 | int ans=INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algorithm> ...
s296263909
p01093
C++
#pragma GCC optimize ("O3") #pragma GCC target ("tune=native") #pragma GCC target ("avx") #include <bits/stdc++.h> // 汎用マクロ #define ALL_OF(x) (x).begin(), (x).end() #define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++) #define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++) #define DS...
In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:5: /usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long l...
s087056173
p01093
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,i,a[50000],m=1e7; while(cin>>n,n){ for(i=0;i<n;i++)cin>>a[i]; sort(a,a[n]); for(i=1;i<n;i++)m=min(m,a[i]-a[i-1]); cout<<m; } }
a.cc: In function 'int main()': a.cc:7:21: error: no matching function for call to 'sort(int [50000], int&)' 7 | sort(a,a[n]); | ~~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s198104628
p01093
C++
#include <bits/stdc++.h> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; typedef pair<LL, LL> PLL; #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define EB emplace_ba...
a.cc: In function 'int main()': a.cc:11:26: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]', declared with attribute 'nodiscard' [-Wunused-result] 11 | #define ALL(a) (a).be...
s099968119
p01093
C++
#include <iostream> #include <vector> #include <algorithm> int main() { int n; while (std::cin >> n && n) { std::vector<int> a; int minLength = INT_MAX; //????????????????????\??? for (int i = 0; i < n; i++) { int b; std::cin >> b; a.push_back(b); } std::sort(a.begin(), a.end()); //????°???...
a.cc: In function 'int main()': a.cc:9:33: error: 'INT_MAX' was not declared in this scope 9 | int minLength = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include...
s528452346
p01093
C++
#include <iostream> #include <vector> #include <algorithm> int main() { int n; while (std::cin >> n && n) { std::vector<int> a; int minLength = INT_MAX; //????????????????????\??? for (int i = 0; i < n; i++) { int b; std::cin >> b; a.push_back(b); } std::sort(a.begin(), a.end()); //????°???...
a.cc: In function 'int main()': a.cc:9:33: error: 'INT_MAX' was not declared in this scope 9 | int minLength = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include...
s325431090
p01093
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]; for(int i=;i<n;i++)cin>>a[i]; sort(a,a+n); int p=100000000; for(int i=0;i<n-1;i++)p=min(p,a[i+1]-a[i]); cout<<p<<endl; }
a.cc: In function 'int main()': a.cc:7:13: error: expected primary-expression before ';' token 7 | for(int i=;i<n;i++)cin>>a[i]; | ^
s283720947
p01093
C++
#include <iostream> #include <algorithm> using namespace std; int n, a[1000]; int main() { cin >> n; while (n != 0) { for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int Min = INT32_MAX; for (int i = 0; i < n - 1; i++) { if (a[i + 1] - a[i] < Min) { Min = a[i + 1] - a[i]; } ...
a.cc: In function 'int main()': a.cc:17:27: error: 'INT32_MAX' was not declared in this scope 17 | int Min = INT32_MAX; | ^~~~~~~~~ a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <a...
s337989363
p01093
C++
#include <iostream> #include <algorithm> using namespace std; int n, a[1000]; int main() { while (true) { cin >> n; if(n == 0)break; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int Min = INT32_MAX; for (int i = 0; i < n - 1; i++) { if (a[i + 1] - a[i] < Min) { Min = a[i +...
a.cc: In function 'int main()': a.cc:19:27: error: 'INT32_MAX' was not declared in this scope 19 | int Min = INT32_MAX; | ^~~~~~~~~ a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <a...
s815623841
p01093
C++
#include <iostream> #include <algorithm> using namespace std; int n, a[1000]; int main() { while (true) { cin >> n; if (n == 0)break; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int Min = INT32_MAX; for (int i = 0; i < n - 1; i++) { if (a[i + 1] - a[i] < Min) { Min = a[i ...
a.cc: In function 'int main()': a.cc:19:27: error: 'INT32_MAX' was not declared in this scope 19 | int Min = INT32_MAX; | ^~~~~~~~~ a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <a...
s191224409
p01093
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; while (cin >> n, n) { vector<int> point(n); for (int i = 0; i < n; i++) { cin >> point[i]; } sort(point.begin(), point.end()); int ans = INFINITY; for (int i = 0; i < n; i++) { ans = min(ans...
a.cc: In function 'int main()': a.cc:17:27: error: 'INFINITY' was not declared in this scope 17 | int ans = INFINITY; | ^~~~~~~~
s618771659
p01093
C++
#include <iostream> #include <string> #include <algorithm>] #include <vector> using namespace std; int main() { vector<int> result; while (true) { int n; int a[50000]; cin >> n; if (n == 0) { break; } for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int res = 1000000000; ...
a.cc:3:21: warning: extra tokens at end of #include directive 3 | #include <algorithm>] | ^ a.cc: In function 'int main()': a.cc:35:36: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator...
s853560189
p01093
C++
// // main.cpp // Selection of Participants of an Experiment // // Created by x15071xx on 2017/06/13. // Copyright ?? 2017??´ AIT. All rights reserved. // #include <iostream> #include <vector> using namespace std; int main(int argc, const char * argv[]) { while (1) { int n,i,min=100...
a.cc: In function 'int main(int, const char**)': a.cc:34:9: error: 'sort' was not declared in this scope; did you mean 'short'? 34 | sort(s.begin(), s.end()); | ^~~~ | short
s249631984
p01093
C++
#include<iostream> #include<vector> #include <algorithm> using namespace std; long main(){ long n, tmp; while(cin >> n, n){ vector<long> polong; long min = 1000001; long res; for(long i=0;i<n;i++){ cin >> tmp; polong.push_back(tmp); } sort(polong.begin(),polong.end(),greater<long>()); for(long ...
cc1plus: error: '::main' must return 'int'
s111310175
p01093
C++
#include<bits/stdc++.h> #define reps(i,j,k) for(int i=j;i<k;i++) #define rep(i,j) reps(i,0,j) using namespace std; typedef vector<int> vi; int main(){ int n; while(cin >> n, n){ vi v(n); cin >> v[i]; sort(v.begin(), v.end()); int m = (1<<29); rep(i,n-1){ m = min(m, v[i+1] - v[i]); } cout << m <...
a.cc: In function 'int main()': a.cc:15:26: error: 'i' was not declared in this scope 15 | cin >> v[i]; | ^
s285077343
p01093
C++
using namespace std; using ll=long long; #include <string> #include <vector> #include <cmath> #include <iostream> #include <algorithm> #include <map> #define out(S) cout<<(S)<<endl; #define mod(i) ((i)%(ll)(1000000000 + 7)) ll modpow(ll i, ll j) { ll tmp = 1; while (j) { if (j % 2)tmp = mod(tmp*i); i = mod(i*i); j /= 2...
a.cc:18:1: error: expected unqualified-id before '?' token 18 | ?? | ^
s243901219
p01093
C++
#include<stdio.h> int main(void){ int n,a[1001],i,j,b,c,min; while(1){ scanf_s("%d",&n); min=1000000; if(n==0){ break; } for(i=0;i<n;i++){ scanf_s("%d",&a[[i]); } for(i=0;i<n;i++){ for(j=n-1;j>i;j--){ if(a[j-1]<a[j]){ b=a[j-1];a[j-1]=a[j];a[j]=b; } } } for(i=0;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:7:3: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d",&n); | ^~~~~~~ | scanf a.cc:14:19: error: two consecutive '[' shall only introduce an attribute before '[' token 14 | scanf_s("%d",&a[[i]); | ...
s437132988
p01093
C++
#include<stdio.h> int main(void){ int n,a[1001],i,j,b,c,min; while(1){ scanf("%d",&n); min=1000000; if(n==0){ break; } for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<n;i++){ for(j=n-1;j>i;j--){ if(a[j-1]<a[j]){ b=a[j-1];a[j-1]=a[j];a[j]=b; } } } for(i=0;i<n;i++){ c=a...
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s685062201
p01093
C++
#include<stdio.h> int main(void){ int n,a[1001],i,j,b,c,min; while(1){ scanf("%d",&n); min=1000000; if(n==0){ break; } for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<n-1;i++){ for(j=n-1;j>i;j--){ if(a[j-1]<a[j]){ b=a[j-1];a[j-1]=a[j];a[j]=b; } } } for(i=0;i<n;i++){ c...
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s958211589
p01093
C++
def solve(N): A = list(map(int, input().split())) ans = 1e9 for i in range(N): for j in range(N): if i != j: d = abs(A[i] - A[j]) if ans > d: ans = d print(ans) while True: N = int(input()) if N > 0: solve(N) e...
a.cc:2:1: error: 'def' does not name a type 2 | def solve(N): | ^~~
s696700747
p01093
C++
#include<iostream> #include<cstdlib> using namespace std; int main(){ int n; int a[1000]; while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>a[i]; } int diff=1000000; for(int i=0;i<(n-1);i++){ for(int j=i+1;j<n;j++){ if(diff>abs(a[i]-[j])) diff=abs(a[i]-a[j]); } } ...
a.cc: In lambda function: a.cc:22:53: error: expected '{' before ')' token 22 | if(diff>abs(a[i]-[j])) | ^ a.cc: In function 'int main()': a.cc:22:49: error: no match for 'operator-' (operand types are 'int' and 'main()::<lambd...
s092119631
p01093
C++
#include<iostream> #include<cstdlib> using namespace std; int main(){ while(1){ int n; cin>>n; if(n==0) break: int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int s=1000001; for(int i=0;i<n;i++){ for(int j=0;j<n-1;j++){ if(s>abs(a[i]-a[j])){ s=abs(a[i]-a[j]); } } } cout<<s<<e...
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before ':' token 10 | break: | ^ | ; a.cc:10:30: error: expected primary-expression before ':' token a.cc:13:30: error: 'a' was not declared in this scope 1...
s852616402
p01093
C++
#include<iostream> #include<cstdlib> using namespace std; int main(){ while(1){ int n; cin>>n; if(n==0) break: int a[1000]; for(int i=0;i<n;i++){ cin>>a[i]; } int s=1000001; for(int i=0;i<n;i++){ for(int j=0;j<n-1;j++){ if(s>abs(a[i]-a[j])){ s=abs(a[i]-a[j]); } } } cout<<s...
a.cc: In function 'int main()': a.cc:10:30: error: expected ';' before ':' token 10 | break: | ^ | ; a.cc:10:30: error: expected primary-expression before ':' token a.cc:13:30: error: 'a' was not declared in this scope 1...
s767194347
p01093
C++
#include<iostream> #include<cstdlib> using namespace std; int main(){ while(1){ int n; cin>>n; if(n==0){ break; } int a[1000]; for(int i=0;i<n;i++){ cin>>a[i]; } int dif=10000000; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ int =abs(a[i]-a[j]); if(d<dif){ dif=d; }...
a.cc: In function 'int main()': a.cc:21:37: error: expected unqualified-id before '=' token 21 | int =abs(a[i]-a[j]); | ^ a.cc:22:36: error: 'd' was not declared in this scope 22 | if(d<dif){ | ...
s478870840
p01093
C++
#include "stdafx.h" #include <iostream> #include <cstdlib> using namespace std; int main() { int n = 1; while (cin >> n) { int ans = 1000001; if (n == 0) break; int a[1000]; for (int i = 0;i < n;i++) { cin >> a[i]; } for (int i = 0;i < n - 1;i++) { for (int j = i + 1;j < n;j++) { if (ans ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s563993720
p01093
C++
void main(){ import std.stdio, std.string, std.conv, std.algorithm; while(1){ int n; rd(n); if(n==0) break; auto a=readln.split.to!(int[]); sort(a); int mn=1_000_000_000; foreach(i; 0..(n-1)) mn=min(mn, a[i+1]-a[i]); writeln(mn); } } void rd(T...)(ref T x){ import std.stdio, std.stri...
a.cc:9:16: error: too many decimal points in number 9 | foreach(i; 0..(n-1)) mn=min(mn, a[i+1]-a[i]); | ^~~ a.cc:1:1: error: '::main' must return 'int' 1 | void main(){ | ^~~~ a.cc: In function 'int main()': a.cc:2:3: error: 'import' was not declared in this scope 2 | import...
s290654601
p01093
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n; while(cin >> n |n){ long long a[n],i,ans=1e7; for(i=0;i<n;i++)cin >> a[i]; sort(a,a+n); for(i=0;i<n-1;i++)ans=min(ans,a[i+1]-a[i]); cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: no match for 'operator|' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 8 | while(cin >> n |n){ | ~~~~~~~~ ^~ | | | | | int | std::bas...
s721933212
p01093
C++
#include <bits/stdc++.h> using namespace std; #define INF_LL (int64)1e18 #define INF (int32)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using int32 = int_fast32_t; using uint32 = uint_fast32_t; u...
a.cc: In function 'int main()': a.cc:33:24: error: 'n' was not declared in this scope 33 | REP(i, n-1) res = min(res, x[i+1]-x[i]); | ^ a.cc:6:38: note: in definition of macro 'REP' 6 | #define REP(i, n) for(int i = 0;i < (n);i++) | ...
s240077836
p01093
C++
int main(){ int a[1001]; int c[1001]; int b, mn; mn = 1000000; while(1){ cin >> b; if(b == 0) break; for(int i=0;i<b;i++){ cin >> a[i]; } for(int j=0;j<b+1;j++){ for(int i=0;i<b;i++){ if(a[i] < a[i+1]) swap(a[i],a[i+1]); } } for(int i=0;i<b-1;i++){ c...
a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope 12 | cin >> b; | ^~~ a.cc:21:27: error: 'swap' was not declared in this scope 21 | if(a[i] < a[i+1]) swap(a[i],a[i+1]); | ^~~~ a.cc:32:5: error: 'cout' was not declared in t...
s005522423
p01093
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); int ans = 1 << 20A; for (int i = 0; i + 1 < n; i++) { ans = mi...
a.cc: In function 'int main()': a.cc:12:24: error: unable to find numeric literal operator 'operator""A' 12 | int ans = 1 << 20A; | ^~~
s699448174
p01093
C++
import java.util.*; public class Main{ public static void main(String args[]) throws Exception{ Scanner sc = new Scanner(System.in); int N = sc.nextInt();sc.nextLine(); while(N!=0){ int[] array = new int[N]; String s = sc.nextLine(); Strin...
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:3: error: expected unqualified-id before 'public' 2 | public class Main{ | ^~~~~~
s604961487
p01093
C++
#include<iostream> #include<algorithm> #define SEISEKI 1000001 using namespace std; int main() { while (1) { int n; int ans=SEISEKI; cin >> n; int a[1001]; if (n == 0)break; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a[0], a[n-1]); //昇順 for (int i = 0; i< n; i++) { ans = min(ans,a[i...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/inclu...
s253544924
p01093
C++
#include<iostream> #include<algorithm> #define SEISEKI 10000000 using namespace std; int main() { while (1) { int n; int ans=SEISEKI; cin >> n; int a[1001]; if (n == 0)break; for (int i = 0; i < n; i++) { cin >> a[i]; } int ans = a[1] - a[0]; sort(a, a+n); //昇順 for (int i = 0; i<n; i++) { ...
a.cc: In function 'int main()': a.cc:19:21: error: redeclaration of 'int ans' 19 | int ans = a[1] - a[0]; | ^~~ a.cc:10:21: note: 'int ans' previously declared here 10 | int ans=SEISEKI; | ^~~
s004547349
p01094
Java
import java.util.Arrays; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; SortMap[] list = new SortMap[26]; ...
Main.java:4: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s931462518
p01094
C
#include <stdio.h> int main(void){ int num, sum[30], first, second; char ch[101]; while(1){ scanf("%d", &num); if(num == 0) break; for(int i=0; i<num; i++){ scanf(" %c", &ch[i]); ch[i] -= 'A'; } for(int i=0; i<30; i++){ sum[i] =0; } first = int(ch[0]); second = 29; for(int i=0; i<num...
main.c: In function 'main': main.c:21:25: error: expected expression before 'int' 21 | first = int(ch[0]); | ^~~ main.c:27:41: error: expected expression before 'int' 27 | first = int(ch[i]); | ...
s076244196
p01094
C
#include <stdio.h> int main(void){ int num, sum[30], first, second; char ch[101]; while(1){ scanf("%d", &num); if(num == 0) break; for(int i=0; i<num; i++){ scanf(" %c", &ch[i]); ch[i] -= 'A'; } for(int i=0; i<30; i++){ sum[i] =0; } first = ch[0]; second = 29; for(int i=0; i<num; i++){ ...
main.c: In function 'main': main.c:26:42: error: expected expression before 'int' 26 | second = int(ch[i]); | ^~~
s998721960
p01094
C
#include <stdio.h> int main(void){ int num, sum[30], first, second; char ch[101]; while(1){ scanf("%d", &num); if(num == 0) break; for(int i=0; i<num; i++){ scanf(" %c", &ch[i]); ch[i] -= 'A'; } for(int i=0; i<30; i++){ sum[i] =0; } first = int(ch[0]); second = 29; for(int i=0; i<num; ...
main.c: In function 'main': main.c:19:25: error: expected expression before 'int' 19 | first = int(ch[0]); | ^~~ main.c:25:41: error: expected expression before 'int' 25 | first = int(ch[i]); | ...
s898106191
p01094
C++
#include <iostream> #include <vector> #include <string> using namespace std; struct Pair{ int vote=0; char name; }; bool cmp(Pair p1,Pair p2){ return p1.vote>p2.vote; } int main (){ int n; while(cin>>n && n){ bool isTIE=true; vector<Pair> v(26); for(int i=0;i<26;i++)v[i].name='A'+i; for(int i=0;i<n;i...
a.cc: In function 'int main()': a.cc:25:25: error: 'sort' was not declared in this scope; did you mean 'short'? 25 | sort(temp_v.begin(),temp_v.end(),cmp); | ^~~~ | short
s467794141
p01094
C++
#include<iostream> using namespace std; int main(){ int n; while(true){ cin>>n; if(n==0){break;} int table[26]={0}; char cha[n+1],m_cha[2]; for(int i=0;i<n;i++)cin>>chara[i]; for(int t=0;t<n;t++){ table[cha[t]-'A']++; if(table[cha[t]-'A']...
a.cc: In function 'int main()': a.cc:12:34: error: 'chara' was not declared in this scope; did you mean 'char'? 12 | for(int i=0;i<n;i++)cin>>chara[i]; | ^~~~~ | char a.cc:15:34: error: 'maxi1' was not declared in this scope 15 ...
s851986709
p01094
C++
#include<iostream> using namespace std; int main(){ int n; while(true){ cin>>n; if(n==0){break;} int table[26]={0},max1=0,max2=0; char cha[n+1],m_cha[2]; for(int i=0;i<n;i++)cin>>chara[i]; for(int t=0;t<n;t++){ table[cha[t]-'A']++; if(tabl...
a.cc: In function 'int main()': a.cc:11:34: error: 'chara' was not declared in this scope; did you mean 'char'? 11 | for(int i=0;i<n;i++)cin>>chara[i]; | ^~~~~ | char
s724004833
p01094
C++
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var arr=input.trim().split("\n"); while (true) { var n = arr.shift() - 0; if (n == 0) break; var a = arr.shift().split(" "); var flag = false; var obj = {}; for (var i = 0; i < n; i++) { obj[a[i]] = obj[a[i]] + 1 || 1; var s = [...
a.cc:1:21: warning: multi-character character constant [-Wmultichar] 1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8'); | ^~~~ a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 1 | var input = require('fs').readFileSync('/dev/st...
s745264641
p01094
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <set> #include <map> using namespace std; int main() { while(true) { map<string, int> mp; map<string, int> mpp; vector<string> list; string str; int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> str; list.em...
a.cc: In function 'int main()': a.cc:37:36: error: invalid use of member function 'std::map<std::__cxx11::basic_string<char>, int>::begin' (did you forget the '()' ?) 37 | cout << mp.begin->first << " " << n / 2 + 1 << endl; | ~~~^~~~~
s680433433
p01094
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <set> #include <map> using namespace std; int main() { while(true) { map<string, int> mp; map<string, int> mpp; vector<string> list; string str; int n; cin >> n; for (int i = 0; i < n; ++i) { cin >> str; list.emp...
a.cc: In function 'int main()': a.cc:35:36: error: invalid use of member function 'std::map<std::__cxx11::basic_string<char>, int>::begin' (did you forget the '()' ?) 35 | cout << mp.begin->first << " " << n / 2 + 1 << endl; | ~~~^~~~~
s075774424
p01094
C++
#include <iostream> #include <vector> #include <map> using namespace std; typedef map<string, int> M; int main() { int n, t, f; string c, ans, first; vector<int> v; while(cin >> n, n){ M m; t = 0; f = 1; for (int i = 0; i < n; ++i){ cin >> c; m[c] += 1; v.erase(v.begin(), v.en...
a.cc: In function 'int main()': a.cc:26:7: error: 'sort' was not declared in this scope; did you mean 'short'? 26 | sort(v.begin(), v.end()); | ^~~~ | short
s951686076
p01094
C++
#include <stdio.h> #include <algorithm> #include <vector> #include <iostream> #include <string> using namespace std; #define pb push_back #define mp make_pair typedef pair<int,int> P; int n,c[26]; string t[105]; int main(){ while(1){ cin >> n; if(n==0) return 0; memset(c,0,sizeof(c)); for(int i=1;i<=n;i++) cin >...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(c,0,sizeof(c)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <iostream> +++ |+...
s795518610
p01094
C++
#include <stdio.h> #include <algorithm> #include <vector> #include <iostream> #include <string> using namespace std; #define pb push_back #define mp make_pair typedef pair<int,int> P; int n,c[26]; string t[105]; int main(){ while(1){ cin >> n; if(n==0) return 0; memset(c,0,sizeof(c)); for(int i=1;i<=n;i++) cin >...
a.cc: In function 'int main()': a.cc:15:17: error: 'memset' was not declared in this scope 15 | memset(c,0,sizeof(c)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <iostream> +++ |+...
s372450313
p01094
C++
#include <stdio.h> #include <algorithm> #include <vector> #include <iostream> #include <string> #include <stdlib.h> using namespace std; #define pb push_back #define mp make_pair typedef pair<int,int> P; int n,c[26]; string t[105]; int main(){ while(1){ cin >> n; if(n==0) return 0; memset(c,0,sizeof(c)); for(int...
a.cc: In function 'int main()': a.cc:16:17: error: 'memset' was not declared in this scope 16 | memset(c,0,sizeof(c)); | ^~~~~~ a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <stdlib.h> +++ |+...
s827631594
p01094
C++
#include<iostream> #include<algorithm> using namespace std; struct topnano{char a; int t;}; int main(){ int n,k=1; while(cin>>n){ if(n==0){break;} char c[n],al[30]; cin>>c[0]; al[0]=c[0]; for(int i=1;i<n;i++){ cin>>c[i]; for(int j=0;j<k;j++){ ...
a.cc: In function 'int main()': a.cc:50:41: error: 'ichi' was not declared in this scope; did you mean 'ichii'? 50 | cout<<ichii.a<<" "<<ichi.t+1<<endl; | ^~~~ | ichii a.cc:54:24: error: 'chii' was not dec...
s805257595
p01094
C++
#include<iostream> #include<algorithm> using namespace std; struct topnano{char a; int t;}; int main(){ int n,k=1; while(cin>>n){ if(n==0){break;} char c[n],al[30]; cin>>c[0]; al[0]=c[0]; for(int i=1;i<n;i++){ cin>>c[i]; for(int j=0;j<k;j++){ ...
a.cc: In function 'int main()': a.cc:50:41: error: 'ichi' was not declared in this scope; did you mean 'ichii'? 50 | cout<<ichii.a<<" "<<ichi.t+1<<endl; | ^~~~ | ichii a.cc:54:24: error: 'chii' was not dec...
s554957504
p01094
C++
#include <iostream> using namespace std; int main(){ while(1){ int n; cin>>n; if(n == 0) break; char c[100]; for(int i=0; i<n; i++){ cin>>c[i]; } int cnt[26] = 0; for(int i=0; i<n; i++){ cnt[(int)(c[i]-'A')]++; int max1=-1; int max2 = -1; for(int j=0; j<26; j++){ if(...
a.cc: In function 'int main()': a.cc:16:31: error: array must be initialized with a brace-enclosed initializer 16 | int cnt[26] = 0; | ^ a.cc:33:32: error: expected primary-expression before ';' token 33 | for(int j=~; j<26; j++){ | ...
s613491234
p01094
C++
// ConsoleApplication5.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // //???????¢?????????????????????§j?????????????????? #include "stdafx.h" #include <iostream> using namespace std; int main() { while (true) { int n; cin >> n; if (n == 0) break; char...
a.cc:8:10: fatal error: stdafx.h: No such file or directory 8 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s309236360
p01094
C++
#include<iostream> using namespace std; int main(){ while(1){ int n; cin>>n; char c[100]; for(int i=0;i<n;i++){ cin>>c[i]; } int cnt[26]={0}; for(int i=0;i<n;i++){ cnt[(int)(c[i]-'A')]++; int max1=-1; int max2=-1; for(int j=;j<26;j++){ if(cnt[j]>max1){ max2=max1; m...
a.cc: In function 'int main()': a.cc:22:35: error: expected primary-expression before ';' token 22 | for(int j=;j<26;j++){ | ^
s593919250
p01094
C++
#include<iostream> using namespace std; int main(){ while(1){ int n; cin>>n; if(n==0){break;} char c[1000]; for(int i=0;i<n;i++){ cin>>c[i]; } int cnt[26]={0}; for(int i=0;i<n;i++){ cnt[(int)(c[i]-'A')]++; int max1=-1; int max2=-1; for(int j=0;j<26;j++){ if(cnt[j]>max1){ max2=max1; max1=cnt...
a.cc: In function 'int main()': a.cc:34:25: error: 'j' was not declared in this scope 34 | if(max1-max2>n-(j+1)){ | ^
s495279464
p01094
C++
#include<iostream> using namespace std; int main(){ while(true){ int n; cin>>n; if(n==0) break; char c[100]; for(int i=0;i<n;i++){ cin>>c[i]; } int cnt[26]=[0]; for(int i=0;i<n;i++){ cnt[(int)(c[i]-'A')]++; int max1 =-1; int max2 =-1; for(int j=0;j<26;j++){ ...
a.cc: In function 'int main()': a.cc:19:30: error: expected identifier before numeric constant 19 | int cnt[26]=[0]; | ^ a.cc: In lambda function: a.cc:19:32: error: expected '{' before ';' token 19 | int cnt[26]=[0]; | ...
s512305655
p01094
C++
#include <iostream> using namespace std; int main() { while (true) { int n; cin >> n; if (n == 0) break; char c[100]; for (int i = 0;i < n;i++) { cin >> c[i]; } int cnt[26] = { 0 }; for (int i = 0;i < n;i++) { cnt[(int)(c[i] - 'A')]++; int max1 = -1; int max2 = -2; for (int j = ...
a.cc: In function 'int main()': a.cc:48:10: error: expected '}' at end of input 48 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s770303094
p01094
C++
#include "iostream" using namespace std; int main(){ while(true){ int n; cin>>n; if(n==0) break; char c[100]; for (int i = 0; i < n; i++) { cin>>c[i]; } int cnt[26]=[0]; for (int i = 0; i < n; i++) { cit[(int)(c[i]-'A')]++; int max1=-1; i...
a.cc: In function 'int main()': a.cc:15:19: error: expected identifier before numeric constant 15 | int cnt[26]=[0]; | ^ a.cc: In lambda function: a.cc:15:21: error: expected '{' before ';' token 15 | int cnt[26]=[0]; | ^ a.cc: In function 'int main()': ...