submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s272160737 | p00064 | C++ | int main()
{
string str;
unsigned int x, sum = 0;
while (cin >> str) {
for (string::size_type i = 0; i < str.length(); i++) {
x = 0;
while (isdigit(str[i])) {
x = 10 * x + str[i] - '0';
... | a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
3 | string str;
| ^~~~~~
a.cc:6:16: error: 'cin' was not declared in this scope
6 | while (cin >> str) {
| ^~~
a.cc:6:23: error: 'str' was not declared in this scope; did y... |
s389986400 | p00064 | C++ | using System;
using System.Linq;
public class Test
{
public static void Main()
{ int ans=0;
while(true){
string str=Console.ReadLine();
if(str==null){break;}
string bef="";
for(int i=0;i<str.Length;i++){
char u=str[i];
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Test
| ^~~~~~
|
s170252216 | p00064 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
int cnt;
while(cin >> str){
int x = 0;
for(int i = 0; i <= (int)str.size(); i++){
if('0' <= str[i] && str[i] <= '9'){
x = x * 10 + (str[i] - '0');
}else{
cnt += x;
x = 0;
}
}
}
cout<<c... | a.cc:10:25: error: extended character is not valid in an identifier
10 | for(int i = 0; i <= (int)str.size(); i++){
| ^
a.cc:10:29: error: extended character is not valid in an identifier
10 | for(int i = 0; i <= (int)str.size(); i++){
| ... |
s996869806 | p00064 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
int cnt;
while(cin >> str, 1){
int x = 0;
for(int i = 0; i <= (int)str.size(); i++){
if('0' <= str[i] && str[i] <= '9'){
x = x * 10 + (str[i] - '0');
}else{
cnt += x;
x = 0;
}
}
}
cout... | a.cc:10:25: error: extended character is not valid in an identifier
10 | for(int i = 0; i <= (int)str.size(); i++){
| ^
a.cc:10:29: error: extended character is not valid in an identifier
10 | for(int i = 0; i <= (int)str.size(); i++){
| ... |
s399750695 | p00064 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
string str;
int count;
while(cin >> str){
int x = 0;
for(int i=0; i <= (int)str.size(); i++){
if("0" <= str[i] && str[i] <= "9"){
x = x * 10 + (str[i] - "0");
}else{
count += x;
x = 0;
}
}
}
cout ... | a.cc:10:29: error: extended character is not valid in an identifier
10 | for(int i=0; i <= (int)str.size(); i++){
| ^
a.cc:10:29: error: extended character is not valid in an identifier
a.cc:10:36: error: extended character is not valid in an identifier
10 |... |
s973398421 | p00064 | C++ | #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int main() {
string memo;
int num = 0;
int temp;
cin >> memo;
for(int i = 0; i < memo.size(); i++) {
if(memo[i] >= 48 && memo[i] <= 57) {
temp = memo[i] - '0';
temp = temp * 10;
temp += (memo[i+j] - '0');
... | a.cc: In function 'int main()':
a.cc:17:23: error: 'j' was not declared in this scope
17 | temp += (memo[i+j] - '0');
| ^
|
s032406419 | p00064 | C++ | bool isdigit(char c);
int main(){
string str;
while(cin >> str){
int num = 0;
int ans = 0;
for(int i=0; i<str.size(); ++i){
if(isdigit(str[i])){
if(isdigit(str[i-1])){
num *= 10;
num += (int)(str[i]-'0');
}else if(isdigit(str[i])){
num += (int)(str[i]-'0');
}
}
... | a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
4 | string str;
| ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
6 | while(cin >> str){
| ^~~
a.cc:6:16: error: 'str' was not declared in this scope; did you mean 'std'?
6 | whi... |
s362185714 | p00064 | C++ | import java.util.*;
import java.math.*;
class Main{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
BigInteger ret=new BigInteger("0");
while(s.hasNext()){
String str=s.next();
String [] a=str.split("[^0-9]");
for(int i=0;i<a.length;i++){
if(a[i].length()>0)ret=ret.add(new ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.math.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1... |
s843125058 | p00064 | C++ | #include <cctype>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s; cin>>s;
int num=0;
string tmp="";
for (int i=0; i<s.length(); i++) {
if (isnum(s[i])) {
tmp += s[i];
} else if (tmp != "") {
num += atoi(tmp);
tmp = "";
}
}
cout << num << endl;
} | a.cc: In function 'int main()':
a.cc:11:21: error: 'isnum' was not declared in this scope; did you mean 'num'?
11 | if (isnum(s[i])) {
| ^~~~~
| num
a.cc:14:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const c... |
s022307847 | p00064 | C++ | #include <cctype>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s; cin>>s;
int num=0;
string tmp="";
for (int i=0; i<s.length(); i++) {
if (isalnum(s[i])) {
tmp += s[i];
} else if (tmp != "") {
num += atoi((const char*)tmp);
tmp = "";
}
}
cout << ... | a.cc: In function 'int main()':
a.cc:14:37: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'const char*'
14 | num += atoi((const char*)tmp);
| ^~~~~~~~~~~~~~~~
|
s422504807 | p00064 | C++ | include <stdio.h>
#include <string.h>
int main(){
char x[85];
int sum=0,y=0,ans=0,i,z[85];
while(scanf("%s",x)!=EOF){
for(i=0;i<strlen(x);i++){
z[i]=x[i]-'0';
}
for(i=0;i<strlen(x);i++){
if(z[i]>=0 && z[i]<=9){
if(y==0&& z[i]>0){sum*=10;}sum+=z[i];y=0;
}else{y=1; ans+=sum; sum=0;}
}
ans+=sum;
}
printf("%d\n",ans);
ret... | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:7: error: 'scanf' was not declared in this scope
6 | while(scanf("%s",x)!=EOF){
| ^~~~~
a.cc:6:22: error: 'EOF' was not declared in this scope
6 | while(scanf("%s",x)!=EOF... |
s455153211 | p00064 | C++ | #include <stdio.h>
#include <string.h>
int main(){
char x[1000];
while(scanf("%s",&x)!=EOF){
int sum=0,y=0,ans=0,i,z[1000];
while(scanf("%s",&x)!=EOF){
for(i=0;i<strlen(x);i++){
z[i]=x[i]-'0';
}
for(i=0;i<strlen(x);i++){
if(z[i]>=0 && z[i]<=9){
if(y==0){sum*=10;}sum+=z[i];y=0;
}else{y=1; ans+=sum; sum=0;}
}
if(sum!=... | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s616624490 | p00064 | C++ | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(){
string str="", sub;
while(cin>>sub, !cin.eof()){
str+=sub;
}
str+='Z';
int key=0, tmp, n=str.size();
string s="";
for(int i=0; i<n; ++i){
if('0'<=str[i]&&str[i]<='9'){
s+=str[i];
}
else if(s!=""){
... | a.cc: In function 'int main()':
a.cc:31:10: error: expected '}' at end of input
31 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s000101411 | p00064 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
size_t sum = 0;
string s;
while( cin >> s ) {
for( auto it=s.cbegin(); it<s.cend(); ++it )
{
if ( *it >= '0' && *it <= '9' ) {
string t;
t += *it;
... | a.cc:32:5: error: redefinition of 'int main()'
32 | int main()
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main()
| ^~~~
a.cc:57:5: error: redefinition of 'int main()'
57 | int main()
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int ... |
s864855473 | p00064 | C++ | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main(int argc, const char * argv[])
{
int snum = 0;
int stuck = 0;
string slit;
while(cin >> slit){
for (int i = 0; i < (int)slit.length(); i++) {
if (isnumber(slit[i])) {
stuck *= 10;
... | a.cc: In function 'int main(int, const char**)':
a.cc:13:17: error: 'isnumber' was not declared in this scope
13 | if (isnumber(slit[i])) {
| ^~~~~~~~
a.cc:17:18: error: 'isnumber' was not declared in this scope
17 | if (!isnumber(slit[i + 1])) {
| ... |
s591640441 | p00064 | C++ | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main(int argc, const char * argv[])
{
int snum = 0;
int stuck = 0;
string slit;
while(cin >> slit){
for (int i = 0; i < (int)slit.length(); i++) {
if (isnumber(slit[i])) {
stuck *= 10;
... | a.cc: In function 'int main(int, const char**)':
a.cc:13:17: error: 'isnumber' was not declared in this scope
13 | if (isnumber(slit[i])) {
| ^~~~~~~~
a.cc:17:18: error: 'isnumber' was not declared in this scope
17 | if (!isnumber(slit[i + 1])) {
| ... |
s601935468 | p00065 | Java | package aoj;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
public class aoj031 {
public static void main(String[] args){
BigDecimal one = new BigDecimal("1.00");
int[] abo = {0,0,... | Main.java:10: error: class aoj031 is public, should be declared in a file named aoj031.java
public class aoj031 {
^
1 error
|
s596889881 | p00065 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
int i = 0;
ArrayList<Integer> fas = new ArrayList<Integer>();
ArrayLi... | Main.java:20: error: cannot find symbol
tmp = br.readLine();
^
symbol: variable tmp
location: class Main
Main.java:20: error: cannot find symbol
tmp = br.readLine();
^
symbol: variable br
location: class Main
Main.java:26: error: cannot find symbol
if(tmp.equals("")){
^
... |
s093024401 | p00065 | Java | import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
int i = 0;
ArrayList<Integer> fas = new ArrayList<Integer>();
ArrayList<Integer> has = new ArrayList<Integer>();
ArrayList<Integer> las = new ArrayList<Integer>();
while(true){
... | Main.java:16: error: cannot find symbol
tmp = br.readLine();
^
symbol: variable tmp
location: class Main
Main.java:16: error: cannot find symbol
tmp = br.readLine();
^
symbol: variable br
location: class Main
Main.java:17: error: cannot find symbol
} catch (IOException e) {
... |
s191551436 | p00065 | Java | import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
int i = 0;
String tmp;
ArrayList<Integer> fas = new ArrayList<Integer>();
ArrayList<Integer> has = new ArrayList<Integer>();
ArrayList<Integer> las = new ArrayList<Integer>();
while(tru... | Main.java:16: error: cannot find symbol
tmp = br.readLine();
^
symbol: variable br
location: class Main
Main.java:17: error: cannot find symbol
} catch (IOException e) {
^
symbol: class IOException
location: class Main
Main.java:34: error: cannot find symbol
tmp = br.re... |
s956468525 | p00065 | Java | import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
int i = 0;
String tmp;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> fas = new ArrayList<Integer>();
ArrayList<Integer> has = new ArrayList<Int... | Main.java:8: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:8: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
... |
s021446259 | p00065 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args){
int i = 0;
String tmp;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Ar... | Main.java:26: error: variable tmp might not have been initialized
if(tmp.equals("")){
^
1 error
|
s968546421 | p00065 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
BigDecimal one = new BigDecimal("1.00");
int[] abo = {0,0,0,0};
Buffered... | Main.java:130: error: class, interface, enum, or record expected
}
^
1 error
|
s303913238 | p00065 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String tmp = null;
int i... | Main.java:58: error: unreachable statement
if(tmp.equals("")){
^
1 error
|
s924836657 | p00065 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String tmp = null;
int i... | Main.java:49: error: exception IOException is never thrown in body of corresponding try statement
} catch (IOException e) {
^
1 error
|
s611218729 | p00065 | Java | s = Hash.new
nums = Array.new
while (line = gets) != "\n" do
num,=line.split(",").map(&:to_i)
s[num]||=0
s[num]+=1
end
while line = gets do
num,=line.split(",").map(&:to_i)
next unless s[num]
nums << num
s[num]+=1
end
nums.sort!
nums.each{|n|
puts n.to_s+" "+s[n].to_s
} | Main.java:1: error: class, interface, enum, or record expected
s = Hash.new
^
1 error
|
s606584829 | p00065 | Java | import java.util.*;
public class test {
static List<Integer> sengetu = new ArrayList<Integer>();
static List<Integer> result = new ArrayList<Integer>();
static boolean hantei(int n){
for(int i=0;i<sengetu.size();i++)if(n==sengetu.get(i))return true;
return false;
}
static boolean hantei2(int n){
for(int i=0;... | Main.java:2: error: class test is public, should be declared in a file named test.java
public class test {
^
1 error
|
s928835080 | p00065 | C | #include <stdio.h>
#include <string.h>
int p[10010],n[10010];
int main(){
char line[100];
int a,b;
int flag=1;
int i;
while(gets(line)!=NULL){
if(line[0]=='\n')flag=0;
else{
sscanf(line,"%d,%d",&a,&b);
if(flag)p[a]++;
else n[a]++;
}
}
for(int i=0; i<10010; i++){
if(p[i]>0&&n[i]>0){
printf(... | main.c: In function 'main':
main.c:12:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
12 | while(gets(line)!=NULL){
| ^~~~
| fgets
main.c:12:25: warning: comparison between pointer and integer
12 | ... |
s036445513 | p00065 | C | include<stdio.h>
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
int main(){
int a,b,x[2000],y[2000],z[2000],s[2000],i=0,j,k=0;
while(scanf("%d,%d",&a,&b)!=EOF){
for(j=0;j<i;j++)
if(x[j]==a){
y[j]++;
break;
}
if(j==i){
x[i]=a;
y[i++]=1;
}
}
while(scanf("%d,%d",&a,&b)... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | while(scanf("%d,%d",&a,&b)!=EOF){
| ... |
s804160918 | p00065 | C | include<stdio.h>
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
int main(){
int a,b,x[2000],y[2000],z[2000],s[2000],i=0,j,k=0;
while(scanf("%d,%d",&a,&b)!=EOF){
for(j=0;j<i;j++)
if(x[j]==a){
y[j]++;
break;
}
if(j==i){
x[i]=a;
y[i++]=1;
}
}
while(scanf("%d,%d",&a,&b)... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:9:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
9 | while(scanf("%d,%d",&a,&b)!=EOF){
| ... |
s536875385 | p00065 | C | #include <stdio.h>
#include <stdlib.h>
#define N 1000
int main( void ) {
int i;
char ch[ N ];
int comp[ N ][ 3 ]; // 使用未使用、顧客番号、カウント
int num;
for( i = 0; i < N; i++ )
comp[ i ][ 0 ] = comp[ i ][ 1 ] = comp[ i ][ 2 ] = 0;
while( gets( ch ) ) {
if( !*ch ) break;
num = atoi( ch );
for( i = ... | main.c: In function 'main':
main.c:14:10: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
14 | while( gets( ch ) ) {
| ^~~~
| fgets
|
s617911775 | p00065 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <map>
#include <utility>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
char s[10];
vector<int> v1;
while(gets(s) && *s != '\0') {
v1.push_back(atoi(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(s) && *s != '\0') {
| ^~~~
| getw
a.cc:18:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iter... |
s433273839 | p00065 | C++ | #include <stdio.h>
int main() {
int f[3000] = {}, n[3000] = {}, k, d, t = 0;
char s[100];
while(gets(s)){
if(s[0] == NULL)
t++;
else{
sscanf(s, "%d,%d", &k, &d);
if(t == 0){
f[k]++;
}
else{
n[k]++;
}
}
}
int i = 0;
for(i = 0; i < 3000; ++i){
if(n[i] && f[i])
printf("%d %d\n"... | a.cc: In function 'int main()':
a.cc:7:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | while(gets(s)){
| ^~~~
| getw
a.cc:8:28: warning: NULL used in arithmetic [-Wpointer-arith]
8 | if(s[0] == NULL)
| ... |
s278609632 | p00065 | C++ | // ConsoleApplication1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int main() {
int ky[1000] = {};
int ny[1000] = {};
string s;
while (cin>>s&&s.empty()) {
int it=1;
for (int i = 0... | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s433388288 | p00065 | C++ | // ConsoleApplication1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int main() {
int ky[1000] = {};
int ny[1000] = {};
string s;
while (cin>>s&&s.empty()) {
int it=1;
for (int i = 0... | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s215244587 | p00065 | C++ | #include<iostream>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
map<int,int> a;
vector<int> b;
int n,m;
char z;
int main(){
while(cin>>n>>z>>m){
if(a.find(n)==a.end())a.insert(n,1);
else a[n]++;
}
while(cin>>n>>z>>m){
if(a.find(n)!=a.end())b.push_back(n);
}
sort(b.begin(),b.end()... | In file included from /usr/include/c++/14/map:63,
from a.cc:3:
/usr/include/c++/14/bits/stl_map.h: In instantiation of 'void std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = int; _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocato... |
s720796608 | p00065 | C++ | #include<stdio.h>
int main(void){
int c[1000] = { 0 }, d[100], count[3000], i = 0;
while( scanf("%d,%d", &c[i], &d[i]) !=EOF ) {
count[c[i]]++;
i++;
}
n = i;
for ( i = 0; i < n; i++ ) {
if ( count)
}
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'n' was not declared in this scope
8 | n = i;
| ^
a.cc:11:5: error: expected primary-expression before '}' token
11 | }
| ^
|
s688046835 | p00065 | C++ | #include<cstdio>
#include<cstring>
#include<map>
using namespace std;
int main(){
int id,d;
map<int,int> lastm,currm;
char buf[99];
while(gets(buf)&&strlen(buf)){
sscanf(buf,"%d,%d",&id,&d);
lastm[id]++;
}
while(gets(buf)&&strlen(buf)){
sscanf(buf,"%d,%d",&id,&d);
currm[id]++;
}
for(__typeof(lastm.begin... | a.cc: In function 'int main()':
a.cc:9:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | while(gets(buf)&&strlen(buf)){
| ^~~~
| getw
a.cc:13:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
13 | while(gets(buf... |
s626680585 | p00065 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include ... | a.cc: In function 'int main()':
a.cc:44:35: error: 'gets' was not declared in this scope; did you mean 'getw'?
44 | for(char buf[100];gets(buf) && strlen(buf);){
| ^~~~
| getw
|
s068308228 | p00065 | C++ | int main()
{
map<int, int> num;
map<int, int>::iterator it;
int i;
char c;
char s[1000000];
while (cin.get(c)) {
if (!isdigit(c)) {
break;
}
i = 0;
s[i++] = c;
while ( cin.get(c) ) {
if (!isdigit(c)) break;
s[i++] = c;
}
s[i] = '\0';
num[atoi(s)] --;
i = 0;
while ( cin.get(c) ) {
... | a.cc: In function 'int main()':
a.cc:3:9: error: 'map' was not declared in this scope
3 | map<int, int> num;
| ^~~
a.cc:3:13: error: expected primary-expression before 'int'
3 | map<int, int> num;
| ^~~
a.cc:4:13: error: expected primary-expression before 'int'
... |
s851699714 | p00065 | C++ | #include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int num, day;
char input[80];
vector<int> mon;
map<int, int> res;
while (gets(input)&&strlen(input)!=0) {
sscanf(input, "%d%*c%d", &num, &day);
mon.push_back(num);
}
while (scanf("%s",... | a.cc: In function 'int main()':
a.cc:12:16: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | while (gets(input)&&strlen(input)!=0) {
| ^~~~
| getw
|
s936386752 | p00065 | C++ | #include <map>
#include <cstdio>
#include <sstream>
int main(){
std::map<int, int> m;
std::string s;
int num, sales,t;
while(getline(std::cin, s), s.size()){
std::stringstream ss;
char c;
ss << s;
ss >> num >> c >> sales;
m[num] = -(-m[num]+1);
}
while(getline(std::cin, s), s.size()){
... | a.cc: In function 'int main()':
a.cc:9:22: error: 'cin' is not a member of 'std'
9 | while(getline(std::cin, s), s.size()){
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <sstream>
+++ |+#in... |
s691844830 | p00065 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
char s[50];
bool month = false;
int com[2][1000] = {0},x = 0;
while(cin.getline(s,50)){
if(s[0] == 0){
sort(com[0],com[0]+x);
month = true;
continue;
}
int n;
sscanf(s,"%d,%*d",&n);
if(!month){
com[0][x] =... | a.cc:38:5: error: redefinition of 'int main()'
38 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
|
s964419595 | p00065 | C++ | #include<iostream>
#include<map>
#include<cstdio>
using namespace std;
int main(){
bool month = false;
map<int, pair<int, int> > com;
int n;
char s[50];
while(cin.getline(s,50)){
if(s == 0){month = true;continue;}
sscanf(s,"%d,%*d",&n);
if(!month){com[n].first = 1;}
else if(month && com[n].first){com[n].fi... | a.cc: In function 'int main()':
a.cc:17:25: error: missing template arguments before '.' token
17 | for(__typeof(map.begin()) i=map.begin(); i<map.end(); i++){
| ^
a.cc:17:40: error: missing template arguments before '.' token
17 | for(__typeof(map.begin()) i=map.begi... |
s264533365 | p00065 | C++ | #include<iostream>
#include<map>
#include<cstdio>
using namespace std;
int main(){
bool month = false;
map<int, pair<int, int> > com;
int n;
char s[50];
while(cin.getline(s,50)){
if(s == 0){month = true;continue;}
sscanf(s,"%d,%*d",&n);
if(!month){com[n].first = 1;}
else if(month && com[n].first){com[n].fi... | a.cc: In function 'int main()':
a.cc:17:51: error: no match for 'operator<' (operand types are 'std::map<int, std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, std::pair<int, int> >, std::_Select1st<std::pair<const int, std::pair<int, int> > >, std::less<int>, std::allocator<std::pair<const... |
s520941058 | p00065 | C++ | #include<iostream>
#include<map>
#include<cstdio>
using namespace std;
int main(){
bool month = false;
map<int, pair<int, int> > com;
int n;
char s[50];
while(cin.getline(s,50)){
if(s == 0){month = true;continue;}
sscanf(s,"%d,%*d",&n);
if(!month){com[n].first = 1;}
else if(month && com[n].first){com[n].fi... | a.cc: In function 'int main()':
a.cc:17:51: error: no match for 'operator<' (operand types are 'std::map<int, std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, std::pair<int, int> >, std::_Select1st<std::pair<const int, std::pair<int, int> > >, std::less<int>, std::allocator<std::pair<const... |
s148230040 | p00065 | C++ | #include<iostream>
#include<map>
#include<cstdio>
using namespace std;
int main(){
bool month = false;
map<int, pair<int, int> > com;
int n;
char s[50];
while(cin.getline(s,50)){
if(s == 0){month = true;continue;}
sscanf(s,"%d,%*d",&n);
if(!month){com[n].first = 1;}
else if(month && com[n].first){com[n].fi... | a.cc: In function 'int main()':
a.cc:17:51: error: no match for 'operator<' (operand types are 'std::map<int, std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, std::pair<int, int> >, std::_Select1st<std::pair<const int, std::pair<int, int> > >, std::less<int>, std::allocator<std::pair<const... |
s418716500 | p00065 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int main(){
vector<int> last;
char str[256];
map<int,int> m;
map<int,int>::iterator itm;
char* tp;
while(fgets(str,256,stdin)){
if(strlen(str) == 1) break;
tp = strtok(str,",");
last.push_back(atoi... | a.cc: In function 'int main()':
a.cc:13:12: error: 'strlen' was not declared in this scope
13 | if(strlen(str) == 1) break;
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <vector>
+++ |+#include <... |
s754907835 | p00065 | C++ | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector<int> last;
char str[256];
map<int,int> m;
map<int,int>::iterator itm;
char* tp;
while(fgets(str,256,stdin)){
if(strlen(str) == 1) break;
tp = strtok(str,",");
... | a.cc: In function 'int main()':
a.cc:14:12: error: 'strlen' was not declared in this scope
14 | if(strlen(str) == 1) break;
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <algorithm>
+++ |+#includ... |
s554297019 | p00065 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
int main(){
vector<int> last;
char str[256];
map<int,int> m;
map<int,int>::iterator itm;
char* tp;
while(fgets(str,256,stdin)){
if(strlen(str) == 1) break;
tp = strtok... | a.cc: In function 'int main()':
a.cc:36:9: error: 'cout' was not declared in this scope
36 | cout << itm->first << " " << itm->second << endl;
| ^~~~
a.cc:6:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
5 | #include <vector>... |
s531606198 | p00065 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <map>
using namespace std;
int did[1000],dcn[1000];
int main() {
int n,k;
char s[256];
map<int,int> da1,da2;
map<int,int>::iterator it;
while(true) {
n=atoi(gets(s));
if (strlen(s)==0) break;
if (da1.find(n)!=da1.end()) da1[n]++; else da1.... | a.cc: In function 'int main()':
a.cc:15:24: error: 'gets' was not declared in this scope; did you mean 'getw'?
15 | n=atoi(gets(s));
| ^~~~
| getw
|
s933115170 | p00065 | C++ | #include<iostream>
#include<string>
using namespace std;
class data
{
public:
int times;
bool flag[2];
data()
{
times=0;
flag[0]=false;
flag[1]=false;
}
};
int main(void)
{
data d[1000];
int month=0;
while(1)
{
string s;
getline(cin,s);
if(cin.eof())break;
if(s.length()==0)month++;
for(int i... | a.cc: In function 'int main()':
a.cc:21:9: error: reference to 'data' is ambiguous
21 | data d[1000];
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
... |
s587635261 | p00065 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef struct{
int no,sum;
}P;
int main(){
int a,b,i;
char tmp[50];
P n[1000];
P temp;
while(fgets(tmp,50,stdin)!=NULL){
if(strcmp(tmp,"\n")==0)break;
sscanf(tmp,"%d,%d",&n[i].no,&a);
n[i].sum=1
i... | a.cc: In function 'int main()':
a.cc:17:15: error: expected ';' before 'i'
17 | n[i].sum=1
| ^
| ;
18 | i++;
| ~
|
s001224540 | p00065 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<iostream>
using namespace std;
vector<int> inputs;
map<int, int> one, two;
int main(){
int x, n;
while(~scanf("%d,%*d", &x)){
inputs.push_back(x);
}
for(int i = 0;i < inputs.size();i++){
if(i < inputs.size() / 2)one[inputs[i... | a.cc: In function 'int main()':
a.cc:26:18: error: no match for call to '(std::vector<int>) ()'
26 | return inputs().size()%2;
| ~~~~~~^~
|
s096300552 | p00065 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<iostream>
using namespace std;
vector<int> inputs;
map<int, int> one, two;
int main(){
int x, n;
while(~scanf("%d,%*d", &x)){
inputs.push_back(x);
}
for(int i = 0;i < inputs.size();i++){
if(i < inputs.size() / 2)one[inputs[i... | a.cc: In function 'int main()':
a.cc:26:18: error: no match for call to '(std::vector<int>) ()'
26 | return inputs().size%2;
| ~~~~~~^~
|
s598521786 | p00065 | C++ | #include<iostream>
#include<map>
#include<vector>
using namespace std;
char ch;
int cnt=0;
int in[2000][2];
map <int,int> t;
map <int,bool>u;
map <int,bool>v;
vector <int> w;
int main(){
while(cin>>in[cnt][0]>>ch>>in[cnt][1])cnt++;
for(int i=0;i<cnt/2;i++){
if(t[in[i][0]]==0)w.push_back(in[i][0]);
t[in[i][... | a.cc: In function 'int main()':
a.cc:25:3: error: 'sort' was not declared in this scope; did you mean 'short'?
25 | sort(w.begin(),w.end());
| ^~~~
| short
|
s939933646 | p00066 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
line=br.readLine();
int d=line.length()/3;
char[][][] map=new char[d][3][3];
for(int i=0;i<line.length;i++){
map[(int)i/3][0][i%3]=line.charAt... | Main.java:11: error: ';' expected
map[(int)i/3][0][i%3]=line.charAt(i)
^
Main.java:16: error: ';' expected
map[(int)i/3][j][i%3]=line.charAt(i)
^
2 errors
|
s784468189 | p00066 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
line=br.readLine();
int d=line.length()/3;
char[][][] map=new char[d][3][3];
for(int i=0;i<line.length;i++){
map[(int)i/3][0][i%3]=line.charAt... | Main.java:10: error: cannot find symbol
for(int i=0;i<line.length;i++){
^
symbol: variable length
location: variable line of type String
Main.java:15: error: cannot find symbol
for(int i=0;i<line.length;i++){
^
symbol: variable length
location: variable line of type Strin... |
s273425127 | p00066 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
line=br.readLine();
int d=line.length()/3;
char[][][] map=new char[d][3][3];
for(int i=0;i<line.length();i++){
map[(int)i/3][0][i%3]=line.char... | Main.java:22: error: incomparable types: boolean and char
if(map[i][j][0]!='s'&&map[i][j][0]==map[i][j][1]==map[i][j][2]){
^
Main.java:26: error: incomparable types: boolean and char
if(map[i][0][j]!='s'&&map[i][0][j]==map[i][1][j]==map[i][2][j]){
... |
s527442514 | p00066 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
line=br.readLine();
int d=line.length()/3;
char[][][] map=new char[d][3][3];
for(int i=0;i<line.length();i++){
map[(int)(i/3)][0][i%3]=line.ch... | Main.java:31: error: 'else' without 'if'
else if(map[i][1][1]!='s'&&map[i][0][0]==map[i][1][1]&&map[i][1][1]==map[i][2][2]){
^
1 error
|
s029078261 | p00066 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TicTacToe {
/**
* ???
*/
public static final char CIRCLE = 'o';
/**
* ??
*/
public static final char... | Main.java:8: error: class TicTacToe is public, should be declared in a file named TicTacToe.java
public class TicTacToe {
^
1 error
|
s010643411 | p00066 | Java | import java.util.Scanner;
/**
* @author MS14A
* @version 2017/03/06
*/
public class Main {
private static final String RESULT_DRAW = "d";
/**
* メインメソッド
*
* @param args
*/
public static void main(String[] args) {
// ローカルテスト用。提出時は"System.in"に修正。
InputStream input = Sy... | Main.java:18: error: cannot find symbol
InputStream input = System.in;
^
symbol: class InputStream
location: class Main
1 error
|
s224515689 | p00066 | Java | import java.util.Scanner;
public class Main {
public static char check(char ch[]) {
int i;
for(i=0;i+2<9;i+=3){
if(ch[i]==ch[i+1] && ch[i+1]==ch[i+2]) return ch[i];
}
for(i=0;i<3;i++){
if(ch[i]==ch[i+3] && ch[i+3]==ch[i+6]) return ch[i];
}
i=0;
if(ch[i]==ch[i+4] && ch[i+4]==ch[i+8]) return ch[i];
... | Main.java:24: error: unclosed character literal
if(ans=='??') ans='o';
^
Main.java:24: error: illegal character: '\u009b'
if(ans=='??') ans='o';
^
Main.java:24: error: unclosed character literal
if(ans=='??') ans='o';
^
Main.java:25: error: unclosed character literal
if... |
s966592350 | p00066 | Java | import java.util.Arrays;
import java.util.Scanner;
class Main{
int[][] f;
String solve(){
// ヨコ
for(int y=0; y<3; ++y){
int t = f[y][0];
if(t==0)continue;
boolean b = true;
for(int x=0; x<3; ++x){
b &= t==f[y][x];
}
if(b){
return t==1 ? "o" : "x";
}
}
// タテ
for(int x=0; x<... | Main.java:37: error: continue outside of loop
if(t==0)continue;
^
1 error
|
s760552912 | p00066 | C | #include <stdio.h>
int main (){
int i,j,k;
char a[3][3],b[10000];
while(1){
if(scanf("%s", input)==EOF){
break;
}
b[k]==0;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf(" %c",&a[i][j]);
}
}
for(i=0;i<3;i++){
if(a[i][1]==a[i][2]&&a[i][0]==a[i][1]){
b[k]==a[i][1];
}
}
for(i=0;i<3;i+... | main.c: In function 'main':
main.c:7:32: error: 'input' undeclared (first use in this function); did you mean 'int'?
7 | if(scanf("%s", input)==EOF){
| ^~~~~
| int
main.c:7:32: note: each undeclared identifier is reported only... |
s532426505 | p00066 | C | #include <stdio.h>
int main (){
int i,j,k;
char a[3][3],b[10000];
while(1){
if(scanf("%s", input)==EOF){
break;
}
b[k]==0;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf(" %c",&a[i][j]);
}
}
for(i=0;i<3;i++){
if(a[i][1]==a[i][2]&&a[i][0]==a[i][1]){
b[k]=a[i][1];
}
}
for(i=0;i<3;i++... | main.c: In function 'main':
main.c:7:32: error: 'input' undeclared (first use in this function); did you mean 'int'?
7 | if(scanf("%s", input)==EOF){
| ^~~~~
| int
main.c:7:32: note: each undeclared identifier is reported only... |
s853254637 | p00066 | C | #include <stdio.h>
int main (){
int i,j,k;
char a[3][3],b[10000];
while(1){
b[k]=0;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf(" %c",&a[i][j]);
}
}
if(scanf(" %c", a[0][0])==EOF){
break;
}
for(i=0;i<3;i++){
if(a[i][1]==a[i][2]&&a[i][0]==a[i][1]){
b[k]=a[i][1];
}
}
for(i=0;i<3;i... | main.c: In function 'main':
main.c:33:30: error: 'd' undeclared (first use in this function)
33 | b[k]=d;
| ^
main.c:33:30: note: each undeclared identifier is reported only once for each function it appears in
|
s672080914 | p00066 | C | #include <stdio.h>
#include <string.h>
#define N 100
int up(int A);
void down(int ans);
int main(void){
int ans,i,A[N];
char str[N];
for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
ans=5;
for(i=0;i<9;i++){
if(str[i]=='o')
A[i+1]=1;
else if(str[i]=='x')
A[i+1]=0;
else if(str[i]=='s')
A[i+1]=5;
... | main.c: In function 'main':
main.c:20:24: error: passing argument 1 of 'up' makes integer from pointer without a cast [-Wint-conversion]
20 | ans=up(A);
| ^
| |
| int *
main.c:4:12: note: expected 'int' but argumen... |
s274160600 | p00066 | C | #include <stdio.h>
#include <string.h>
#define N 100
int up(int A);
int main(void){
int ans,i,A[N];
char str[N];
for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
ans=5;
for(i=0;i<9;i++){
if(str[i]=='o')
A[i+1]=1;
else if(str[i]=='x')
A[i+1]=0;
else if(str[i]=='s')
A[i+1]=5;
}
ans=up(A);
if... | main.c: In function 'main':
main.c:19:24: error: passing argument 1 of 'up' makes integer from pointer without a cast [-Wint-conversion]
19 | ans=up(A);
| ^
| |
| int *
main.c:4:12: note: expected 'int' but argumen... |
s662602077 | p00066 | C | #include<stdio.h>
int FUNC(char s[],char A){
int M=0,K,I,J;
for(J=0;J<7;J+3){
K=0;
for(I=J;I<J+3;I++)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
}
if(M>0)return 1;
for(J=0;J<3;J++){
K=0;
for(I=J;I<J+7;J+3)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
If(M>0)return 1;
K=0;
if(s[0]==A&&s[4]==A&&s[8]==A)
return 1;
If(s[2]==1&&s... | main.c: In function 'FUNC':
main.c:24:1: error: implicit declaration of function 'If' [-Wimplicit-function-declaration]
24 | If(M>0)return 1;
| ^~
main.c:24:8: error: expected ';' before 'return'
24 | If(M>0)return 1;
| ^~~~~~
| ;
main.c:28:30: error: expected ';' before 'return'
... |
s040723329 | p00066 | C | #include<stdio.h>
int FUNC(char s[],char A){
int M=0,K,I,J;
for(J=0;J<7;J+3){
K=0;
for(I=J;I<J+3;I++)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
}
if(M>0)return 1;
for(J=0;J<3;J++){
K=0;
for(I=J;I<J+7;J+3)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
if(M>0)return 1;
K=0;
if(s[0]==A&&s[4]==A&&s[8]==A)
return 1;
if(s[2]==1&&s... | main.c: In function 'main':
main.c:33:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
33 | char s{10],A;
| ^
main.c:33:10: error: expected ';' before ']' token
33 | char s{10],A;
| ^
| ;
main.c:33:10: error: expected statement before ']' token
... |
s182280071 | p00066 | C | #include<stdio.h>
int FUNC(char s[],char A){
int M=0,K,I,J;
for(J=0;J<7;J+3){
K=0;
for(I=J;I<J+3;I++)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
}
if(M>0)return 1;
for(J=0;J<3;J++){
K=0;
for(I=J;I<J+7;J+3)
if(s[I]==A)
K++;
if(K==3){
M++;
break;
}
if(M>0)return 1;
K=0;
if(s[0]==A&&s[4]==A&&s[8]==A)
return 1;
if(s[2]==A&&s... | main.c: In function 'FUNC':
main.c:47:1: error: expected declaration or statement at end of input
47 | }
| ^
|
s685176126 | p00066 | C | #include<stdio.h>
int FUNC(char S,char A){
if(S[0]==A&&S[1]==A&&S[2]==A)
return 1;
else if(S[3]==A&&S[4]==A&&S[5]==A)
return 1;
else if(S[6]==A&&S[7]==A&&S[8]==A)
return 1
else if(S[0]==A&&S[3]==A&&S[6]==A)
return 1;
else if(S[1]==A&&S[4]==A&&S[7]==A)
return 1;
else if(S[2]==A&&S[5]==A&&S[8]==A)
return 1;
else if(S[0]=... | main.c: In function 'FUNC':
main.c:3:5: error: subscripted value is neither array nor pointer nor vector
3 | if(S[0]==A&&S[1]==A&&S[2]==A)
| ^
main.c:3:14: error: subscripted value is neither array nor pointer nor vector
3 | if(S[0]==A&&S[1]==A&&S[2]==A)
| ^
main.c:3:23: error: subs... |
s547131787 | p00066 | C | #include<stdio.h>
int FUNC(char S[],char A){
if(S[0]==A&&S[1]==A&&S[2]==A)
return 1;
else if(S[3]==A&&S[4]==A&&S[5]==A)
return 1;
else if(S[6]==A&&S[7]==A&&S[8]==A)
return 1
else if(S[0]==A&&S[3]==A&&S[6]==A)
return 1;
else if(S[1]==A&&S[4]==A&&S[7]==A)
return 1;
else if(S[2]==A&&S[5]==A&&S[8]==A)
return 1;
else if(S[0... | main.c: In function 'FUNC':
main.c:8:9: error: expected ';' before 'else'
8 | return 1
| ^
| ;
9 | else if(S[0]==A&&S[3]==A&&S[6]==A)
| ~~~~
main.c: In function 'main':
main.c:27:1: error: 'contenue' undeclared (first use in this function)
27 | contenue;
| ^~~~~~~... |
s248830569 | p00066 | C | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
char field[3][3];
while(cin >> str){
int k=0;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
field[i][j] = str[k++];
}
}
if((field[0][0] == field[0][1] && field[0][0] == field[0][2]) || (field[0][0] == field[1][0] && ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s646655693 | p00066 | C | #include <stdio.h>
int main(void){
char t[10];
while(scanf("%s",t)!=EOF){
bool o[10],x[10];
for(int i=0;i<9;++i){
o[i]=(t[i]=='o')?true:false;
x[i]=(t[i]=='x')?true:false;
}
int ans = 2;
for(int i=0;i<3;++i){
if(o[i*3]&&o[i*3+1]&&o[i*3+2]||o[i]&&o[3*1+i]&&o[3*2+i]) ans=0;
if(x[i*3]&&x[i*3+1]&&x... | main.c: In function 'main':
main.c:6:17: error: unknown type name 'bool'
6 | bool o[10],x[10];
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
... |
s610550456 | p00066 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string str;
cin >> str;
while(cin >> str){
if(str[0]==str[1]==str[2] || str[0]==str[3]==str[6] || str[0]==str[4]==str[8]){
if(str[0]==o){
cout << "o" << endl;
} else if(str[0]==x){
cout << "x" << endl;
} else if(str[8... | a.cc: In function 'int main()':
a.cc:19:36: error: 'o' was not declared in this scope
19 | if(str[0]==o){
| ^
a.cc:21:43: error: 'x' was not declared in this scope
21 | } else if(str[0]==x){
| ... |
s226637786 | p00066 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string str;
cin >> str;
while(cin >> str){
if(str[0]==str[1]==str[2] || str[0]==str[3]==str[6] || str[0]==str[4]==str[8]){
if(str[0]==o){
cout << "o" << endl;
} else if(str[0]==x){
cout << "x" << endl;
} else if(str[8... | a.cc: In function 'int main()':
a.cc:19:36: error: 'o' was not declared in this scope
19 | if(str[0]==o){
| ^
a.cc:21:43: error: 'x' was not declared in this scope
21 | } else if(str[0]==x){
| ... |
s952409493 | p00066 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string str;
cin >> str;
while(cin >> str){
if(str[0]==str[1]==str[2] || str[0]==str[3]==str[6] || str[0]==str[4]==str[8]){
if(str[0]==o){
cout << "o" << endl;
} else if(str[0]==x){
cout << "x" << endl;
} else if(str[8... | a.cc: In function 'int main()':
a.cc:19:36: error: 'o' was not declared in this scope
19 | if(str[0]==o){
| ^
a.cc:21:43: error: 'x' was not declared in this scope
21 | } else if(str[0]==x){
| ... |
s305567693 | p00066 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
char array[8]
for(int i=0;i<9;i++){
cin >> array[i];
}
for(int j=0;j<3;j++){
if(array[j*3]==array[j*3+1] && array[j*3+1]==array[j*3+2]){
if(array[j*3]=="o"){
cout >> ... | a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'for'
9 | for(int i=0;i<9;i++){
| ^~~
a.cc:9:17: error: 'i' was not declared in this scope
9 | for(int i=0;i<9;i++){
| ^
a.cc:13:17: error: expected unqualified-id before '[' token
13 | ... |
s568362275 | p00066 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
char array[8];
for(int i=0;i<9;i++){
cin >> array[i];
}
for(int j=0;j<3;j++){
if(array[j*3]==array[j*3+1] && array[j*3+1]==array[j*3+2]){
if(array[j*3]=="o"){
cout >>... | a.cc: In function 'int main()':
a.cc:14:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(array[j*3]=="o"){
| ~~~~~~~~~~^~~~~
a.cc:15:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'co... |
s728600599 | p00066 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string array;
cin >> array[i];
for(int j=0;j<3;j++){
if(array[j*3]==array[j*3+1] && array[j*3+1]==array[j*3+2]){
if(array[j*3]=="o"){
cout >> "o" >> endl;
}else if(ar... | a.cc: In function 'int main()':
a.cc:9:18: error: 'i' was not declared in this scope
9 | cin >> array[i];
| ^
a.cc:12:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(array[j*3]=="o"){
a.cc:13:22: error: no match for 'operator>>' (ope... |
s667036480 | p00066 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string a;
while(cin >> a){
if(a[0] == a[1] && a[0] == a[2] && a[0] != "s"){
if(a[0] == "o")
cout << "o" << endl;
if(a[0] == "x")
cout << "x" << endl;
}else if(a[3] == a[4] && a[3] == a[5] && a[3] != "s"){
if(a[3] == "o")
c... | a.cc: In function 'int main()':
a.cc:8:57: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(a[0] == a[1] && a[0] == a[2] && a[0] != "s"){
a.cc:9:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(a[0]... |
s652937391 | p00066 | C++ | #include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
int size(string x){
string::size_type size=x.size();
return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define sort(s... | a.cc: In function 'double pi()':
a.cc:21:16: error: 'M_PI' was not declared in this scope
21 | return M_PI;
| ^~~~
a.cc: In function 'int main()':
a.cc:29:22: error: could not convert 'ss.std::__cxx11::basic_string<char>::operator=(((const char*)"EOF"))' from 'std::__cxx11::basic_string<... |
s060161342 | p00066 | C++ | #include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
int size(string x){
string::size_type size=x.size();
return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define sort(s... | a.cc: In function 'double pi()':
a.cc:21:16: error: 'M_PI' was not declared in this scope
21 | return M_PI;
| ^~~~
a.cc: In function 'int main()':
a.cc:29:22: error: could not convert 'ss.std::__cxx11::basic_string<char>::operator=(((const char*)"EOF"))' from 'std::__cxx11::basic_string<... |
s952271564 | p00066 | C++ | #include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define endl '\n'
typedef long long ll;
typedef long double lb;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int... | a.cc:44:54: error: extended character ’ is not valid in an identifier
44 | else if (s[3] == s[4] && s[4] == s[5] && s[3] != ’s') cout << s[3] << endl;
| ^
a.cc:44:56: warning: missing terminating ' character
44 | else if (s[3] == s[4] && s[4] == s... |
s268739913 | p00066 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
int k;
while(cin>>s){
k=0;
s='1'+s;
if(s[1]==s[2]&&s[2]==s[3]&&k[1]!='s')k=1;
else if(s[4]==s[5]&&s[5]==s[6]&&k[4]!='s')k=4;
else if(s[7]==s[8]&&s[8]==s[9]&&k[7]!='s')k=7;
else if(s[1]==s[4]&&s[4]==s[7]&&k[1]... | a.cc: In function 'int main()':
a.cc:11:33: error: invalid types 'int[int]' for array subscript
11 | if(s[1]==s[2]&&s[2]==s[3]&&k[1]!='s')k=1;
| ^
a.cc:12:38: error: invalid types 'int[int]' for array subscript
12 | else if(s[4]==s[5]&&s[5]==s[6]&&k[4]!='s')k=4;
... |
s980841733 | p00066 | C++ | #include<stdio.h>
int main(void){
int str2[100], i = 0,
char str[100];
scanf("%s", str);
while (str[i] != \0) {
if ( str[i] == 'o') str2[i] = 1;
else if ( str[i] == 'x') str2[i] = 2;
else if ( str[i] == 's') str2[i] = 0;
i++
}
if ( str2[1] + str[2] + str[3] == 3 ) printf("o");
else if ... | a.cc:6:21: error: stray '\' in program
6 | while (str[i] != \0) {
| ^
a.cc: In function 'int main()':
a.cc:4:4: error: expected unqualified-id before 'char'
4 | char str[100];
| ^~~~
a.cc:5:16: error: 'str' was not declared in this scope; did you mean 'str2'?
5 | ... |
s466549059 | p00066 | C++ | #include <iostream>
#include <math.h>
#inclide <map>
#include <algorithm>
#include <vector>
#include<string>
using namespace std;
#define pb push_back;
#define ll long long;
ll mod=1000000007;
int sum1;
int main{
string a;
while(cin>>a)
{bool owin=false;
bool xwin=false;
if(a[0]==a[1]&&a[1]==a[2]){
if(a[0]=='o'){owin=... | a.cc:3:2: error: invalid preprocessing directive #inclide; did you mean #include?
3 | #inclide <map>
| ^~~~~~~
| include
a.cc:9:17: error: declaration does not declare anything [-fpermissive]
9 | #define ll long long;
| ^~~~
a.cc:10:1: note: in expansion of macro 'll'
10 |... |
s235696141 | p00066 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include<string>
using namespace std;
int main{
string a;
while(cin>>a)
{bool owin=false;
bool xwin=false;
if(a[0]==a[1]&&a[1]==a[2]){
if(a[0]=='o'){owin=true;}
else{xwin=true;}
}
if(a[3]==a[4]&&a[5]==a[4]){
if(a[4]=='o'){owin=true;}
else{xw... | a.cc:9:5: error: cannot declare '::main' to be a global variable
9 | int main{
| ^~~~
a.cc:10:8: error: expected primary-expression before 'a'
10 | string a;
| ^
a.cc:10:8: error: expected '}' before 'a'
a.cc:9:9: note: to match this '{'
9 | int main{
| ^
a.cc:11:1: error... |
s188050147 | p00066 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define ld long double
#define forever while(true)
#define
int main(){
string a;
while(cin>>a)
{
bool owin=false;
bool xwin=... | a.cc:13:9: error: no macro name given in #define directive
13 | #define
| ^
|
s539204523 | p00066 | C++ | main(){
char s[10],cel[3][3];
while(~scanf("%s",s)){
char win='d';
int i,j,cnt;
for(i=0;i<3;i++)for(j=0;j<3;j++)cel[i][j]=s[3*i+j];
for(i=0;i<3;i++){
cnt=0;
for(j=0;j<3;j++) cnt+=cel[i][j];
if(cnt==3*'o') win='o';
if(cnt==3*'x') win='x';
}
for(i=0;i<3;i++){
cnt=0;
for(j=0;j<3;j++) cnt+... | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:16: error: 'scanf' was not declared in this scope
3 | while(~scanf("%s",s)){
| ^~~~~
a.cc:30:17: error: 'printf' was not declared in ... |
s700566789 | p00066 | C++ | char*p="012345678036147258048246",f,s[11];main(i){for(;read(0,s,10);i||puts("d"))for(i=24;i>1;f-'s'&&f==s[p[i+1]-48]&f==s[p[i+2]-48]&&puts(&f,i=1))f=s[p[i-=3]-48];} | a.cc:1:8: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
1 | char*p="012345678036147258048246",f,s[11];main(i){for(;read(0,s,10);i||puts("d"))for(i=24;i>1;f-'s'&&f==s[p[i+1]-48]&f==s[p[i+2]-48]&&puts(&f,i=1))f=s[p[i-=3]-48];}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:47: e... |
s989401670 | p00066 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int size = 3;
bool check ( char hyo[size][size], char mark )
{
for (int y = 0; y < size; ++y)
for (int x = 0; x < size; ++x)
{
if (x+2 < size && hyo[y][x] == mark && hyo[y][x+1] == mark && hyo[y][x+2] == mark) { re... | a.cc:9:23: error: reference to 'size' is ambiguous
9 | bool check ( char hyo[size][size], char mark )
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:... |
s728777022 | p00066 | C++ | def get_winner(s):
for p in ['o','x']:
for i in xrange(3):
win_h=True
win_v=True
for j in xrange(3):
if s[i*3+j]!=p:
win_h=False
if s[j*3+i]!=p:
win_v=False
if win_h or win_v:
return p
if p==s[0]==s[4]==s[8] or p==s[2]==s[4]==s[5]:
return p
return 'd'
while 1:
try:
s=raw_i... | a.cc:1:1: error: 'def' does not name a type
1 | def get_winner(s):
| ^~~
|
s957597544 | p00066 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
while(getline(cin,s)){
if(s=="")break;
if(s[0]!="s"&&s[0]==s[1]&&s[1]==s[2]){cout<<s[0]<<endl;continue;}
if(s[3]!="s"&&s[3]==s[4]&&s[4]==s[5]){cout<<s[3]<<endl;continue;}
if(s[6]!="s"&&s[6]==s[7]&&s[7]==s[8]){cout<<s[6]<<endl;continue;}
if(s... | a.cc: In function 'int main()':
a.cc:8:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
8 | if(s[0]!="s"&&s[0]==s[1]&&s[1]==s[2]){cout<<s[0]<<endl;continue;}
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(s[3]!="s"&&s[3]==s[4]&&s[4]==... |
s894216196 | p00066 | C++ | #!/usr/bin/env ruby
# encoding: utf-8
while true do
num = 0
win = "0"
str = gets.chop
if str==nil then
break
end
for i in 0..2 do
if str[num]==str[num+1] && str[num]==str[num+2] then
if win=="0" then
... | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env ruby
| ^
a.cc:2:3: error: invalid preprocessing directive #encoding
2 | # encoding: utf-8
| ^~~~~~~~
a.cc:10:18: error: too many decimal points in number
10 | for i in 0..2 do
| ^~~~
a.cc:18:1... |
s796974924 | p00066 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string mas;
bool judge;
while(cin >> mas){
judge = false;
for(int i=0;i<9;i+=3){
if(mas.substr(i,3) == "ooo"){
cout << "o" << endl;
judge = true;
break;
... | a.cc: In function 'int main()':
a.cc:29:66: error: 'i' was not declared in this scope
29 | if(mas[0] == mas[4] && mas[4] == mas[8] && !judge && mas[i] != 's') {
| ^
|
s568073734 | p00066 | C++ | #include<iostream>
using namespace std;
int main(void)
{
char a[9];
while(cin>>a)
{
int x=0;
for(int i=0;i<3;i++)
{
if((a[i*3]=='o' && a[i*3+1]=='o' && a[i*3+2]=='o') || (a[i]=='o' && a[i+3]=='o' && a[i+6]=='o'))
{
cout<<'o'<<endl;
x++;
break;
}
else if(... | a.cc: In function 'int main()':
a.cc:25:11: error: 'j' was not declared in this scope
25 | j+=2;
| ^
|
s216124916 | p00066 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string in;
while(cin>>in!='\0'){
char han;
//cout<<in[0]<<endl;
if{((in[0]==in[1]&&in[1]==in[2])||(in[0]==in[4]&&in[4]==in[8])||(in[0]==in[3]&&in[3]==in[6]))if(in[0]!='s')han=in[0];}
else {if((in[2]==in[4]&&in[4]==in[6])||(in[2]==i... | a.cc: In function 'int main()':
a.cc:6:16: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'char')
6 | while(cin>>in!='\0'){
| ~~~~~~~^~~~~~
| | |
| | char
| std::basic_istream<char>
a.cc:6:16: note: candid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.