submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s626881614 | p00039 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int get_arabic(char x){
if(x=='I')return 1;
else if(x=='V')return 5;
else if(x=='X')return 10;
else if(x=='L')return 50;
else if(x=='C')return 100;
else if(x=='D')return 500;
else if(x=='M')return 1000;
}
int roma_to_arabic(string... | a.cc: In function 'int main()':
a.cc:39:11: error: 'ansers' was not declared in this scope; did you mean 'answers'?
39 | cout<<ansers[i]<<endl;
| ^~~~~~
| answers
a.cc: In function 'int get_arabic(char)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]... |
s397219248 | p00039 | C++ | #include <iostream>
#include <queue>
using namespace std;
??
??
int check(char c){
????if(c == 'I') return 1;
????else if(c == 'V') return 5;
????else if(c == 'X') return 10;
????else if(c == 'L') return 50;
????else if(c == 'C') return 100;
????else if(c == 'D') return 500;
????else if(c == 'M') return 1000;
}
??
int ... | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
a.cc:15:1: error: expected unqualified-id before '?' token
15 | ??
| ^
|
s798702605 | p00039 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void){
char s[104];
int alpha[256];
alpha['\0'] = 0;
alpha['I'] = 1;
alpha['V'] = 5;
alpha['X'] = 10;
alpha['L'] = 50;
alpha['C'] = 100;
alpha['D'] = 500;
alpha['M'] = 1000;
while(scanf("%s",s) != EOF){
int sum = 0;
int len = strlen(... | a.cc: In function 'int main()':
a.cc:20:27: error: 'strlen' was not declared in this scope
20 | int len = strlen(s);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
... |
s969992864 | p00039 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,m,i;
int n[256];
n['I']=1;
n['V']=5;
n['X']=10;
n['L']=50;
n['C']=100;
n['D']=500;
n['M']=1000;
char s[128];
while(cin >> s)
{
for(a=m=0,i=strlen(s)-1; i>=0; i--)
{
if(n[s[i]]<m) { a-=n[s[i]]; }
else { a+=m=n[s[i]]; }
}
cout << a ... | a.cc: In function 'int main()':
a.cc:19:29: error: 'strlen' was not declared in this scope
19 | for(a=m=0,i=strlen(s)-1; i>=0; i--)
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #in... |
s854790004 | p00039 | C++ | #include <iostream>
#include <string>
using namespace std;
int main()
{
int a,m,i;
int n[256];
n['I']=1;
n['V']=5;
n['X']=10;
n['L']=50;
n['C']=100;
n['D']=500;
n['M']=1000;
char s[128];
while(cin >> s)
{
for(a=m=0,i=strlen(s)-1; i>=0; i--)
{
if(n[s[i]]<m) { a-=n[s[i]]; }
else { a+=m=n[s[i]]; ... | a.cc: In function 'int main()':
a.cc:20:29: error: 'strlen' was not declared in this scope
20 | for(a=m=0,i=strlen(s)-1; i>=0; i--)
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #in... |
s689293057 | p00039 | C++ | #include <iostream>
#include <string>
using namespace std;
int To_num(char);
int Calculate(string);
int main(void){
string roma;
while(cin >> roma) cout << Calculate(roma) << endl;
return 0;
}
int Calculate(string str)
{
int ans = 0;
int now;
int next;
for(int i = 0 ; i < str.size()... | a.cc:1:2: error: stray '#' in program
1 | #include <iostream>
| ^
a.cc:1:10: error: stray '#' in program
1 | #include <iostream>
| ^
a.cc:1:17: error: stray '#' in program
1 | #include <iostream>
| ^
a.cc:1:3: error:... |
s276796587 | p00039 | C++ | IV
CCCCLXXXXVIIII
CDXCIX | a.cc:1:1: error: 'IV' does not name a type
1 | IV
| ^~
|
s902979437 | p00039 | C++ | int main() {
int a[10], b, c, n;
bool judge;
cin >> n;
REP(i, n) {
REP(j, 10) cin >> a[j];
b = 0;
c = 0;
judge = true;
REP(j, 10) {
if(a[j] < b && a[j] < c) {
judge = false;
break;
}
else if(b < a[j] && c < a[j]) {
if(b > c) b = a[j];
else c = a[j];
... | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> n;
| ^~~
a.cc:6:7: error: 'i' was not declared in this scope
6 | REP(i, n) {
| ^
a.cc:6:3: error: 'REP' was not declared in this scope
6 | REP(i, n) {
| ^~~
|
s143999296 | p00040 | Java | 1
y eazqyp pnop pngtg ye obmpngt xmybp mr lygw | Main.java:1: error: class, interface, enum, or record expected
1
^
1 error
|
s880575640 | p00040 | Java | import java.io.*:
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final static int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final static int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new B... | Main.java:1: error: ';' expected
import java.io.*:
^
Main.java:26: error: ';' expected
int[] uc=new int[4]
^
2 errors
|
s923768318 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final static int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final static int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new B... | Main.java:7: error: modifier static not allowed here
final static int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
^
Main.java:8: error: modifier static not allowed here
final static int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
^
Main.java:18: error... |
s835765324 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(... | Main.java:37: error: ')' expected
char ca=(char)(beta[b]%26+97;
^
1 error
|
s518162508 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(... | Main.java:18: error: cannot find symbol
char[] chararray=line.toCarArray();
^
symbol: method toCarArray()
location: variable line of type String
Main.java:46: error: variable i is already defined in method main(String[])
for(int i=0;i<26;i++){
^
2 errors
|
s866247106 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReader(... | Main.java:47: error: variable ga might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
^
Main.java:47: error: variable gb might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
^
2 errors
|
s256294746 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReade... | Main.java:59: error: reached end of file while parsing
}
^
1 error
|
s443367379 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReade... | Main.java:44: error: variable ga might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
^
Main.java:44: error: variable gb might not have been initialized
char nc=(char)((ga*j+gb)%26+97);
^
2 errors
|
s413783863 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReade... | Main.java:12: error: incompatible types: <null> cannot be converted to int
int ga=null;
^
Main.java:13: error: incompatible types: <null> cannot be converted to int
int gb=null;
^
2 errors
|
s555065997 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] beta={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedReade... | Main.java:17: error: cannot find symbol
ga=o;
^
symbol: variable o
location: class Main
1 error
|
s173181501 | p00040 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
class Main{
public static void main(String[] args) throws IOException{
final int[] alphas={1,3,5,7,9,11,15,17,19,21,23,25};
final int[] betas={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
BufferedReader br=new BufferedRea... | Main.java:30: error: cannot find symbol
char ct=(char)((alphas[a]*('t'-97)+beta[b])%26+97);
^
symbol: variable beta
location: class Main
Main.java:31: error: cannot find symbol
char ch=(char)((alphas[a]*('h'-97)+beta[b])%26+97);
... |
s381533320 | p00040 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class AffineCipher {
public static void main(String[] args) throws IOException {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
for ( ; n >... | Main.java:5: error: class AffineCipher is public, should be declared in a file named AffineCipher.java
public class AffineCipher {
^
1 error
|
s837680393 | p00040 | Java | import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.List; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); List<... | Main.java:1: error: reached end of file while parsing
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.List; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new Buffered... |
s050511559 | p00040 | C | #include<stdio.h>
char str[258];
int space[257];
int main() {
int s, N;
int a, b, i, j;
char n[4];
int ax[12] = {1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25};
fgets(str, 288, stdin);
for (i = 0; str[i] != '\n'; i ++);
i --; j = 1; N = 0;
for (;i > -1; i --) {
N += (str[i] - '0') * j;
j *= 10;
}
for (s = 0;... | main.c: In function 'main':
main.c:17:23: error: expected expression before '{' token
17 | str = {}
| ^
|
s050618623 | p00040 | C | #include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
char s[257],t[257];
int i,j,k,n,l;
scanf("%d\n",&n);
for(l=0;l<n;l++){
gets(s);
for(i=1;i<=26;i+=2)
for(j=0;j<=26;j++){
for(k=0,strcpy(t,s);s[k];k++)
if(s[k]... | main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
9 | gets(s);
| ^~~~
| fgets
|
s380132449 | p00040 | C | #include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
char s[257],t[257];
int i,j,k,n,l;
scanf("%d\n",&n);
for(l=0;l<n;l++){
gets(s);
for(i=1;i<=26;i+=2){
for(j=0;j<=26;j++){
for(k=0,strcpy(t,s);s[k];k++)
if(s[... | main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | gets(s);
| ^~~~
| fgets
|
s103531187 | p00040 | C | #include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
char s[257],t[257];
int i,j,k,n,l;
scanf("%d\n",&n);
for(l=0;l<n;l++){
gets(s);
for(i=1;i<=26;i+=2){
for(j=0;j<=26;j++){
for(k=0,strcpy(t,s);s[k];k++)
if(s[... | main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | gets(s);
| ^~~~
| fgets
|
s176324709 | p00040 | C | #include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
char s[257],t[257];
int i,j,k,n,l;
scanf("%d",&n);
for(l=0;l<n;l++){
gets(s);
for(i=1;i<=26;i+=2){
for(j=0;j<=26;j++){
for(k=0,strcpy(t,s);s[k];k++)
if(s[k]... | main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | gets(s);
| ^~~~
| fgets
|
s156180441 | p00040 | C | #include<stdio.h>
#include<string.h>
int main(int argc, const char * argv[]){
char s[257],t[257];
int i,j,k,n,l;
scanf("%d",&n);
for(l=0;l<n+1;l++){
gets(s);
for(i=1;i<=26;i+=2){
for(j=0;j<=26;j++){
for(k=0,strcpy(t,s);s[k];k++)
if(s[... | main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | gets(s);
| ^~~~
| fgets
|
s916277813 | p00040 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s309624593 | p00040 | C | char s[258],p[258],f[];a,v,i,t,b;main(k){if(~scanf("%*d\n%[^\n]\n"+!k*4,s))for(a=0;++a<27;){for(memset(f,b=i=v=-1,26);++i<26;f[t]=i)v&=f[t=a*i%26];for(;!~v&&++b<26;p[i]=0,strstr(p,"that")|strstr(p,"this")&&main(!puts(p)))for(i=0;s[i];i++)p[i]=s[i]-32?(f[s[i]-97]+b)%26+97:32;}exit(0);} | main.c:1:24: warning: data definition has no type or storage class
1 | char s[258],p[258],f[];a,v,i,t,b;main(k){if(~scanf("%*d\n%[^\n]\n"+!k*4,s))for(a=0;++a<27;){for(memset(f,b=i=v=-1,26);++i<26;f[t]=i)v&=f[t=a*i%26];for(;!~v&&++b<26;p[i]=0,strstr(p,"that")|strstr(p,"this")&&main(!puts(p)))for(i=0;s[i];i++)p[i]=s[... |
s577063670 | p00040 | C | /*
AizuOnline A0040
Affine Cipher
*/
#include <stdio.h>
#include <string.h>
unsigned char ango[257];
unsigned char ango2[257];
#define AZ_dif ('Z'-'A'+1)
#define DELIM " .\n"
int alpha,beta;
int devmod(char x,char y,int m)
{
int i,s,r;
//printf("xym %d %d \n",x,y);
for(i=0,s=x;i<m;i++,s+=m)
if(((s % y)==0)... | main.c:37:1: error: return type defaults to 'int' [-Wimplicit-int]
37 | main()
| ^~~~
main.c: In function 'main':
main.c:66:25: error: implicit declaration of function 'isloewer' [-Wimplicit-function-declaration]
66 | if(a1==a2 && !isloewer(p[4]))
| ^~~~~~~~
main.c:75... |
s120717458 | p00040 | C | #include"test.h"
int main()
{
char s[257],t[257];
init();
for(int i=0;i<10;i++)
{
int a=rand()%10000,b=rand()%10000;
gets(s);
strcpy(t,s);
for(int j=0,k=strlen(s);j<k;j++)
if(isalnum(s[j]))
t[j]=(a*(s[j]-'a')+b)%26+'a';
printf("%d %d\n",a,b);
puts(t);
}
return 0;
} | main.c:1:9: fatal error: test.h: No such file or directory
1 | #include"test.h"
| ^~~~~~~~
compilation terminated.
|
s036671431 | p00040 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cctype>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
int n;
cin>>n;
string str;
getline(cin.str);
while(n--){
getline(cin,str);
bool f=false;
for(int a=1... | a.cc: In function 'int main()':
a.cc:14:17: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'str'
14 | getline(cin.str);
| ^~~
|
s062313838 | p00040 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <sstream>
#include <cstdio>
using namespace std;
const int MAX= 10000100;
#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define ... | a.cc: In function 'int main()':
a.cc:37:30: error: 'x' was not declared in this scope
37 | ss=((((s[i]-'a')*x)+y)%26)+'a';
| ^
a.cc:37:33: error: 'y' was not declared in this scope
37 | ss=((((s[i]-'a')*x)+y)%26)+'a';
| ... |
s857766948 | p00040 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
int n=10;
cin>>n;
string str;
n++;
while(n--){
getline(cin,str);
for(int i=3;i<99;i++){
if(i%2==0||i%13==0)continue;
for(int j=0;j<26;j++){
vector<int>vec;
... | a.cc: In function 'int main()':
a.cc:20:17: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(vec.begin(),vec.end());
| ^~~~
| short
a.cc:21:20: error: 'unique' was not declared in this scope
21 | if(unique(vec... |
s449290203 | p00040 | C++ | #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
u... | a.cc: In function 'int main()':
a.cc:44:13: error: 'len' was not declared in this scope
44 | len = 0;
| ^~~
|
s080043461 | p00040 | C++ | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
//Affine Cipher
public class AOJ0040 {
static long gcd(long a, long b){
if(a < b){
long tmp = a;
a = b;
b = tmp;
}
while(b!=0){
long r = a%b;
a = b;
b = r;
}
return a;
}
public static void main(String[] args) {
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.HashSet;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-... |
s978353358 | p00040 | C++ | #include <bits/stdc++.h>
#define rep(i,a) for(int i = 0;i < (a); i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)
using namespace std;
int n;
int main(){
cin >> n;
cin.ignore();
while(n--){
vector<string> str;
string tmp;
getline(cin,tmp);
stringstream ss;
ss... | a.cc: In function 'int main()':
a.cc:17:30: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pb'
17 | while(ss >> tmp) str.pb(tmp);
| ^~
|
s649157844 | p00040 | C++ | #include<iostream>
#include<string>
#include<stdio.h>
int main(){
string s;
int n;
cin>>n;
for(int u=0;u<n;u++){
getline(cin,s);
int a=0;
bool t=false;
while(true){
int b=0;
while(true){
for(int i=0;i<s.size();i++){
if(isalpha(s[i])!=0)
s[i]=(a*(s[i]-'a')+b)%26+'a';
}
for... | a.cc: In function 'int main()':
a.cc:5:2: error: 'string' was not declared in this scope
5 | string s;
| ^~~~~~
a.cc:5:2: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,... |
s586708856 | p00040 | C++ | 1
y eazqyp pnop pngtg ye obmpngt xmybp mr lygw | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s370830802 | p00040 | C++ | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
bool IsCoprime(int a, int b)
{
while (a > 0 && b > 0)
{
if (a < b) swap(a, b);
a %= b;
}
if (a == 1 || b == 1) return true;
return false;
}
char get(int a, int b, char c)
{
for (int i = 0; i < 26; i++)
{
if ((a * i + b) % 2... | a.cc:58:9: error: stray '\32' in program
58 | <U+001A>
| ^~~~~~~~
a.cc: In function 'char get(int, int, char)':
a.cc:25:1: warning: control reaches end of non-void function [-Wreturn-type]
25 | }
| ^
|
s211979482 | p00040 | C++ | #include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>
#include<cmath>
using namespace std;
int inf = 1000000000;
char affine(char c, int a, int b){
int x = c - 'a';
int y = ( a * x + b ) % 26;
char r = 'a' + y;
return r;
}
int main(){
int n;
cin >> n;
... | a.cc: In function 'int main()':
a.cc:28:28: warning: division by zero [-Wdiv-by-zero]
28 | if( i %= 2 == 0 || i %= 13 == 0 ) continue;
| ~~~~~~~~~~~~^~~~~~~~~~
a.cc:28:23: error: lvalue required as left operand of assignment
28 | if( i %= 2 == 0 || i %= 13 == 0 ) continue;
|... |
s770918652 | p00040 | C++ | #include<stdio.h>
#include<string.h>
char c[257];
char d[257];
bool use[26];
int main(){
int a;
scanf("%d ",&a);
while(a--){
gets(c);
int t=strlen(c);
for(int i=0;i<26;i++){
for(int j=0;j<26;j++){
bool ok=false;
for(int k=0;k<26;k++)use[k]=false;
for(int k=0;k<26;k++){
if(use[(i*k+j)%26])go... | a.cc: In function 'int main()':
a.cc:10:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(c);
| ^~~~
| getw
|
s366307552 | p00040 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <map>
using namespace std;
char encode(char x,int a,int b){
return ( ( a * (x-'a') + b) % 26 ) + 'a';
}
char decode(char x, int a, int b){
int t = ( x - 'a') - b;
while( (t%a) != 0 ) t += 26;
return (t/a) % 26 + 'a';
}
string encode(string s, int a... | a.cc: In function 'int main()':
a.cc:42:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
42 | gets( foo );
| ^~~~
| getw
|
s915424717 | p00040 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <map>
using namespace std;
char encode(char x,int a,int b){
return ( ( a * (x-'a') + b) % 26 ) + 'a';
}
char decode(char x, int a, int b){
int t = ( x - 'a') - b;
while( (t%a) != 0 ) t += 26;
return (t/a) % 26 + 'a';
}
string encode(string s, int a... | a.cc: In function 'int main()':
a.cc:42:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
42 | gets( foo );
| ^~~~
| getw
|
s627198463 | p00040 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
using namespace std;
type... | a.cc: In function 'int main()':
a.cc:37:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
37 | gets(s);
| ^~~~
| getw
|
s452124501 | p00040 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
using namespace std;
type... | a.cc: In function 'int main()':
a.cc:37:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
37 | gets(s);
| ^~~~
| getw
|
s600430511 | p00040 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
using namespace std;
type... | a.cc: In function 'int main()':
a.cc:37:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
37 | gets(s);
| ^~~~
| getw
a.cc:47:69: error: expected primary-expression before ')' token
47 | if('a'... |
s763270826 | p00040 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
using namespace std;
type... | a.cc: In function 'int main()':
a.cc:37:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
37 | gets(s);
| ^~~~
| getw
|
s624065915 | p00040 | C++ | #include <iostream>
#include <string>
#include <ctype.h>
using namespace std;
string solve(string cipher)
{
for ( ; ; ) {
for (int a = 1; ; ++a) {
if (__gcd(a, 26) != 1)
continue;
bool decrypt = false;
for (int b = 0; b < 26; ++b) {
string plain = cipher;
for (unsigned int i = 0; i < plain.s... | a.cc: In function 'std::string solve(std::string)':
a.cc:10:11: error: '__gcd' was not declared in this scope
10 | if (__gcd(a, 26) != 1)
| ^~~~~
|
s089453875 | p00040 | C++ | #include <iostream>
#include <string>
#define rep(i) for(I64 i=0;;++i)
#define repn(i,n) for(I64 i=0;i<(n);++(i))
using namespace std;
bool coprime(int a, int b){
int r, temp;
if(a < b){
temp = a;
a = b;
b = temp;
}
do{
r = a % b;
a = b;
b = r;
}while(r);
if(a == 1) return true;
else return false;
}... | a.cc: In function 'int main()':
a.cc:4:23: error: 'I64' was not declared in this scope
4 | #define repn(i,n) for(I64 i=0;i<(n);++(i))
| ^~~
a.cc:31:9: note: in expansion of macro 'repn'
31 | repn(i, n){
| ^~~~
a.cc:31:14: error: 'i' was not declared in this scope... |
s919841007 | p00040 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner cin = new Scanner(System.in);... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fm... |
s937251924 | p00040 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fm... |
s889476791 | p00040 | C++ | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int F(int alpha,int beta,int ch){
return (alpha*ch+beta)%26;
}
int gcd(int a,int b){
return b==0?a:gcd(b,a%b);
}
int main(){
int n;
string in,s,ans;
cin>>n;
getline(cin,in);
while(n--){
getline(cin,in);
for(int i=1;i<26;i++){
i... | a.cc: In function 'int main()':
a.cc:23:41: error: 'table' was not declared in this scope; did you mean 'mutable'?
23 | table[F(i,j,k)] = k;
| ^~~~~
| mutable
a.cc:28:53: error: 'table'... |
s359252128 | p00040 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cstdio>
#include <sstream>
#include <math.h>
#include <boost/math/common_factor.hpp>
using namespace std;
string check(string str);
map<char, int> create_table();
int main(){
char ch = 'a';
string str;
int num;
vector<string> an... | a.cc:8:10: fatal error: boost/math/common_factor.hpp: No such file or directory
8 | #include <boost/math/common_factor.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s766992738 | p00041 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import org.apache.el.stream.Stream;
public class Main {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReade... | Main.java:8: error: package org.apache.el.stream does not exist
import org.apache.el.stream.Stream;
^
1 error
|
s954897625 | p00041 | Java | import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
class Main {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
List<Integer> ints = new ArrayList<>();
ints.add(in.nextInt());
ints.add(in.nextInt());
ints... | Main.java:106: error: '}' expected
"a x (a x (a x a))"
^
Main.java:110: error: illegal start of type
for(int a=0;a<4;a++) {
^
Main.java:110: error: illegal start of type
for(int a=0;a<4;a++) {
^
Main.java:110: error: <identifier> expected
for(int a=0;a<4;a++) {
... |
s592206810 | p00041 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
public class Main{
static int NUM = 4;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(ne... | Main.java:141: error: reached end of file while parsing
}
^
1 error
|
s634986639 | p00041 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
public class Main{
static int NUM = 4;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(ne... | Main.java:140: error: reached end of file while parsing
}
^
1 error
|
s274456267 | p00041 | C | typedef string::const_iterator State;
const string C[5] = {"((a x b) x c) x d",
"(a x (b x c)) x d",
"a x ((b x c) x d)",
"a x (b x (c x d))",
"(a x b) x (c x d)"};
const char P[3] = {'+','-','*'};
int term(State &now);
int expression(State &now);
int fact(State &now);
int number(State &n... | main.c:1:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
1 | typedef string::const_iterator State;
| ^~
main.c:3:7: error: unknown type name 'string'
3 | const string C[5] = {"((a x b) x c) x d",
| ^~~~~~
main.c:4:22: error: excess elements in 'const... |
s214254008 | p00041 | C | #include<stdio.h>
#include<stdlib.h>
int calc(int x, int y, int z)
{
switch (z){
case 0: return (x + y);
case 1: return (x - y);
case 2: return (x * y);
}
}
int hantei(int a, int b, int c, int d){
char en[3]={'+','-','*'};
for(i=0;i<3;i++){
for(j=0;j<3;j++){
int(k=0;k<3;k++){
if (calc(calc(a, ... | main.c: In function 'hantei':
main.c:13:9: error: 'i' undeclared (first use in this function)
13 | for(i=0;i<3;i++){
| ^
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:11: error: 'j' undeclared (first use in this function)
14 | ... |
s447380197 | p00041 | C | #include<stdio.h>
#include<stdlib.h>
int calc(int x, int y, int z)
{
switch (z){
case 0: return (x + y);
case 1: return (x - y);
case 2: return (x * y);
}
}
int hantei(int a, int b, int c, int d){
char en[3]={'+','-','*'};
int i,j,k;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
int(k=0;k<3;k++){
if ... | main.c: In function 'hantei':
main.c:17:14: error: expected ')' before '=' token
17 | int(k=0;k<3;k++){
| ^
| )
main.c: In function 'main':
main.c:32:8: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
32 | if(check(a, b, c, d)) co... |
s641823556 | p00041 | C | #include<stdio.h>
#include<stdlib.h>
int calc(int x, int y, int z)
{
switch (z){
case 0: return (x + y);
case 1: return (x - y);
case 2: return (x * y);
}
}
int hantei(int a, int b, int c, int d){
int i,j,k;
char en[3]={'+','-','*'};
for(i=0;i<3;i++){
for(j=0;j<3;j++){
for(k=0;k<3;k++){
if (... | main.c: In function 'main':
main.c:31:8: error: implicit declaration of function 'check' [-Wimplicit-function-declaration]
31 | if(check(a, b, c, d)) continue;//??¨??????????????´?????????
| ^~~~~
|
s417096073 | p00041 | C | d[4],e[9],f,k;char s[30];z(){int b,c,a=e[f++];a>9?s[k++]=40,b=z(),s[k++]=a,c=z(),s[k++]=41,a=a-43?a-45?b*c:b-c:b+c:(s[k++]=a+48);return a;}y(o,n,i,j){if(i==7){f=k=0;if(z()==10){s[k]=0;puts(s);return 1;}return 0;}if(o)for(;j--;){e[i]="+-*"[];if(y(o-1,n+1,i+1,3))return 1;}if(n|i==6)for(j=4;j--;)if(e[i]=d[j]){d[j]=0;if(y(... | main.c:1:1: warning: data definition has no type or storage class
1 | d[4],e[9],f,k;char s[30];z(){int b,c,a=e[f++];a>9?s[k++]=40,b=z(),s[k++]=a,c=z(),s[k++]=41,a=a-43?a-45?b*c:b-c:b+c:(s[k++]=a+48);return a;}y(o,n,i,j){if(i==7){f=k=0;if(z()==10){s[k]=0;puts(s);return 1;}return 0;}if(o)for(;j--;){e[i]="+-*"[];if(y(... |
s623551923 | p00041 | C | #include <stdio.h>
int main(void){
int t;
while(~scanf("%d",&t)){
if(t<0 || t>=10) return 1;
return 0;
} | main.c: In function 'main':
main.c:9:1: error: expected declaration or statement at end of input
9 | }
| ^
|
s515041246 | p00041 | C | #include<stdio.h>
#include<stdlib.h>
#define NG -1
#define TRUE 1
#define FALSE 0
void cal(int a,int b,int c,int d,int *flag);
int main(){
int i,j,k,l,no[4],flag;
char ans[20];
while(scanf("%d %d %d %d",&no[0],&no[1],&no[2],&no[3])!=EOF){
if(!no[0] && !no[1] && !no[2] && !no[3]) break;
flag=FALSE;
for(i=... | main.c: In function 'main':
main.c:24:65: error: too many arguments to function 'cal'
24 | cal(no[i],no[j],no[k],no[l],&flag,ans);
| ^~~
main.c:8:6: note: declared here
8 | void c... |
s436001107 | p00041 | C | main(a){for(;++a<2e5;)printf("(");for(;gets(&a),*a%16;)puts(&a);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(a){for(;++a<2e5;)printf("(");for(;gets(&a),*a%16;)puts(&a);}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:23: error: implicit declaration of function 'printf' [-Wimplicit... |
s153750227 | p00041 | C | int main(){
while(true){}
return 0;
} | main.c: In function 'main':
main.c:2:7: error: 'true' undeclared (first use in this function)
2 | while(true){}
| ^~~~
main.c:1:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
+++ |+#include <stdbool.h>
1 | int main(){
main.c:2:7: note:... |
s127585720 | p00041 | C | int main(void){
while(true);
return 0;
} | main.c: In function 'main':
main.c:2:7: error: 'true' undeclared (first use in this function)
2 | while(true);
| ^~~~
main.c:1:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
+++ |+#include <stdbool.h>
1 | int main(void){
main.c:2:7: no... |
s713572594 | p00041 | C++ | #!ruby -pal
exit if$_[0]==?0
t=[?+,?-,?*]
$_=$F.permutation(4).to_a.product(t.product(t,t),[1,2,3].product([1,2])).map{|a,b,c|c.inject(a.zip(b).flatten){|s,r|r*=2;s[r-2..r]=?(+s[r-2..r]*""+?);s}*""}.find{|i|eval(i)==10}||0 | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!ruby -pal
| ^
a.cc:4:126: error: too many decimal points in number
4 | $_=$F.permutation(4).to_a.product(t.product(t,t),[1,2,3].product([1,2])).map{|a,b,c|c.inject(a.zip(b).flatten){|s,r|r*=2;s[r-2..r]=?(+s[r-2..r]*""+?);s}*""}.find{|i|eval(i)==10... |
s979737829 | p00041 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
const string op = "+-*";
string S(int x) {
stringstream ss;
ss << x;
return ss.str();
}
int calc(int a, char op, int b) {
if (op == '+') return a + b;
if (o... | a.cc:22:14: error: 'vector' was not declared in this scope
22 | string solve(vector<int> a) {
| ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
4 | #include <algorithm>
+++ |+#include <vector>
5 | using namespac... |
s647528272 | p00041 | C++ | #include <iostream>
using namespace std;
char ans[1024];
int number[4];
int usednum[4];
int num[4];
int ope[3];
int solve(int c, int o);
int check();
void makeEx();
int main() {
int i, count = 0;
while (1) {
memset(usednum, 0, sizeof(usednum));
for (i = 0; i < 4; i++) {
cin >> number[i];
if (number[i] ... | a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
19 | memset(usednum, 0, sizeof(usednum));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iost... |
s397261929 | p00041 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
char ans[1024];
int number[4];
int usednum[4];
int num[4];
int ope[3];
int solve(int c, int o);
int check();
void makeEx();
int main() {
int i, count = 0;
while (1) {
memset(usednum, 0, sizeof(usednum));
for (i = 0; i < 4; i++) {
cin >> number[i];... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(usednum, 0, sizeof(usednum));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstd... |
s419525927 | p00041 | C++ | typedef string::const_iterator State;
const string C[5] = {"((a x b) x c) x d",
"(a x (b x c)) x d",
"a x ((b x c) x d)",
"a x (b x (c x d))",
"(a x b) x (c x d)"};
const char P[3] = {'+','-','*'};
int term(State &now);
int expression(State &now);
int fact(State &now);
int number(State &n... | a.cc:1:9: error: 'string' does not name a type
1 | typedef string::const_iterator State;
| ^~~~~~
a.cc:3:7: error: 'string' does not name a type
3 | const string C[5] = {"((a x b) x c) x d",
| ^~~~~~
a.cc:11:10: error: 'State' was not declared in this scope
11 | int term(State &now)... |
s530701674 | p00041 | C++ | #include<vector>
#include<sstream>
using namespace std;
string s="true";
string i2s(int n){
stringstream x;
x<<n;
return x.str();
}
bool calc(int a,int b){
if(a+b==10) {
s+="+";
return true;
}
if(a-b==10){
s+="-";
return true;
}
if(a*b==10) {
s+="*";
return true;
}
return fal... | a.cc: In function 'int main()':
a.cc:96:9: error: 'cin' was not declared in this scope
96 | while(cin>>a[0]>>a[1]>>a[2]>>a[3],a[0]||a[1]||a[2]||a[3]){
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<sstream>... |
s581821991 | p00041 | C++ | #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#include<complex>
using namespace std;
typedef complex<double> P;
#define X real()
#define Y imag()
int d[4];
bool f=0;
const char *op="+-*";
int cal(int a,int o,int b){
if(o=... | a.cc: In function 'bool sol(int, int, int)':
a.cc:27:5: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
27 | f++;
| ^
a.cc:34:9: error: 'reeturn' was not declared in this scope
34 | reeturn true;
| ^~~~~~~
a.cc: In function 'bool jg()':
a.cc:51:1: ... |
s982893960 | p00041 | C++ | #include<iostream>
#include<stack>
#include<string>
const int N = 4;
const char *oprs = "+-*";
int operands[N];
int bExist = false;
using namespace std;
int generateExpression(int *oprpos, int *opr, int *operand, int n, int *e){
int t = 0;
int eIndex = 0;
int nextOperand = 0;
e[eIndex++] = operands[operand[next... | a.cc: In function 'int calculateExpression(int*, int, std::string&)':
a.cc:71:25: error: 'itoa' was not declared in this scope
71 | itoa( opr, stroperand, 10 );
| ^~~~
|
s871325112 | p00041 | C++ | #include<iostream>
#include<cstdlib>
#include<stack>
#include<string>
const int N = 4;
const char *oprs = "+-*";
int operands[N];
int bExist = false;
using namespace std;
int generateExpression(int *oprpos, int *opr, int *operand, int n, int *e){
int t = 0;
int eIndex = 0;
int nextOperand = 0;
e[eIndex++] = ope... | a.cc: In function 'int calculateExpression(int*, int, std::string&)':
a.cc:72:25: error: '_itoa' was not declared in this scope
72 | _itoa( opr, stroperand, 10 );
| ^~~~~
|
s153074982 | p00041 | C++ | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
int ope(int ... | a.cc: In function 'void solve(std::vector<int>)':
a.cc:39:66: error: 'k' was not declared in this scope
39 | cout << "((" << a[0] << c[i] << a[1] << ')' << c[k] << '(' << a[2] << c[j] << a[3] << "))" << endl;
| ^
a.cc:39:89: error... |
s571618104 | p00041 | C++ | #include<stdio.h>
#include<ctype.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef vector<char>V;
int a[4];
string P(V&v,int&i)
{
int f=isdigit(v[i]);
string s;
s+=v[i--];
if(!f)
{
s+=" "+P(v,i)+')';
s='('+P(v,i)+' '+s;
}
return s;
}
int F(V v,int i,int n)
{
if(v.size()-7... | a.cc: In function 'int F(V, int, int)':
a.cc:28:24: error: 'strcat' was not declared in this scope
28 | if(n>1)strcat(s,"+-*");
| ^~~~~~
a.cc:6:1: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include<alg... |
s860946998 | p00041 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
char conv(int o)
{
if(o==0) return '+';
if(o==1) return '-';
if(o==2) return '*';
}
int calc(int m,int n,int o)
{
if(o==0) return m+n;
if(o==1) return m-n;
if(o==2) return m*n;
}
int main()
{
int nums[4];
while(cin>>nums[0]>>nums[1]>>nums[2]>>nums[3]... | a.cc: In function 'int main()':
a.cc:70:33: error: 'next_permutation' was not declared in this scope
70 | } while (!flag&&next_permutation(nums,nums+4));
| ^~~~~~~~~~~~~~~~
a.cc: In function 'char conv(int)':
a.cc:10:1: warning: control reaches end of non-void fu... |
s884746719 | p00041 | C++ | main(a){for(;++a<2e5;)printf("(");for(;gets(&a);)puts(&a);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a){for(;++a<2e5;)printf("(");for(;gets(&a);)puts(&a);}
| ^
|
s351263367 | p00041 | C++ | #include <stdio.h>
int main(){
int a[4];
for(int i = 0; i < 100000; ++i) putchar('(');
while(1){
for(int i = 0; i < 4; ++i){
scanf_s("%d", &a[i]);
}
if(a[0] == 0){ break; }
printf("%d+%d+%d+%d", a[0], a[1], a[2], a[3]);
putchar('\n');
}
} | a.cc: In function 'int main()':
a.cc:8:13: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | scanf_s("%d", &a[i]);
| ^~~~~~~
| scanf
|
s898824472 | p00041 | C++ | #include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
typedef vector <vi> vvi;
#define REP(i,n) for (int i=0; i<n; i++)
#define I2S(i) to_string(i)
vvi permutations(vi x){
vvi buf;
int n=x.size(), i=0;
sort(x.begin(),x.end());
... | a.cc: In function 'vvi products(vi, int)':
a.cc:27:34: error: 'pow' was not declared in this scope
27 | int n2=x.size(), n3=(int)pow(n2,n);
| ^~~
a.cc: In function 'int op(int, int, int)':
a.cc:50:1: warning: control reaches end of non-void function [-Wreturn-type]
5... |
s153121216 | p00041 | C++ | #include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef vector <int> vi;
typedef vector <vi> vvi;
#define REP(i,n) for (int i=0; i<n; i++)
#define ALL(x) x.begin(), x.end()
string i2s(int n)
{
stringstream ss;
ss << n;
return ss.str();
}
vvi p... | a.cc: In function 'vvi products(vi, int)':
a.cc:34:34: error: 'pow' was not declared in this scope
34 | int n2=x.size(), n3=(int)pow(n2,n);
| ^~~
a.cc: In function 'int op(int, int, int)':
a.cc:57:1: warning: control reaches end of non-void function [-Wreturn-type]
5... |
s906486941 | p00042 | Java | #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#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 it ::iterator
#define all(in) in.begin(),in.end... | Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<string>
^
Main.java:3: error: illegal character: '#'
#include<algorithm>
^
Main.java:4: error: illegal character: '#'
#include<map>
^
Main.java:5: error: illegal character: '#'
#include<set>
^
Main.java:6... |
s146777043 | p00042 | Java | import java.io.*;
import java.util.StringTokenizer;
class Item {
int cost,weight;
Item(int c,int w) {
this.cost = c;
this.weight = w;
}
}
class Main {
private static final int NOT_ADD = -1;
public static void main (String args[]) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReade... | Main.java:22: error: not a statement
long long count = 1;
^
Main.java:22: error: ';' expected
long long count = 1;
^
2 errors
|
s139313587 | p00042 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int count=1;
while(!(line=br.readLine()).equals("0")){
int weight=0;
static int W=Integer.parseInt(line);
static int n=Integer.parseInt(br.rea... | Main.java:10: error: illegal start of expression
static int W=Integer.parseInt(line);
^
Main.java:16: error: illegal start of type
for(int i=0;i<n;i++){
^
Main.java:16: error: > or ',' expected
for(int i=0;i<n;i++){
^
Main.java:16: error: <identifier> expected
for(int i=0;i<n;i++){
^
Mai... |
s929169221 | p00042 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int count=1;
while(!(line=br.readLine()).equals("0")){
int weight=0;
static int W=Integer.parseInt(line);
static int n=Integer.parseInt(br.re... | Main.java:10: error: illegal start of expression
static int W=Integer.parseInt(line);
^
Main.java:16: error: illegal start of type
for(int i=0;i<n;i++){
^
Main.java:16: error: > or ',' expected
for(int i=0;i<n;i++){
^
Main.java:16: error: <identifier> expected
for(int i=0;i<n;i++){
^
Mai... |
s283718932 | p00042 | Java | import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int count=1;
while(!(line=br.readLine()).equals("0")){
int weight=0;
int W=Integer.parseInt(line);
int n=Integer.parseInt(br.readLine());
in... | Main.java:31: error: illegal start of expression
private static int MaxValue(int W,int n,int[] v,int[] w,int[][] dp,boolean[] use,int i,int j){
^
1 error
|
s601610536 | p00042 | Java | import java.util.Scanner;
public class AOJ_0042 {
Scanner sc = new Scanner(System.in);
void run() {
for (int T = 1;; T++) {
int W = sc.nextInt();
if (W == 0) return;
int N = sc.nextInt();
int[] v = new int[N];
int[] w = new int[N];
for (int i = 0; i < N; i++) {
String[] in = sc.next().split(... | Main.java:3: error: class AOJ_0042 is public, should be declared in a file named AOJ_0042.java
public class AOJ_0042 {
^
1 error
|
s394930349 | p00042 | Java | public class Main {
Scanner sc = new Scanner(System.in);
class t implements Comparable<t> {
int worth;
int weight;
t(String s) {
Scanner sc = new Scanner(s.replace(',', ' '));
worth = sc.nextInt();
weight = sc.nextInt();
}
public int compareTo(t o) {
return this.weight - o.weight;
}
}
vo... | Main.java:2: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:9: error: cannot find symbol
Sca... |
s277284127 | p00042 | Java | package jp.ac.innami.volume0;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class AThief {
protected static final int MAX_BAG_WEIGHT = 1000;
protected static final int MAX_NUM_TREASURES = 1000;
protecte... | Main.java:9: error: class AThief is public, should be declared in a file named AThief.java
public class AThief {
^
1 error
|
s986188406 | p00042 | Java | package jp.ac.innami.volume0;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class Main {
protected static final int MAX_BAG_WEIGHT = 1000;
protected static final int MAX_NUM_TREASURES = 1000;
protected ... | Main.java:71: error: cannot find symbol
treasures = new ArrayList<Treasure>(AThief.MAX_NUM_TREASURES);
^
symbol: variable AThief
location: class Bag
1 error
|
s391530192 | p00042 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class Main {
protected static final int MAX_BAG_WEIGHT = 1000;
protected static final int MAX_NUM_TREASURES = 1000;
protected static final int MAX_VALUE = 10... | Main.java:69: error: cannot find symbol
treasures = new ArrayList<Treasure>(AThief.MAX_NUM_TREASURES);
^
symbol: variable AThief
location: class Bag
1 error
|
s856667714 | p00042 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class Main {
protected static final int MAX_BAG_WEIGHT = 1000;
protected static final int MAX_NUM_TREASURES = 1000;
protected static final int MAX_VALUE = 10000;
... | Main.java:47: error: cannot find symbol
public static int[] getMaxValue(int bagWeight, ArrayList<Treasure> treasureList){
^
symbol: class Treasure
location: class Main
Main.java:20: error: cannot find symbol
ArrayList<Treasure> treasureList;
... |
s048952328 | p00042 | Java | import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Main2 {
static int W,N;
static int[][] dp;
static int[][] a;
static int max,minw;
static Stack<Integer>stack;
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
int T=0;
for(;;){
T++;
W=... | Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s733880101 | p00042 | Java | import java.util.*;
public class AOJ_0042{
void run(){
Scanner sc = new Scanner(System.in);
int case_cnt = 1;
while(true){
int W = sc.nextInt();
if(W == 0){
break;
}
int N = sc.nextInt();
int[] value = new int[N];
... | Main.java:3: error: class AOJ_0042 is public, should be declared in a file named AOJ_0042.java
public class AOJ_0042{
^
1 error
|
s221872624 | p00042 | C | #include<stdio.h>
#include<stdlib.h>
int main(void)
{
int count = 0;
int W;
int N;
while(scanf("%d",&W)){
if(W==0) break;
count++;
scanf("%d",&N);
char c;
int va;//お宝の価値
int wi;//お宝の重さ
int li[W+1];//袋の限界
int i,j;
for(i=0;i<=W;i++)
li[i]=0;//お宝が入っていない
for(i=0;i... | main.c: In function 'main':
main.c:44:3: error: expected declaration or statement at end of input
44 | }
| ^
|
s018240152 | p00042 | C | #include<stdio.h>
int w, n, value[1000], weight[1000];
int search(int i, int w, int value_s) {
if (i == n) {
return value_s;
}
else if (w < weight[i]) {
return search(i + 1, w, value_s);
}
else {
int result1 = search(i + 1, w, value_s);
int result2 = search(i + 1, w - weight[i], value_s + value[i]);
r... | main.c: In function 'search':
main.c:14:24: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
14 | return max(result1, result2);
| ^~~
|
s641400280 | p00042 | C | #include<stdio.h>
#define max(a,b)(((a)>(b))>(a):(b))
int w, n, value[1001], weight[1001];
int weight_s,dp[1001][1001];
void search() {
for (int i = 0; i < n; i++) {
for (int j = 0; j <= w; j++) {
if (j < weight[i]) {
dp[i + 1][j] = dp[i][j];
}else{
dp[i + 1][j] = max(dp[i][j],dp[i][j-weight[i]]+value... | main.c: In function 'search':
main.c:2:31: error: expected ')' before ':' token
2 | #define max(a,b)(((a)>(b))>(a):(b))
| ~ ^
main.c:12:48: note: in expansion of macro 'max'
12 | dp[i + 1][j] = max(dp[i][j],dp[i][j-weight[i]]+value[i]);
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.