submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s642959517 | p00028 | C++ | #inlcude <stdio.h>
int main(){
int d[100];
int maximize[100];
int buf;
while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
int buff = 0;
for( int i = 0;i < 100;i++ ){
if( d[i] > buff ) buff = d[i];
}
for( int i = 0;i < 100;i++ ){
if( d[i] >= buff ) printf( "%d\n",i+1 );
... | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <stdio.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:8:12: error: 'scanf' was not declared in this scope
8 | while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
| ^~~~~
a.c... |
s525084385 | p00028 | C++ | #inlcude <stdio.h>
#include <stdlib.h>
int main(){
int d[100];
int maximize[100];
int buf;
while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
int buff = 0;
for( int i = 0;i < 100;i++ ){
if( d[i] > buff ) buff = d[i];
}
for( int i = 0;i < 100;i++ ){
if( d[i] >= buff ) pri... | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <stdio.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:9:12: error: 'scanf' was not declared in this scope
9 | while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
| ^~~~~
a.c... |
s599930418 | p00028 | C++ | #inlcude <stdio.h>
#include <stdlib.h>
int main(){
int d[100];
int maximize[100];
int buf;
while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
int buff = 0;
for( int i = 0;i < 100;i++ ){
if( d[i] > buff ) buff = d[i];
}
for( int i = 0;i < 100;i++ ){
if( d[i] >= buff ) pri... | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <stdio.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:9:12: error: 'scanf' was not declared in this scope
9 | while( scanf( "%d",&buf ) != EOF ) d[buf-1]++;
| ^~~~~
a.c... |
s928772057 | p00029 | Java | import java.util.Scanner;
public class J0029 {
public static void main(String[] args) {
int i=0;
String[] s = new String[1000];
int[] count = new int[1000];
Scanner sc = new Scanner(System.in);
while( sc.hasNext() ){
boolean flag=true;
String tmp = sc.next();
if(i==0){
s[i]=tmp;
coun... | Main.java:3: error: class J0029 is public, should be declared in a file named J0029.java
public class J0029 {
^
1 error
|
s757226515 | p00029 | Java | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] words=br.readLine().split(" ");
Hashmap<String,Integer> map=new Hashmap<String,Integer>();
int occured=0;
String occuredword="";
... | Main.java:18: error: ';' expected
map.put(word,map.get(word)+1)
^
Main.java:29: error: reached end of file while parsing
}
^
2 errors
|
s565249356 | p00029 | Java | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] words=br.readLine().split(" ");
Hashmap<String,Integer> map=new Hashmap<String,Integer>();
int occured=0;
String occuredword="";
... | Main.java:8: error: cannot find symbol
Hashmap<String,Integer> map=new Hashmap<String,Integer>();
^
symbol: class Hashmap
location: class Main
Main.java:8: error: cannot find symbol
Hashmap<String,Integer> map=new Hashmap<String,Integer>();
^
symbol: class Hashmap
location: c... |
s103203969 | p00029 | Java | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] words=br.readLine().split(" ");
HashMap<String,Integer> map=new HashMap<String,Integer>();
int occured=0;
String occuredword="";
... | Main.java:14: error: cannot find symbol
if(!map.containskey(word)){
^
symbol: method containskey(String)
location: variable map of type HashMap<String,Integer>
Main.java:21: error: cannot find symbol
ocuured=map.get(word);
^
symbol: variable ocuured
location: class Main
Main.java:22: error: cannot fi... |
s062553566 | p00029 | Java | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String[] words=br.readLine().split(" ");
HashMap<String,Integer> map=new HashMap<String,Integer>();
int maxoccured=0;
String maxoccuredwor... | Main.java:29: error: ')' or ',' expected
System.out.println(maxoccuredword+" "+maxlengthword
^
1 error
|
s128351980 | p00029 | Java | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try {
sc = new Scanner(System.in);
while (sc.hasNext()) {
String sentence = sc.next();
//????????????????????????
}
// ?... | Main.java:49: error: <identifier> expected
public String
^
1 error
|
s459570518 | p00029 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try ... | Main.java:80: error: reached end of file while parsing
}
^
1 error
|
s154223297 | p00029 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try ... | Main.java:80: error: reached end of file while parsing
}
^
1 error
|
s161498512 | p00029 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
String line = scan.nextLine();
String[] words = line.split(" ");
int len = words.length;
int[] counts = new int[len];
int longest = 0;
int max = 0;
String sMax = ... | Main.java:17: error: cannot find symbol
if(words[i].length() > logest){
^
symbol: variable logest
location: class Main
Main.java:18: error: cannot find symbol
logest = words[i].length();
^
symbol: variable logest
location: class Main
2 errors
|
s279500402 | p00029 | Java | import sun.java2d.xr.MutableInteger;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
final Map<String, MutableInteger> map = new HashMap<>();
try (Scanner scanner = new Scanner(System.in)) {
while (... | Main.java:1: error: package sun.java2d.xr is not visible
import sun.java2d.xr.MutableInteger;
^
(package sun.java2d.xr is declared in module java.desktop, which does not export it)
1 error
|
s812788602 | p00029 | Java | import java.util.Scanner;
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
Map<String,Integer> h = new HashMap<String,Integer>();
String a[] = new String[1000];
int I = 0;
int maxlength = 0;
String maxleng = "";
while(sc.hasNext()){
... | Main.java:8: error: cannot find symbol
Map<String,Integer> h = new HashMap<String,Integer>();
^
symbol: class Map
location: class Main
Main.java:8: error: cannot find symbol
Map<String,Integer> h = new HashMap<String,Integer>();
^
symbol: class HashMap
location: class Mai... |
s155672290 | p00029 | Java | mport java.util.*;
import java.util.Map.Entry;
public class Main {
static Scanner sc = new Scanner(System.in);
static Map<String, Integer> map;
public static void main(String[] args) {
read();
solve();
}
static void read() {
map = new HashMap<String ,Integer>();
while(sc.hasNext()) {
String str = sc.n... | Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Map.Entry;
^
2 errors
|
s376041590 | p00029 | Java | import java.util.*;
import java.util.Map.Entry;
public class EnglishSentence{
static Scanner sc = new Scanner(System.in);
static Map<String, Integer> map = new HashMap<String, Integer>();
// main\bh----------------------------------------------------------------
public static void main(String[] args){
rea... | Main.java:4: error: class EnglishSentence is public, should be declared in a file named EnglishSentence.java
public class EnglishSentence{
^
1 error
|
s472036185 | p00029 | Java | import java.util.*;
import java.util.Map.Entry;
public class EnglishSentence{
static Scanner sc = new Scanner(System.in);
static Map<String, Integer> map = new HashMap<String, Integer>();
// main\bh----------------------------------------------------------------
public static void main(String[] args){
rea... | Main.java:4: error: class EnglishSentence is public, should be declared in a file named EnglishSentence.java
public class EnglishSentence{
^
1 error
|
s385703251 | p00029 | Java | import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
String[] words = sc.nextLine().split(" ");
TreeMap<String, Integer> dic = new TreeMap<String, Integer>();
String mode = "", longest = "";
int max = 0, maxlen = 0;
for(int i = 0; i ... | Main.java:31: error: reached end of file while parsing
}
^
1 error
|
s358065728 | p00029 | Java | import java.util.*;
public class Main2 {
HashMap<String, Integer> word;
Scanner sc;
void run() {
sc = new Scanner(System.in);
word = new HashMap<String, Integer>();
while (sc.hasNext()) {
String[] words = sc.next().split(" ");
for (String str : words) {
if (!word.containsKey(str))
word.put(str,... | Main.java:2: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s288396150 | p00029 | Java | #include <stdio.h>
int main(int argc,char* argv[]){
int mode[100];
int num;
int i;
int max = 0;
for(i = 0;i < 100;i++){
mode[i] = 0;
}
while(scanf("%d",&num) != EOF){
mode[num-1]++;
}
for(i = 0;i < 100;i++){
if(mode[i] > max){
max = mode[i];
}
}
for(i = 0;i < 100... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int num;
^
(use --enable-preview to enable unnamed classes)
Main.java:... |
s403799353 | p00029 | Java |
import java.util.Scanner;
public class Main {
private static String[] str;
public static void main(String[] args) {
setInput();
System.out.println(str[getIndexMaxSameWords()] + " " + str[getIndexLongestWord()]);
}
public static void setInput(){
String input = getLine();
str = input.split(" ");
}
p... | Main.java:61: error: cannot find symbol
EnglishSentence.str = str;
^
symbol: variable EnglishSentence
location: class Main
1 error
|
s623687206 | p00029 | Java | package Vol000;
import java.util.Arrays;
import java.util.Scanner;
public class AOJ0_29
{
public static void main(String atg[])
{
Scanner sc = new Scanner(System.in);
String s[] = new String[2002];
int index = 0;
while(sc.hasNext())
{
String str = sc.next();
s[index] = str;
index++;
}
int ... | Main.java:5: error: class AOJ0_29 is public, should be declared in a file named AOJ0_29.java
public class AOJ0_29
^
1 error
|
s295837764 | p00029 | Java | #include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<string, int> P;
bool pairCompare(const P& firstElof, const P& secondElof)
{
return firstElof.second > secondElof.second;
}
int main(void)
{
string s, m;
vector<P> v;
while (cin >> s) {
if (m.size() ... | Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <string.h>
^
Main.java:3: error: illegal character: '#'
#include <vector>
^
Main.java:4: error: illegal character: '#'
#include <algorithm>
^
Main.java:7: error: class, interface, enum, or record expecte... |
s652228996 | p00029 | C | #include <iostream>
#include <string>
using namespace std;
int main(){
string sent;
string word[500];
int a[500]={};
int i,j,k,l;
int n,m,len;
i=0;
while(cin>>sent){
if(i==0){
word[0]=sent;
a[0]++;
i++;
len=sent.size();
n=0;
}
else {
if(len<sent.size()){
len=sent.size();
n=i;
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s649850211 | p00029 | C | #include <iostream>
#include <string>
using namespace std;
int main(){
string sent;
string word[500];
int a[500]={};
int i,j,k,l;
int n,m,len;
i=0;
while(cin>>sent){
if(i==0){
word[0]=sent;
a[0]++;
i++;
len=sent.size();
n=0;
}
else {
if(len<sent.size()){
len=sent.size();
n=i;
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s553801771 | p00029 | C | #include <stdio.h>
#include <string.h>
int main(void){
char str[1000][50], max[50];
int len = 0, len1 = 0, n=0, cnt, mfreq = 0;
while(scanf("%s", str[n]) != EOF){
len = strlen(str[n]);
if(len1 < len){
len1 = len;
strcpy(max, str[n]);
}
n++;
}
... | main.c: In function 'main':
main.c:16:9: error: 'i' undeclared (first use in this function)
16 | for(i=0; i < n; i++){
| ^
main.c:16:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:16: error: 'strtemp' undeclared (first use in this function); did ... |
s331685183 | p00029 | C | #include <stdio.h>
#include <string.h>
int main(){
char str[1000][50], max[50];
int len = 0, len1 = 0, n=0, cnt = 0, mfreq = 0, i = 0, J = 0;
while(scanf("%s", str[n]) != EOF){
len = strlen(str[n]);
if(len1 < len){
len1 = len;
strcpy(max, str[n]);
}
... | main.c: In function 'main':
main.c:18:16: error: 'strtemp' undeclared (first use in this function); did you mean 'strsep'?
18 | strcpy(strtemp, str[i]);
| ^~~~~~~
| strsep
main.c:18:16: note: each undeclared identifier is reported only once for each function it appea... |
s108623275 | p00029 | C | #include<stdio.h>
#include<string.h>
int main(void){
char s[1100];
char x[1000][50];
int i, j, n, len;
int max, size;
int a, b;
int count;
gets(s);
n=0;
len=strlen(s);
i=j=0;
while(i<len){
x[n][j]=s[i];
i++;
j++;
if(s[i]==' '){
i++;
n++;
j=0;
}
}
n+... | main.c: In function 'main':
main.c:16:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
16 | gets(s);
| ^~~~
| fgets
|
s103870289 | p00029 | C | import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)){
// while(sc.hasNextLine()){
//
// String s = sc.nextLine();
// if(s.equals("")) break;
//
// int JOI=0;
// int IOI=0;
// for(int i=0;i<s.length... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.HashMap;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.HashMap;
| ^
main.c:2:1: error: unknown type name 'import'
2 | import java.util.Scanner;
... |
s566611749 | p00029 | C | main(){
int i,n=0,q=0,c[512],a=0,b=0;
char s[1024],t[512][32],*p;
fgets(s,1024,stdin);
for(;;){
p=strchr(s+q,' ');
if(!p)
p=s+strlen(s)-1;
strncpy(t[n],s+q,p-s-q);
for(i=0;i<n;i++)
if(strcmp(t[i],t[n])==0){
c[i]++;
break;
}
if(i==n){
c[i]=1;
n++;
}
q=p... | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
4 | fgets(s,1024,stdin);
| ^~~~~
main.c:4:16: error: 'stdin' undeclared (first use in thi... |
s086728154 | p00029 | C | d[99],*p,*f=d,*l,i,T;main(t,w){for(;i=~scanf("%as",&w)?:!printf("%s %s\n",*f,*l);t>T?T=t,l=p:0){for(p=d;*p&&strcmp(*p,w);p+=2);t=strlen(*p=w);++p[1]>f[1]?f=p:0;}} | main.c:1:1: warning: data definition has no type or storage class
1 | d[99],*p,*f=d,*l,i,T;main(t,w){for(;i=~scanf("%as",&w)?:!printf("%s %s\n",*f,*l);t>T?T=t,l=p:0){for(p=d;*p&&strcmp(*p,w);p+=2);t=strlen(*p=w);++p[1]>f[1]?f=p:0;}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'd' [-Wimplic... |
s868174307 | p00029 | C | #include<iostream>
#include<map>
using namespace std;
map<string,int>mp;
string ans,s,amins;
int maxn=0,minn=0;
int main()
{
while(cin>>s)
{
mp[s]++;
if(mp[s]>maxn)
{
maxn=mp[s];
ans=s;
}
if(s.size()>minn)
{
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s209737126 | p00029 | C | sent=raw_input()
words=sent.split()
max_f,freq_w=0,""
max_len,len_w=0,""
for word in words:
if max_f<words.count(word):
freq_w=word
max_f=words.count(word)
if max_len<len(word):
len_w=word
max_len=len(word)
print "%s %s"%(freq_w,len_w) | main.c:1:1: warning: data definition has no type or storage class
1 | sent=raw_input()
| ^~~~
main.c:1:1: error: type defaults to 'int' in declaration of 'sent' [-Wimplicit-int]
main.c:1:6: error: implicit declaration of function 'raw_input' [-Wimplicit-function-declaration]
1 | sent=raw_input()
| ... |
s229524960 | p00029 | C | #include<stdio.h>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>#include<stdio.h>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>
typedef struct wordtree{
struct wordtree *next;
struct wordtree *prev;
char *txt;
int t_num;
int t_size;
}wordtree;
wordtree *initTree(char *msg,int num,int size){
... | main.c:4:19: warning: extra tokens at end of #include directive
4 | #include<stdlib.h>#include<stdio.h>
| ^
main.c:28:11: warning: data definition has no type or storage class
28 | int cnt=0;often=0;length=0;
| ^~~~~
main.c:28:11: error: type defaults to 'int' in declarati... |
s647939382 | p00029 | C | #include <stdio>
#include <string>
char str[50];
char word[1000][50];
int count[1000];
int main(void)
{
int i, j, ind, ind2;
int c, len = 0;
i = 0;
while (scanf("%s", str) != EOF){
c = 1;
for (j = 0; j < i; j++){
if (strcmp(str, word[j]) == 0){
count[j]++;
c = 0;
}
}
if (c == 1){... | main.c:1:10: fatal error: stdio: No such file or directory
1 | #include <stdio>
| ^~~~~~~
compilation terminated.
|
s074929529 | p00029 | C | #include <stdio.h>
#include <conio.h>
#include <string.h>
int main(void)
{
char str[1024][64];
int i, j;
int ls;
int lsl;
int sl;
int mus;
int stri[1024];
for (i = 0; i < 1024; i++){
stri[i] = 0;
}
i = 0;
ls = 0;
lsl = 0;
while (scanf("%s", str[i]) != EOF){
sl = strlen(str[i]);
if (sl > lsl){
l... | main.c:2:10: fatal error: conio.h: No such file or directory
2 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s604576260 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
using namespace std;
map<string, int> table;
int main()
{
string word, frequent, longest;
size_t N = 0;
while (cin >> word)
{
table[word]++;
if (table[word] > N)frequest = word;
if (word.size() > longest.size())longest = word;
}
cout >> frequent >> longes... | a.cc: In function 'int main()':
a.cc:13:37: error: 'frequest' was not declared in this scope; did you mean 'frequent'?
13 | if (table[word] > N)frequest = word;
| ^~~~~~~~
| frequent
a.cc:16:14: error: no match for 'o... |
s585164216 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
using namespace std;
map<string, int> table;
int main()
{
string word, frequent, longest;
size_t N = 0;
while (cin >> word)
{
table[word]++;
if (table[word] > N)frequest = word;
if (word.size() > longest.size())longest = word;
}
cout >> frequent >> longes... | a.cc: In function 'int main()':
a.cc:13:37: error: 'frequest' was not declared in this scope; did you mean 'frequent'?
13 | if (table[word] > N)frequest = word;
| ^~~~~~~~
| frequent
a.cc:16:14: error: no match for 'o... |
s143456117 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
using namespace std;
map<string, int> table;
int main()
{
string word, frequent, longest;
size_t N = 0;
while (cin >> word)
{
table[word]+=1;
if (table[word] > N)
{
frequest = word;
N = table[word];
}
if (word.size() > longest.size())longest = w... | a.cc: In function 'int main()':
a.cc:15:25: error: 'frequest' was not declared in this scope; did you mean 'frequent'?
15 | frequest = word;
| ^~~~~~~~
| frequent
|
s540260469 | p00029 | C++ | #include <map>
#include <string>
#include <iostream>
using namespace std;
map<string,int> table;
int main()
{
string word, frequent, longest;
size_t N=0;
while (cin >> word)
{
table[word]++;
if(table[word]>N)
{
N=table[word];
frequent=word;
if(... | a.cc: In function 'int main()':
a.cc:21:6: error: expected '}' at end of input
21 | }
| ^
a.cc:7:1: note: to match this '{'
7 | {
| ^
|
s135663433 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
int main()
{
string s, t;
map<string, int> p;
while (cin >> s) {
transform(s.begin(), s.end(), s.begin(), tolower);
if (p.find(s) != p.end())
p[s]++;
else
p[s] = 1;
if (s.size() > t.size())
t = s;
}
... | a.cc: In function 'int main()':
a.cc:13:26: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
13 | transform(s.begin(), s.end(),... |
s834282885 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
int main()
{
string s, t;
map<string, int> p;
while (cin >> s) {
transform(s.begin(), s.end(), s.begin(), tolower);
if (p.find(s) != p.end())
p[s]++;
else
p[s] = 1;
if (s.size() > t.size())
t = s;
}
... | a.cc: In function 'int main()':
a.cc:13:26: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
13 | transform(s.begin(), s.end(),... |
s355531100 | p00029 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
using namespace std;
int main(void) {
vector<string> vec;
string input, ans1;
int maxLen = 0;
while(cin >> input) {
vec.push_back(input);
if(input.length() > maxLen) {
maxLen = (int)input.length();
... | a.cc: In function 'int main()':
a.cc:23:24: error: 'count' was not declared in this scope; did you mean 'cnt'?
23 | int cnt = (int)count(vec.begin(), vec.end(), now);
| ^~~~~
| cnt
|
s431160230 | p00029 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main()
{
int longlen = 0;
string str, longstr;
vector<pair<int, string> > vc;
while (cin >> str)
{
if((int)strlen(str.c_str()) > longlen){
longlen = strlen(str.c_str());
longstr = str... | a.cc: In function 'int main()':
a.cc:17:25: error: 'strlen' was not declared in this scope
17 | if((int)strlen(str.c_str()) > longlen){
| ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #in... |
s747515587 | p00029 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main()
{
int longlen = 0;
string str, longstr;
vector<pair<int, string> > vc;
while (cin >> str)
{
if((int)strlen(str.c_str()) > longlen){
longlen = strlen(str.c_str());
longstr = str... | a.cc: In function 'int main()':
a.cc:17:25: error: 'strlen' was not declared in this scope
17 | if((int)strlen(str.c_str()) > longlen){
| ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #in... |
s098691273 | p00029 | C++ | #include<stdio.h>
#include<string>
#include<iostream>
using namespace std;
struct ST{string str;int c;int z;};
int main(){
int i=0;
string str,sth,stl;
struct ST P[1001];
int max=0;
while(cin>>str){
P[i].str=str;P[i].c=0;P[i].z=(int)str.size();
i++;
}
for(int j=0;j<i;j++)
for(int k=i-1;k>i;k--)
if(P[k-1].str>P[k].str... | a.cc: In function 'int main()':
a.cc:30:6: error: 'j' was not declared in this scope
30 | if(P[j].z>max)stl=P[j].str;
| ^
|
s996769850 | p00029 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
string str;
string max_len_str;
string most_many_str;
int most=-1;
int i;
vector<pair<string, int> > v;
string::iterator vi;
cin>>str;
v.push_back(pair<string, int>(str, 0));
max_len_str == v[0].first;
while(cin>>str){
f... | a.cc: In function 'int main()':
a.cc:16:21: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute ... |
s303153106 | p00029 | C++ | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c) | a.cc:1:16: error: empty character constant
1 | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c)
| ^~
a.cc:1:1: error: 'a' does not name a type
1 | a=[],m=l=0,... |
s033123688 | p00029 | C++ | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c) | a.cc:1:16: error: empty character constant
1 | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c)
| ^~
a.cc:1:1: error: 'a' does not name a type
1 | a=[],m=l=0,... |
s641241067 | p00029 | C++ | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c) | a.cc:1:16: error: empty character constant
1 | a=[],m=l=0,n=c='';require("fs").readFileSync("/dev/stdin","utf8").trim().split(' ').map(function(i){a[i]?++a[i]>m?m=a[n=i]:0:a[i]=1;(t=i.length)>l?(c=i,l=t):0});console.log(n+' '+c)
| ^~
a.cc:1:1: error: 'a' does not name a type
1 | a=[],m=l=0,... |
s084536252 | p00029 | C++ | #include <iostream>
using namespace std;
int main(){
char str[1000];
char word[33][33]={0};
int longest=0;
int check[33]={0};
char *tmp;
int freq=0;
int count=0;
int i,j;
size_t len , prev;
fgets(str , sizeof(str) , stdin);
tmp=str;
for(i=0 ; str[i]!='\0' ;i++){
if(str[i]==' '){
str[i]='\0';
s... | a.cc: In function 'int main()':
a.cc:19:33: error: 'strcpy' was not declared in this scope
19 | strcpy((char*)&word[count] , (const char*)tmp);
| ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding ... |
s715112868 | p00029 | C++ | int main(){
char str[1000];
char word[33][33]={0};
int longest=0;
int check[33]={0};
char *tmp;
int freq=0;
int count=0;
int i,j;
size_t len , prev;
fgets(str , sizeof(str) , stdin);
tmp=str;
for(i=0 ; str[i]!='\0' ;i++){
if(str[i]==' '){
str[i]='\0';
strcpy((char*)&word[count] , (const char*)t... | a.cc: In function 'int main()':
a.cc:10:9: error: 'size_t' was not declared in this scope
10 | size_t len , prev;
| ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | int main(){
a.cc:11:35... |
s008483254 | p00029 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string sent;
string word[500];
int a[500]={};
int i,j,k,l;
int n,m,len;
i=0;
while(cin>>sent){
if(i==0){ //????????????????????????
word[0]=sent;
a[0]++;
i++;
len=sent.size();
n=0;
}
else {
if(len<sent.size()){ //???... | a.cc:27:52: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
27 | if(sent==word[j]){???//?????§????????????????????????
a.cc: In function 'int main()':
a.cc:27:51: error: expected primary-expression before '?' token
27 | if(sent=... |
s380368834 | p00029 | C++ | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = null;
try ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
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.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules... |
s084338421 | p00029 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.b... | a.cc: In function 'int main()':
a.cc:37:16: error: no match for 'operator<' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_str... |
s750239684 | p00029 | C++ | #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <func... | a.cc: In function 'int main()':
a.cc:53:17: error: expected primary-expression before ')' token
53 | while (cin >> s,){
| ^
|
s927971612 | p00029 | C++ | <?php
$line = strtolower(trim(fgets(STDIN)));
$arr = explode(" ", $line);
$maxword = "";
$maxlenword = "";
$hash = array();
foreach($arr as $word){
$hash[$word]++;
if($hash[$maxword] < $hash[$word]){
$maxword = $word;
}
if(strlen($maxlenword) < strlen($word)){
$maxlenword = $word;
}
}
echo "{$maxword} {$... | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:4:1: error: '$arr' does not name a type
4 | $arr = explode(" ", $line);
| ^~~~
a.cc:6:1: error: '$maxword' does not name a type
6 | $maxword = "";
| ^~~~~~~~
a.cc:7:1: error: '$maxlenword' does not name a type
... |
s382258241 | p00029 | C++ | #include<iostream>
#include<string>
#include<map>
using namespace std;
map<string, int> table;
int main()
{
string word, frequent, longest;
size_t N = 0;
while (cin >> word)
{
table[word]++;
if (N < table[word])
{
N = table[word];
frequent = word;
... | a.cc: In function 'int main()':
a.cc:20:18: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s032392783 | p00029 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
int main()
{
string word,frequent,longest;
map<string,int> table;
size_t N=0;
while(cin >> word){
table[word] += 1;
N =table[word] < N ? N : table[word];
frequent = table[word] < N ? frequent : word;
logest =... | a.cc: In function 'int main()':
a.cc:15:5: error: 'logest' was not declared in this scope; did you mean 'longest'?
15 | logest = word.size() < longest.size ? longest : word;
| ^~~~~~
| longest
a.cc:15:36: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Allo... |
s410732202 | p00029 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef pair<string,int> p;
vector <p> ls(0);
int find(string s){
for(int i=0; i<(int)ls.size(); i++){
if(s==ls[i])return true;
}
return -1;
}
int main(){
string in;
int max=0,indx=0;
string maxs="";
while(cin>>in){
int tmp=find(in);
if(tmp==... | a.cc: In function 'int find(std::string)':
a.cc:11:9: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_typ... |
s043759690 | p00029 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#defi... | a.cc: In function 'int main()':
a.cc:39:24: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
39 | out=max(out,s.size());
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/includ... |
s365850794 | p00029 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#defi... | a.cc: In function 'int main()':
a.cc:39:24: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
39 | out=max(out,s.size());
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/includ... |
s675119260 | p00029 | C++ | //#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 1001
#define MIN -100001
#define _MAX 100
int main(void)
{
int x, max = 0, max_n = 0, cou = 0, word_num[MAX / 2] = { 0 }, m_i, m_j;
string word[MAX / 2];
char str[... | a.cc: In function 'int main()':
a.cc:16:9: error: 'gets_s' was not declared in this scope
16 | gets_s(str, MAX);
| ^~~~~~
a.cc:24:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size()... |
s388839440 | p00029 | C++ | #define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 1001
#define MIN -100001
#define _MAX 100
int main(void)
{
int x, max = 0, max_n = 0, cou = 0, word_num[MAX / 2] = { 0 }, m_i, m_j;
string word[MAX / 2];
char str[MAX]... | a.cc: In function 'int main()':
a.cc:2:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
2 | #define gets_s gets
| ^~~~
a.cc:16:9: note: in expansion of macro 'gets_s'
16 | gets_s(str);
| ^~~~~~
a.cc:24:29: error: invalid use of member function 'std... |
s179537597 | p00029 | C++ |
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#define ll (long lon
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)
using namespace std;
int main (void){
... | a.cc: In function 'int main()':
a.cc:19:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
19 | gets(str);
| ^~~~
| getw
a.cc:23:17: error: 'INT_MIN' was not declared in this scope
23 | int max_l = INT_MIN;
| ^~~~~~~
a.cc:8:1: note: 'INT_MIN' is... |
s053193620 | p00029 | C++ | #include <string.h>
#include <string>
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#define ll (long lon
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)
using ... | a.cc: In function 'int main()':
a.cc:20:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
20 | gets(str);
| ^~~~
| getw
a.cc:24:17: error: 'INT_MIN' was not declared in this scope
24 | int max_l = INT_MIN;
| ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is... |
s512147702 | p00029 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(){
char num[100], damy[100], damy2[100];
char now;
string ans;
int n, i, j, lng, cut = 0, l_damy;
while(1){
cin >> n;
if(n == 0) break;
cin >> num;
for(i = 0; i < n; i ++){
lng = strlen(num);
now = num[0];
for... | a.cc: In function 'int main()':
a.cc:20:31: error: 'strlen' was not declared in this scope
20 | lng = strlen(num);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<c... |
s242341636 | p00029 | C++ | #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <sstream>
#include <utility>
#include <cstdlib>
#include ... | a.cc: In function 'int main()':
a.cc:54:12: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (std::string&)'
54 | ans(str)++;
| ~~~^~~~~
a.cc:55:15: error: no match for call to '(std::map<std::__cxx11::basic_string<char>, int>) (std::string&)'
55 | if(an... |
s553835448 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:43:19: error: no match for 'operator=' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'})
4... |
s290991116 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:44:21: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
44 | lmax=max(lmax,vv.size());
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/u... |
s850969701 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:43:21: error: no matching function for call to 'max(int&, std::vector<std::__cxx11::basic_string<char> >::size_type)'
43 | lmax=max(lmax,v.size());
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
fro... |
s848085693 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:27:17: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'int')
27 | while(cin>>s!=EOF){
| ~~~~~~^~
| |
| std::basic_istream<char>
a.cc:27:17: note: candidate: 'operator!=(int, int)' (built... |
s268876173 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:28:13: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
28 | if(s==EOF) break;
| ~^~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file in... |
s944396631 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:27:17: error: expected ';' before 'while'
27 | maxLength=""
| ^
| ;
28 | while(cin>>tmp){
| ~~~~~
|
s402789145 | p00029 | C++ | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define PI ... | a.cc: In function 'int main()':
a.cc:27:17: error: expected ';' before 'while'
27 | maxLength=""
| ^
| ;
28 | while(cin>>tmp){
| ~~~~~
|
s989201998 | p00029 | C++ | #include "bits/stdc++.h"
using namespace std;
int main(){
string s;
int m;
map<string,int> mp;
while(cin>>s){
mp[s]++;
m=max(m,s,size());
}
int x=0;
for(auto &el:mp){
if(x<el.second){
x=el.second;
}
}
for(auto &el:mp){
if(x==el.second){
cout<<el.first<<" ";
break;
}
}
for(auto &... | a.cc: In function 'int main()':
a.cc:10:31: error: no matching function for call to 'size()'
10 | m=max(m,s,size());
| ~~~~^~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x8... |
s071857535 | p00029 | C++ | //
// main.cpp
// kazane
//
// Created by h3036136 on 2017/07/27.
// Copyright ?? 2017??´ h3036136. All rights reserved.
#include <iostream>
#include <string>
using namespace std;
int main(){
long saidai=0;
//char f;
int a=0,cnt=0,num=0,max=0;
string str,tango[1000]={""},answer,ans;
getline(cin,... | a.cc: In function 'int main()':
a.cc:51:26: error: 't' was not declared in this scope
51 | answer=tango[t];
| ^
|
s910154152 | p00029 | C++ | #include<iostream>
int main(){
std::string str;
std::string maxlen;
std::string maxocc;
std::map<std::string, int> occ;
//std::cin >> str;
//std::cout << str << std::endl;
std::cin >> str;
maxlen = str;
maxocc = str;
while(std::cin >> str){
if(str.size()>maxlen.size()){
maxlen = str;
... | a.cc: In function 'int main()':
a.cc:7:8: error: 'map' is not a member of 'std'
7 | std::map<std::string, int> occ;
| ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
1 | #include<iostream>
+++ |+#include <map>
2 |
a.cc:7:23: ... |
s400204063 | p00029 | C++ | #include<iostream>
int main(){
std::string str;
std::string maxlen;
std::string maxocc;
map<std::string, int> occ;
//std::cin >> str;
//std::cout << str << std::endl;
std::cin >> str;
maxlen = str;
maxocc = str;
while(std::cin >> str){
if(str.size()>maxlen.size()){
maxlen = str;
}
... | a.cc: In function 'int main()':
a.cc:7:3: error: 'map' was not declared in this scope
7 | map<std::string, int> occ;
| ^~~
a.cc:7:18: error: expected primary-expression before ',' token
7 | map<std::string, int> occ;
| ^
a.cc:7:20: error: expected primary-expression before 'in... |
s244102316 | p00029 | C++ | #include<iostream>
#include<map>
#include<string>
int main(){
std::string str;
std::string maxlen;
std::string maxocc;
map<std::string, int> occ;
//std::cin >> str;
//std::cout << str << std::endl;
std::cin >> str;
maxlen = str;
maxocc = str;
while(std::cin >> str){
if(str.size()>maxlen.size(... | a.cc: In function 'int main()':
a.cc:9:3: error: 'map' was not declared in this scope
9 | map<std::string, int> occ;
| ^~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note: 'std::map'
... |
s297076770 | p00029 | C++ | #include<stdio.h>
int main(void) {
int i = 0;
char s[1000][100];
while ( scanf("%s", s[n] ) != EOF ) n++;
for ( i = 0; i < n ; i ++ ) {
printf("%s", s[2]);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:26: error: 'n' was not declared in this scope
5 | while ( scanf("%s", s[n] ) != EOF ) n++;
| ^
a.cc:6:21: error: 'n' was not declared in this scope
6 | for ( i = 0; i < n ; i ++ ) {
| ^
a.cc:10:2: error: expect... |
s250265437 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
using namespace std;
int main(){
map<string,int>m;
string s;
vector<string>v;
while(cin>>s){
if('A'<=s[0]&&s[0]<='Z'){
s[0]=s[0]-'A'+'a';
}
m[s]++;
v.push_back(s);
}
int ans1=-1;
int ans2=-1;
... | a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
8 | vector<string>v;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <map>
+++ |+#include <vector>
4 | using na... |
s174572294 | p00029 | C++ | #include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <chrono>
typedef struct LettersInfo {
std::string letters;
unsigned int count;?°
} lettersInfo_s;
int main()
{
std::string paramStr;
std::getline(std::cin, paramStr);
std::vector<lettersInfo_s*> lettersList;
... | a.cc:9:25: error: extended character ° is not valid in an identifier
9 | unsigned int count;?°
| ^
a.cc:9:24: error: expected unqualified-id before '?' token
9 | unsigned int count;?°
| ^
a.cc: In function 'int main()':
a.cc:54:56: error: no mat... |
s132038897 | p00029 | C++ | #include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <chrono>
typedef struct LettersInfo {
std::string letters;
unsigned int count;??°
} lettersInfo_s;
int main()
{
std::string paramStr;
std::getline(std::cin, paramStr);
std::vector<lettersInfo_s*> lettersList... | a.cc:9:26: error: extended character ° is not valid in an identifier
9 | unsigned int count;??°
| ^
a.cc:9:24: error: expected unqualified-id before '?' token
9 | unsigned int count;??°
| ^
|
s305834587 | p00029 | C++ | #include <stdio.h>
#include <string.h>
#define TEXT_MAXNUM 1000
#define WORD_MAXNUM 33
typedef struct tagStrings
{
char str[WORD_MAXNUM];
int length;
int count;
} Strings_t;
void main( void )
{
char inputString[TEXT_MAXNUM] = "";
Strings_t words[TEXT_MAXNUM / 2] = {{0}}; // words in text
char tmpStr[WORD... | a.cc:14:1: error: '::main' must return 'int'
14 | void main( void )
| ^~~~
a.cc: In function 'int main()':
a.cc:92:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
92 | return;
| ^~~~~~
|
s265348812 | p00029 | C++ | #include<iostream>
#include<map>
#include<string>
using namespace std;
int main(){
string b,mx; map<string,int> d;
while(cin>>b){
d[b]++; if(b.size()>mx.size())mx=b;
}
cout<<max_element(d.begin(),d.end())->first<<" "<<mx<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:15: error: 'max_element' was not declared in this scope
10 | cout<<max_element(d.begin(),d.end())->first<<" "<<mx<<endl;
| ^~~~~~~~~~~
|
s088047968 | p00029 | C++ | #include <iostream>
using namespace std;
int main(){
string str[1000];
int appear[1000];
int i, j, n=0;
int maxlen, maxleni;
int maxappear, maxappeari;
while(cin>>string[n]){
for(i=0; i<string[n].size(); i++) string[n][i]=tolower(string[n][i]);
n++;
}
maxlen=0;
for(i=0; i<n; i++){
if(max... | a.cc: In function 'int main()':
a.cc:11:20: error: expected primary-expression before '[' token
11 | while(cin>>string[n]){
| ^
a.cc:12:22: error: expected primary-expression before '[' token
12 | for(i=0; i<string[n].size(); i++) string[n][i]=tolower(string[n][i]);
| ... |
s304285547 | p00029 | C++ | #include<cstdio>
#include<cstring>
#include<string>
using namespace std;
string s[1001];
int count[1001];
int main(void){
char temp[1001];
while(gets(temp) != 0){
int temp_n = strlen(temp);
int c = 0;
int max_h = 0;
int max_H = 0;
int max_l = 0;
int max_L = 0;
for(int i = 0; i < 1001; i++){
s... | a.cc: In function 'int main()':
a.cc:13:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
13 | while(gets(temp) != 0){
| ^~~~
| getw
|
s668783660 | p00029 | C++ | #include<iostream>
#include<string>
#include<map>
int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";} | a.cc: In function 'int main()':
a.cc:4:21: error: 'string' was not declared in this scope
4 | int main(){std::map<string,int>m;string s,t,u;for(;cin>>s;s.length()>u.length()?u=s:u)++m[s]>m[t]?t=s:s;std::cout<<t<<" "<<u<<"\n";}
| ^~~~~~
a.cc:4:21: note: suggested alternatives:
In file inclu... |
s879333167 | p00029 | C++ | #include<iostream>
#include<map>
#include<string>
#include<stdio.h>
using namespace std;
bool compare(const pair<string, int> T1, const pair<string, int> T2) {
return T1.second < T2.second;
}
int main (void){
string str,maxByLength("");
//map<int,string> X; //¶Ì·³
map<string,int> Y; //¶Ì
//int mm;
... | a.cc: In function 'int main()':
a.cc:25:43: error: 'max_element' was not declared in this scope
25 | pair<string, int> maxCountPair = *max_element(Y.begin(), Y.end(), compare);
| ^~~~~~~~~~~
|
s868005264 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
int main(){
// word[s] Å ¶ñsÌo»ñªÔÁÄé
map<string, int> word;
vector<string> v;
string s;
int max=0,length=0;
while( cin >> s ){
v.push_back(s);
//ü͵½PꪷÅÉ é©T·
if( word.count(s... | a.cc: In function 'int main()':
a.cc:27:27: error: 'max' cannot be used as a function
27 | mode = max( mode , word[ v[i] ] );
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:13: error: redeclaration of 'int length'
35 | int length = 0;
| ^~~~~~
a.cc:12:1... |
s577580365 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
int main(){
// word[s] Å ¶ñsÌo»ñªÔÁÄé
map<string, int> word;
vector<string> v;
string s;
while( cin >> s ){
v.push_back(s);
//ü͵½PꪷÅÉ é©T·
if( word.count(s) ){
word[s]++;
... | a.cc: In function 'int main()':
a.cc:36:29: error: no matching function for call to 'max(int&, std::__cxx11::basic_string<char>::size_type)'
36 | length = max( length , v[i].size() );
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s702824235 | p00029 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <cstdint>
typedef std::map<std::string, std::uint32_t> OccurenceWordMap;
class compare_second {
typedef OccurenceWordMap::value_type value_type;
public:
bool operator()(value... | a.cc:6:10: fatal error: boost/algorithm/string.hpp: No such file or directory
6 | #include <boost/algorithm/string.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s698846141 | p00029 | C++ | #include<iostream>
#include<map>
#include<algorithm>
using namespace std;
int main(void){
char s[1001][33];
map<string,int>wd;
int i=0;
while(~scanf("%s",&s[i][0])){i++;}
for(int j=0;j<i;j++)
wd[s[j]]=0;
for(int j=0;j<i;j++)
wd[s[j]]++;
int ans=0,len=0;
for(int j=0;j<i;j++){
ans=max(wd... | a.cc: In function 'int main()':
a.cc:23:22: error: 'strlen' was not declared in this scope
23 | len=max(len,(int)strlen(&s[j][0]));
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
... |
s543744988 | p00029 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
const int M = 33;
const int N = 1001;
char text[N];
char word[N][M];
char tmp[M], ansm[M], ansl[M];
void solve(char text[]) {
qsort(word, k, sizeof(word[0]), cmp);
int maxs = -1;
int cnt = 1;
strcpy(tmp, word[0]);
... | a.cc: In function 'void solve(char*)':
a.cc:16:21: error: 'k' was not declared in this scope
16 | qsort(word, k, sizeof(word[0]), cmp);
| ^
a.cc:16:41: error: 'cmp' was not declared in this scope; did you mean 'tmp'?
16 | qsort(word, k, sizeof(word[0]), cmp);
| ... |
s307680467 | p00029 | C++ | #include <iostream>
#include <string>
#include <map>
using namespace std;
int main(){
string str,s,mls,mcs,input[32];
map <string,int> dic;
int n,c,a,ml,mc;
getline(cin,str)
c = a = mc = ml = 0;
str += ' ';
while(str.length()){
n = str.find(' ');
s = str[c... | a.cc: In function 'int main()':
a.cc:9:21: error: expected ';' before 'c'
9 | getline(cin,str)
| ^
| ;
10 | c = a = mc = ml = 0;
| ~
|
s440525671 | p00029 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef pair<int,string> P;
int main(void)
{
char c;
string str,maxstr;
P d[1001] = {};
while(scanf("%c", &c), c != '\n'){
if(c != ' '){
str += c;
}
else {
if(strlen(str.c_str()) > strlen(maxstr.c_str())){
maxstr.cl... | a.cc: In function 'int main()':
a.cc:20:28: error: 'strlen' was not declared in this scope
20 | if(strlen(str.c_str()) > strlen(maxstr.c_str())){
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <... |
s153896097 | p00029 | C++ | #include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
char a[1010][100];
char b[10000];
int main()
{
int i,j,l,s,m,n,p,k,s1,s2;
while(gets(b))
{
l=strlen(b);
j=0;p=0;n=0;s=0;
for(i=0;i<l;i++)
{
if(b[i]!=' ')
{
char t=b[i];
a[j][p++]=b[i];
}
else
{
// cout<<p<... | a.cc: In function 'int main()':
a.cc:10:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | while(gets(b))
| ^~~~
| getw
|
s906107638 | p00029 | C++ | #include<stdio.h>
#include<string.h>
char str[33];
int lmax=0;
char mword[33];
typedef struct{
char word[33];
int time;
}data;
data d[1000];
int cd=0;
int i;
int main(){
while(scanf("%s",str)!=EOF){
if(strlen(str)>lmax){
lmax=strlen(str);
strcpy(mword,str);
}
for(i=0;i<cd;i++)if(strcmp(d[i].word,str)==0)... | a.cc:30:9: error: expected unqualified-id before 'for'
30 | for(i=0;i<cd;i++)if(d[i].time>d[fm].time)fm=i;
| ^~~
a.cc:30:17: error: 'i' does not name a type
30 | for(i=0;i<cd;i++)if(d[i].time>d[fm].time)fm=i;
| ^
a.cc:30:22: error: 'i' does not name a type
30... |
s565522505 | p00029 | C++ | #include<iostream>
#include<string>
#include<functional>
#include<algorithm>
using namespace std;
//文章が与えられた時、出現頻度の高い単語と最長の単語を出力するもの。
//文章に現れる単語リストを作ってそれぞれの文字列をカウントすればよい。
int main(){
string sentence[1000];
int sentenceNum[1000];
int array[1000];
string input;
int count = 0;
bool flag; //単語リストから単語が見つかったどうか
int ... | a.cc:16:19: error: extended character is not valid in an identifier
16 | bool flag; //単語リストから単語が見つかったどうか
| ^
a.cc: In function 'int main()':
a.cc:16:19: error: '\U00003000' was not declared in this scope
16 | bool flag; //単語リストから単語が見つかったどうか
| ^~
a.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.