submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s944266292 | p00106 | C++ | #include<iostream>
using namespace std;
int w[]={2,3,5,10,12,15};
int v[]={380,550,850,1520,1870,2244};
int dp[50+1];
void solve(){
for(int i=0;i<51;i++){
dp[i]=INT_MAX/3;
}
dp[0]=0;
for(int i=0;i<6;i++){
for(int j=w[i];j<=50;j++){
dp[j]=min(dp[j],dp[j-w[i]]+v[i]);
... | a.cc: In function 'void solve()':
a.cc:10:15: error: 'INT_MAX' was not declared in this scope
10 | dp[i]=INT_MAX/3;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include<iostream>
+++ |+#include <cl... |
s633555876 | p00106 | C++ | #include<iostream>
using namespace std;
int w[]={2,3,5,10,12,15};
int v[]={380,550,850,1520,1870,2244};
int dp[50+1];
void solve(){
for(int i=0;i<51;i++){
dp[i]=INT_MAX/3;
}
dp[0]=0;
for(int i=0;i<6;i++){
for(int j=w[i];j<=50;j++){
dp[j]=min(dp[j],dp[j-w[i]]+v[i]);
... | a.cc: In function 'void solve()':
a.cc:10:15: error: 'INT_MAX' was not declared in this scope
10 | dp[i]=INT_MAX/3;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include<iostream>
+++ |+#include <cl... |
s705905342 | p00106 | C++ | #include<iostream>
#include<algorithm>
#define INF 1<<28
using namespace std;
int solve(int n){
int res = INF;
if(!n) return 0;
if(n < 0) return INF;
return res = min(res, min(solve(n-1000)+1520, min(solve(n-1200)+1870, min(solve(n-1500)+2244, min(solve(n-200)+380, min(solve(n-300)+550, solve(n-500)+850))))));... | a.cc:13:5: error: cannot declare '::main' to be a global variable
13 | int main(n){ while(cin >> n, n) cout << solve(n) << endl; }
| ^~~~
a.cc:13:10: error: 'n' was not declared in this scope
13 | int main(n){ while(cin >> n, n) cout << solve(n) << endl; }
| ^
|
s917132360 | p00106 | C++ | #include<iostream>
#include<cstring>
#include<algorithm>
#define Kinds 6
#define DP 50
const int cost[Kinds]={380,550,850,380*5*0.8,550*4*0.85,850*3*0.88};
const int Volume[Kinds]={200,300,500,1000,1200,1500};
unsigned int dp[DP];
int main(){
int n;
memset(dp,10000000,sizeof(dp));
dp[0]=0;
for(int i=0;i<DP;++i... | a.cc:7:41: error: narrowing conversion of '1.52e+3' from 'double' to 'int' [-Wnarrowing]
7 | const int cost[Kinds]={380,550,850,380*5*0.8,550*4*0.85,850*3*0.88};
| ~~~~~^~~~
a.cc:7:51: error: narrowing conversion of '1.87e+3' from 'double' to 'int' [-Wnarrowing]
7 | cons... |
s642310949 | p00107 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(true){
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a==0&&ab==0&&c==0) break... | Main.java:10: error: cannot find symbol
if(a==0&&ab==0&&c==0) break;
^
symbol: variable ab
location: class Main
1 error
|
s823214829 | p00107 | Java | import java.util.*;
public class Main
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int[] x = new int[3];
for(int i = 0; i < 3; i++){
x[i] = stdIn.nextInt();
}
while( x[0] != 0 || x[1] != 0 || x[2] != 0 ){
for(int i = 0; i < 3; i++){
int max = i;
for(int j ... | Main.java:3: error: '{' expected
public class Main
^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
^
(use --enable-preview to enable unnamed classes)
Main.java:39: error: class, interface, enum, or record... |
s576643488 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
for(;;)
{
scanf("%d",&d);
if(d==0 0 0) break;
if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d:d)
printf("OK");
else
("NA");
}
return 0;
} | main.c: In function 'main':
main.c:8:13: error: 'd' undeclared (first use in this function)
8 | scanf("%d",&d);
| ^
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:8: error: expected ')' before numeric constant
9 | if(d==0 0 0) break... |
s047857190 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
for(;;)
{
scanf("%d",&d);
if(d==0 0 0) break;
if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d:d)
printf("OK");
else
("NA");
}
return 0;
} | main.c: In function 'main':
main.c:9:8: error: expected ')' before numeric constant
9 | if(d==0 0 0) break;
| ~ ^~
| )
main.c:10:48: error: expected ')' before ':' token
10 | if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d:d)
| ~ ^
... |
s053831173 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c,d,e,f;
scanf("%d %d %d",&a,&b,&c);
for(;;)
{
scanf("%d",&d);
if(d==0) scanf("%d %d",&e,&f);
if(e==0 && f==0)break;
if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d:d)
printf("OK");
else
("NA");
}
return 0;
} | main.c: In function 'main':
main.c:11:48: error: expected ')' before ':' token
11 | if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d:d)
| ~ ^
| )
|
s654762226 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c,d,e,f;
scanf("%d %d %d",&a,&b,&c);
for(;;)
{
scanf("%d",&d);
if(d==0) scanf("%d %d",&e,&f);
if(e==0 && f==0)break;
if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d*d)
printf("OK");
else
(printf"NA");
}
return 0;
} | main.c: In function 'main':
main.c:14:8: error: expected ')' before string constant
14 | (printf"NA");
| ~ ^~~~
| )
|
s479057770 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c,d,e,f;
scanf("%d %d %d",&a,&b,&c);
for(;;)
{
scanf("%d",&d)
if(d==0 0 0) break;
if(a*a+b*b<=2*d*d || b*b+c*c<=d*d || a*a+c*c<=d*d)
printf("OK");
else
printf("NA");
}
return 0;
} | main.c: In function 'main':
main.c:8:15: error: expected ';' before 'if'
8 | scanf("%d",&d)
| ^
| ;
9 | if(d==0 0 0) break;
| ~~
|
s212105863 | p00107 | C | #include<stdio.h>
int main(void)
{
int a,b,c,d;
int z,y,x,w,v,u,t,s;
char kitune;
scanf("%d %d %d",&a,&b,&c);
z=a*a;
y=b*b;
x=c*c;
scanf("%d",&d);
for(i=0;i<=d;i++)
{
scanf("%d",&w);
if(w==0)
{
scanf("%d",&t);
if(t==0)
{... | main.c: In function 'main':
main.c:12:9: error: 'i' undeclared (first use in this function)
12 | for(i=0;i<=d;i++)
| ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
|
s119092784 | p00107 | C | include<stdio.h>
main(){
int t,y,h,n,i,r,temp,a[10010];
scanf("%d%d%d%d",&t,&y,&h,&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
if(y<t){
temp=t;
t=y;
y=temp;
}
if(h<y){
temp=h;
h=y;
y=temp;
}
if(y<t){
temp=t;
t=y;
y=temp;
}
printf("%d%d%d\n",t,y,h);
for(i=0;... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s784447530 | p00107 | C |
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>
#include <algorithm>
#include <complex>
#include <list>
#include <map>
#inclu... | main.c:4:10: fatal error: cfloat: No such file or directory
4 | #include <cfloat>
| ^~~~~~~~
compilation terminated.
|
s667458761 | p00107 | C++ | #include<stdio.h>
int main(){
int x,y,z,N,r;
while(scanf("%d %d %d",&n[0],&n[1],&n[2])!=EOF){
for(int i=0;i<3;i++)
for(int j=2;j>i;j--)
if(n[j-1]>n[j]){int t=n[j];n[j]=n[j-1];n[j-1]=t;}
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("%d",&r);
if(n[1]>r*1.4141356)printf("NA\n");
else printf("OK\n");
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:25: error: 'n' was not declared in this scope
6 | while(scanf("%d %d %d",&n[0],&n[1],&n[2])!=EOF){
| ^
|
s664756881 | p00107 | C++ |
#include<iostream>
using namespace std;
int main(){
double w,h,d,r;
double pi=3.141592653,s;
int n;
while(1){
cin >> w >> h >> d;
if(w+h+d==0) break;
cin >> n;
while(n--){
cin >> r;
r*=2;
double dw.dh,dd;
dw=sqrt(w*w+h*h);
dh=sqrt(h*h+d*d);
dd=sqrt(d*d+w*w);
if(dw<r||dh<r||dd<r) cout<<"OK" << endl;
else cout << "NA" ... | a.cc: In function 'int main()':
a.cc:16:10: error: expected initializer before '.' token
16 | double dw.dh,dd;
| ^
a.cc:17:1: error: 'dw' was not declared in this scope; did you mean 'd'?
17 | dw=sqrt(w*w+h*h);
| ^~
| d
a.cc:17:4: error: 'sqrt' was not declared in this scope
17 | dw=... |
s890483466 | p00107 | C++ | #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int tate,yoko,takasa,mn,md;
int n;
while(cin>>tate>>yoko>>takasa, tate|| yoko || takasa){
cin>>n;
int* r = new int [n];
mn=min(min(t... | a.cc: In function 'int main()':
a.cc:39:19: error: 'r' was not declared in this scope
39 | delete [] r;
| ^
|
s488806870 | p00107 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
int r[100];
int n=0;
while(true){
int temp;
cin>>temp;
if(n>=2&&temp==0&&r[n-1]==0&&r[n-2]==0){
break;
}
else{
r[n]=temp;
n=n++;
}
}
int rec1,rec2,rec3;
rec1=sqrt(a*a+b*b);
rec2=sqrt(a*a+c*c);
rec3=sqrt(b... | a.cc: In function 'int main()':
a.cc:22:14: error: 'sqrt' was not declared in this scope
22 | rec1=sqrt(a*a+b*b);
| ^~~~
|
s434716032 | p00107 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
while(1) {
int a, b, c;
cin >> a >> b >> c;
vector<int>s{ a,b,c };
if (!a && !b && !c)break;
sort(s[0],s[1]);
int d;
cin >> d;
for (int e = 0; e < d; e++) {
int f;
cin >> f;
if (f*2>s[1]... | In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/inclu... |
s588338322 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size[3];
int n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int i=0; i<n; i++){
std;;cin >... | a.cc: In function 'int main()':
a.cc:9:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>')
9 | std::cin >> size[0];
| ~~~~~~~~ ^~ ~~~~~~~
| | |
| | std::vector<int>
| st... |
s337678733 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size[3];
int x, n, r;
std::cin >> x;
size[0] = x;
std::cin >> x;
size[1] = x;
std::cin >> x;
size[2] = x;
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int i=... | a.cc: In function 'int main()':
a.cc:10:13: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
10 | size[0] = x;
| ^
In file included from /usr/include/c++/14/vector:72,
from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::v... |
s534293200 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size[3];
int x, n, r;
std::cin >> x;
size.push(x);
std::cin >> x;
size.push(x);
std::cin >> x;
size.push(x);
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int... | a.cc: In function 'int main()':
a.cc:10:8: error: request for member 'push' in 'size', which is of non-class type 'std::vector<int> [3]'
10 | size.push(x);
| ^~~~
a.cc:12:8: error: request for member 'push' in 'size', which is of non-class type 'std::vector<int> [3]'
12 | size.push(x);
| ... |
s645040985 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size[3];
int x, n, r;
std::cin >> x;
size.insert(0, x);
std::cin >> x;
size.insert(1, x);
std::cin >> x;
size.insert(2, x);
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >>... | a.cc: In function 'int main()':
a.cc:10:8: error: request for member 'insert' in 'size', which is of non-class type 'std::vector<int> [3]'
10 | size.insert(0, x);
| ^~~~~~
a.cc:12:8: error: request for member 'insert' in 'size', which is of non-class type 'std::vector<int> [3]'
12 | size.insert(1... |
s781387750 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size;
int x, n, r;
std::cin >> x;
size.insert(0, x);
std::cin >> x;
size.insert(1, x);
std::cin >> x;
size.insert(2, x);
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;... | a.cc: In function 'int main()':
a.cc:10:14: error: no matching function for call to 'std::vector<int>::insert(int, int&)'
10 | size.insert(0, x);
| ~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1484:9: note: candid... |
s227827434 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size;
int x, n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int i=0; i<n; i++){
std;;cin >... | a.cc: In function 'int main()':
a.cc:12:8: error: 'class std::vector<int>' has no member named 'sort'
12 | size.sort(size.begin(), size.end());
| ^~~~
a.cc:14:9: error: 'd' was not declared in this scope
14 | while(d!=0 && w!=0 && h!=0){
| ^
a.cc:14:17: error: 'w' was not declared i... |
s489209781 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
vector<int> size;
int x, n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
size.sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int i=0; i<n; i++){
std;;cin >> r;
... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> size;
| ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vec... |
s485663179 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size;
int x, n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
std::sort(size.begin(), size.end());
while(d!=0 && w!=0 && h!=0){
std::cin >> n;
for(int i=0; i<n; i++){
std;;cin >... | a.cc: In function 'int main()':
a.cc:14:9: error: 'd' was not declared in this scope
14 | while(d!=0 && w!=0 && h!=0){
| ^
a.cc:14:17: error: 'w' was not declared in this scope
14 | while(d!=0 && w!=0 && h!=0){
| ^
a.cc:14:25: error: 'h' was not declared in this scope
14... |
s161096829 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size;
int x, n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
std::sort(size.begin(), size.end());
while(size[0]=0 && size[1]=0 && size[2]=0){
std::cin >> n;
for(int i=0; i<n; i++){
... | a.cc: In function 'int main()':
a.cc:14:32: error: lvalue required as left operand of assignment
14 | while(size[0]=0 && size[1]=0 && size[2]=0){
a.cc:17:10: error: expected primary-expression before ';' token
17 | std;;cin >> r;
| ^
a.cc:17:12: error: 'cin' was not declared in this scope; ... |
s691509989 | p00107 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> size;
int x, n, r;
std::cin >> size[0];
std::cin >> size[1];
std::cin >> size[2];
std::sort(size.begin(), size.end());
while(size[0]==0 && size[1]==0 && size[2]==0){
std::cin >> n;
for(int i=0; i<n; i++)... | a.cc: In function 'int main()':
a.cc:17:10: error: expected primary-expression before ';' token
17 | std;;cin >> r;
| ^
a.cc:17:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
17 | std;;cin >> r;
| ^~~
| std::cin
In file includ... |
s956429395 | p00107 | C++ | #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
double d,w,h,r,min,dw,wh,hd;
int n;
while(true){
scanf("%lf %lf %lf",&d,&w,&h);
if(d == 0.0 && w == 0.0 && h == 0.0)break;
scanf("%d",&n);
for(... | a.cc: In function 'int main()':
a.cc:24:29: error: 'min' cannot be used as a function
24 | min = min(dw,min(wh,hd));
| ~~~^~~~~~~
a.cc:24:36: error: 'min' cannot be used as a function
24 | min = min(dw,min(wh,hd));
| ^... |
s649873020 | p00107 | C++ | int a,b,c,n,r;main(){while(std::cin>>a>>b>>c,a|b|c){a*=a;b*=b;c*=c;std::cin>>n;while(n--)std::cin>>r,r*=4*r,puts(a+b<r|b+c<r|c+a<r?"OK":"NA");}} | a.cc:1:15: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | int a,b,c,n,r;main(){while(std::cin>>a>>b>>c,a|b|c){a*=a;b*=b;c*=c;std::cin>>n;while(n--)std::cin>>r,r*=4*r,puts(a+b<r|b+c<r|c+a<r?"OK":"NA");}}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:33: error: 'ci... |
s160582490 | p00107 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c,n,r,R;
while( cin >> a >> b >> c , a || b || c ){
cin >> n;
for(int i=0 ; i < n ; i++ ){
bool ans = true;
cin >> r;
R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
if( 2*r <= R ) ans = false;
cout << (ans?"OK":"NA") << end... | a.cc: In function 'int main()':
a.cc:11:39: error: 'sqrt' was not declared in this scope
11 | R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
| ^~~~
|
s862559260 | p00107 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
int main(){int a,b,c,n,r;for(;scanf("%d%d%d",&a,&b,&c),a|b|c;)for(scanf("%d",&n);n--;puts( (2*r<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?"OK":"NA"));scanf("%d",&r);} | a.cc: In function 'int main()':
a.cc:4:102: error: 'min' was not declared in this scope; did you mean 'std::min'?
4 | int main(){int a,b,c,n,r;for(;scanf("%d%d%d",&a,&b,&c),a|b|c;)for(scanf("%d",&n);n--;puts( (2*r<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?"OK":"NA"));scanf("%d",&r);}
| ... |
s572076917 | p00107 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c,n,r,R;
while( cin >> a >> b >> c , a || b || c ){
cin >> n;
for(int i=0 ; i < n ; i++ ){
bool ans = true;
cin >> r;
R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
if( 2*r <= R ) ans = false;
cout << (ans?"OK":"NA") << end... | a.cc: In function 'int main()':
a.cc:11:39: error: 'sqrt' was not declared in this scope
11 | R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
| ^~~~
|
s888748412 | p00107 | C++ | #include<stdio.h>
#include<math.h>
#include<algorith>
//#define M(a,b) a<b?a:b
int main(){
int a,b,c,n,r;
for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
for(scanf("%d",&n);n--;){
scanf("%d",&r);
puts(
(2.*r<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
"OK":"NA"
);
}
}
} | a.cc:3:9: fatal error: algorith: No such file or directory
3 | #include<algorith>
| ^~~~~~~~~~
compilation terminated.
|
s961201992 | p00107 | C++ | #include<stdio.h>
#include<math.h>
#include<algorithm>
//#define M(a,b) a<b?a:b
int main(){
int a,b,c,n,r;
for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
for(scanf("%d",&n);n--;){
scanf("%d",&r);
puts(
(2.*r<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
"OK":"NA"
);
}
}
} | a.cc: In function 'int main()':
a.cc:11:44: error: 'min' was not declared in this scope; did you mean 'std::min'?
11 | (2.*r<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
| ^~~
| ... |
s499079938 | p00107 | C++ | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
double x, w, h, n, r, min_r;
while (cin >> x >> w >> h, x || w || h){
min_r = min(sqrt(x*x+w*w), min(sqrt(x*x+h*h), sqrt(w*w+h*h)));
cin >> n;
while (n--){
cin >> r;
r*=2;
min_r < r ? cout << "OK" << en... | a.cc: In function 'int main()':
a.cc:14:45: error: expected ':' before ';' token
14 | min_r < r ? cout << "OK" << endl; : cout << "NA" << endl;
| ^
| :
a.cc:14:45: error: expected primary-expression before... |
s490678169 | p00107 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#define PI 3.14159265358979323846264
using namespace std;
int main(void){
int n;
double v,box_area[5],height,width,depth,min_area;
vector<double> hole;
vector<double> hole_area;
while(1){
height=0;
width=0;
depth=0;
n=0;
min_area=0;
... | a.cc: In function 'int main()':
a.cc:52:29: error: 'sqrt' was not declared in this scope
52 | box_area[0]=sqrt(1.0*height*height+1.0*width*width); //¼ûÌÌ3ÊÌ»ê¼êÌÎpü
| ^~~~
|
s629324779 | p00107 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void)
{
int a[3], n, b;
while (scanf("%d %d %d", &a[0], &a[1], &a[2]), a[0]){
sort(a, a + 3);
int r = a[0]*a[0] + a[1]*a[1];
cin >> n;
for (int i = 0; i < n; i++){
cin >> b;
if (r < (b*2)*(b*2)) cout << "OK" << endl;
... | a.cc: In function 'int main()':
a.cc:10:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
10 | sort(a, a + 3);
| ^~~~
| sqrt
|
s602735687 | p00107 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main(){
doIt();
}
void doIt(){
int a,b,c,n,i;
cin >> a >> b >> c;
while(a + b + c > 0){
cin >> n;
int r[n];
//cout << sqrt(a*a + b*b) / 2 << ", " << sqrt(b*b + c*c) / 2 << "," << sqrt(a*a + c*c) / 2;
for(i = 0; i < n; i++){
std::cin >> r[i];
... | a.cc: In function 'int main()':
a.cc:6:1: error: 'doIt' was not declared in this scope
6 | doIt();
| ^~~~
|
s293380615 | p00107 | C++ | #include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, n) for ( int i = 0; i < n; i++ )
using namespace std;
int main() {
int n;
vector<int> s(3);
while ( cin >> s[0] >> s[1] >> s[2] >> n, s[0] || s[1] || s[2] ) {
sort(s.begin(), s.end());
// REP(i, 3) c... | a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
15 | sort(s.begin(), s.end());
| ^~~~
| sqrt
|
s399613535 | p00107 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(void){
int a[3];
while( cin >> a[0] >> a[1] >> a[2] , ( a[0] || a[1] || a[2] ) ){
int n;
cin >> n;
sort( a , a + 3 );
int R = a[0]*a[0] + a[1]*a[1];
while(n--){
int r;
cin >> r;
if( 2 * r > sqrt(R) ) co... | a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
13 | sort( a , a + 3 );
| ^~~~
| sqrt
|
s924558309 | p00107 | C++ | #include<iostream>
#include<algorithm>
int main(){
int data[3];
while(std::cin>>data[0]>>data[1]>>data[2],data[0],data[1],data[2]){
int n;
double min;
std::sort(data,data+3);
std::cin>>n;
min=sqrt(data[0]*data[0]+data[1]*data[1])/2;
for(int i=0,r;i<n;i++){
std::cin>>r;
if(r>min)std::cout<<"OK"<<std... | a.cc: In function 'int main()':
a.cc:11:21: error: 'sqrt' was not declared in this scope
11 | min=sqrt(data[0]*data[0]+data[1]*data[1])/2;
| ^~~~
|
s065560610 | p00108 | Java | 10
4 5 1 1 4 5 12 3 5 4
0 | Main.java:1: error: class, interface, enum, or record expected
10
^
1 error
|
s263478025 | p00108 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int array[];
while(truez){
int n = sc.nextInt();
if(n == 0)break;
array = new int[n];
for(int i = 0; i < n; i++)array[i] = sc.... | Main.java:8: error: cannot find symbol
while(truez){
^
symbol: variable truez
location: class Main
1 error
|
s836121106 | p00108 | Java | import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main0108 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N;
while((N = scan.nextInt()) != 0) {
int[] S = new int[N];
for(int i =... | Main.java:7: error: class Main0108 is public, should be declared in a file named Main0108.java
public class Main0108 {
^
1 error
|
s524807631 | p00108 | C | #include <stdio.h>
#define MAX 13
int main()
{
int n = 0, i = 0, flag = 0, cnt = 0;
int numline[MAX] = {};
int tmpline[MAX] = {};
int num[101] = {};
while ( scanf( "%d", &n ) == 1 ) {
if ( n == 0 ) { break; }
for ( i = 0 ; i < n ; i++ ) {
scanf( "%d", &numline[i] );
}
flag = 1;
cnt = 0;
while ( f... | main.c: In function 'main':
main.c:39:30: error: implicit declaration of function 'memcmp' [-Wimplicit-function-declaration]
39 | if ( memcmp( numline, tmpline, sizeof( int )*n ) == 0 ) {
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declarati... |
s719562285 | p00108 | C | #include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int i,n;
int data[12];
int chk[12];
int old_chk[12];
int flg[12];
int ans_cnt,wk,cnt,k;
char inp[96];
char *dmy_p;
char *wk_p;
while (1) {
/**--init --**/
/**--input--**/
gets(inp);
sscanf(inp,"%d",&n);
if (n == 0) {
break;... | main.c: In function 'main':
main.c:21:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
21 | gets(inp);
| ^~~~
| fgets
main.c:34:32: error: implicit declaration of function 'strtok_s'; did you mean '... |
s990658740 | p00108 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
#define N 1000000
int main(){
while(1){
int n, count=0;
long before[13], after[13], c[N];
scanf(" %d", &n);
if(n==0) break;
for(int i=0; i<n; ++i)scanf(" %ld", &before[i]);
//loop
bool flag=false;
while(!flag){
for(int i=0; i<=... | a.cc: In function 'int main()':
a.cc:43:28: error: expected ';' before 'count'
43 | */0
| ^
| ;
44 |
45 | count++;
| ~~~~~
|
s936727970 | p00108 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) pu... | a.cc: In function 'int main()':
a.cc:37:25: error: 'memset' was not declared in this scope
37 | memset(ans,0,sizeof(ans));
| ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #includ... |
s000419720 | p00108 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) pu... | a.cc: In function 'int main()':
a.cc:37:25: error: 'memset' was not declared in this scope
37 | memset(ans,0,sizeof(ans));
| ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #includ... |
s130587735 | p00108 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while(cin>>n,n){
int ans[2][12]={};
for(int i=0;i<n;i++){
cin>>ans[0][i];
ans[1][i]=ans[0][i];
}
for(int i=0;;i++){
int num[100]={};
for(int j=0;j<n;j++)num[an... | a.cc: In function 'int main()':
a.cc:17:31: error: 'kawa' was not declared in this scope
17 | ans[0][j]=num[kawa[j]];
| ^~~~
|
s656698553 | p00108 | C++ | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
bool check(vector<int> &a,vector<int> &b)
{
if(a.size()!=b.size())return true;
for(int i=0;i<a.size();i++)if(a[i]!=b[i])return true;
return false;
}
int main()
{
int n;
while(cin>>n&&n)
{
vector<int> a,b;
for(int i=0;i<n;i++)
{... | a.cc:6:12: error: 'vector' was not declared in this scope
6 | bool check(vector<int> &a,vector<int> &b)
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 | using... |
s213001778 | p00108 | C++ | #include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
bool mani(int a[12], int n)
{
int b[12];
fill(b, b + 12, 0);
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (a[i] == a[j])
b[i]++;
bool f =... | /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
|
s913526549 | p00108 | C++ | include <iostream>
#include <vector>
#include <map>
using namespace std;
int main() {
int n;
cin >> n;
int s[2][n];
while((cin >> s[0][0]), s[0][0] != 0){
for(int i = 1; i < n ; i ++)
{
cin >> s[0][i];
}
bool fixed = false;
int src_index = 0;
int operation_count = 0;
while(!f... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s102903897 | p00108 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int n;
while(true){
cin>>n;
if(n==0){break;}
int *a=new int[n];
map<int,int>Map;
rep(i,n){
cin>>a[i];
}
for(int count=0;;count++){
rep(i,n){
Map[a[i]]++;
}
int *s=new in... | a.cc: In function 'int main()':
a.cc:12:9: error: 'map' was not declared in this scope
12 | map<int,int>Map;
| ^~~
a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
3 | #include <algorithm>
+++ |+#include <map>
4 | using names... |
s864420175 | p00108 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int n;
while(true){
cin>>n;
if(n==0){break;}
int *a=new int[n];
map<int,int>Map;
rep(i,n){
cin>>a[i];
}
for(int count=0;;count++){
rep(i,n){
... | a.cc: In function 'int main()':
a.cc:40:2: error: expected '}' at end of input
40 | }
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s735354241 | p00108 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int n;
while(true){
cin>>n;
if(n==0){break;}
int *a=new int[n];
map<int,int>Map;
rep(i,n){
cin>>a[i];
}
for(int count=0;;count++){
rep(i,n){
... | a.cc: In function 'int main()':
a.cc:37:23: error: 'a' was not declared in this scope
37 | cout<<a[i];
| ^
|
s433753742 | p00108 | C++ | #include <iostream>]
#include <math.h>
#include <algorithm>
#include <cstdio>
#include <map>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
int main()
{
int n;
while(true){
cin>>n;
if(n==0){break;}
int *a=new int[n];
map<int,int>Map;
rep(i,n){
cin>>a[i];
}
for(int cnt=0;... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <iostream>]
| ^
a.cc: In function 'int main()':
a.cc:7:22: error: 'll' was not declared in this scope
7 | #define rep(i,n) for(ll i=0;i<n;i++)
| ^~
a.cc:16:5: note: in expansion of macr... |
s441135611 | p00108 | C++ | #include <iostream>]
#include <math.h>
#include <algorithm>
#include <cstdio>
#include <map>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
int main()
{
int n;
while(true){
cin>>n;
if(n==0){break;}
int *a=new int[n];
map<int,int>Map;
rep(i,n){
cin>>a[i];
... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <iostream>]
| ^
a.cc: In function 'int main()':
a.cc:25:24: error: 'i' was not declared in this scope
25 | int *s=new int[a[i]];
| ^
|
s882742604 | p00108 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main ( void )
{
int n; // ツ青板療アツづ個陳キツつウ
while ( cin >> n && n != 0 )
{
vector <int> S(n);
for ( int i = 0; i < n; i++ )
cin >> S[i];
vector <int> V(n);
vector <int> V_next(n);
V = S;
int cnt = 0;
while ( 1 )
{
for ( int i = 0; i ... | a.cc: In function 'int main()':
a.cc:23:45: error: 'count' was not declared in this scope; did you mean 'cnt'?
23 | V_next[i] = count( V.begin(), V.end(), V[i] );
| ^~~~~
| cnt
|
s206418072 | p00108 | C++ | #include <stdio.h>
#include <string.h>
void cpy(int src[],int dst[],int n){
for(int i=0;i<n;i++) dst[i]=src[i];
}
void OFA(int S[],int n){
int num[100];
memset(num,0,sizeof(num));
for(int i=0;i<n;i++) num[S[i]]++;
for(int i=0;i<n;i++) S[i]=num[S[i]];
}
bool check(int S[],int tmp[],int n){
for(int i=0;i<n;i++) if... | a.cc: In function 'int main()':
a.cc:34:33: error: 'i' was not declared in this scope
34 | printf("%d\n",S[i]);
| ^
|
s506450580 | p00108 | C++ | #include<algorithm>
#include<iostream>
#include<map>
int n;
int a[12], prv[12];
std::map<int, int> cnt, tmp;
int ans;
int main()
{
while( std::cin >> n, n )
{
ans = 0;
memset( a, 0, sizeof( a ) );
memset( prv, 0, sizeof( prv ) );
cnt.clear();
tmp.clear();
for( int i = 0; i != n; ++i )
{
std::cin >... | a.cc: In function 'int main()':
a.cc:15:17: error: 'memset' was not declared in this scope
15 | memset( a, 0, sizeof( a ) );
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<map>
+++ |+... |
s025954344 | p00108 | C++ | #include<iostream>
int main(){
int n,ans=0,data[12],back[12];
while(std::cin>>n){
if(n==0)break;
for(int i=0;i<n;i++)std::cin>>data[i],back[i]=data[i];
while(true){
for(int i=0;i<n;i++){
int count=0;
for(int j=0;j<n;j++){
if(back[i]==back[j])count++;
}
data[i]=count;
}
bool f=true... | a.cc: In function 'int main()':
a.cc:21:25: error: 'memcpy' was not declared in this scope
21 | memcpy(back,data,sizeof(data));
| ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #in... |
s838850172 | p00108 | C++ | #include<iostream>
int main(){
int n;
while(std::cin>>n){
int ans=0,data[12],back[12];
if(n==0)break;
for(int i=0;i<n;i++)std::cin>>data[i],back[i]=data[i];
while(true){
for(int i=0;i<n;i++){
int count=0;
for(int j=0;j<n;j++){
if(back[i]==back[j])count++;
}
data[i]=count;
}
bool... | a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s012597717 | p00109 | Java | import java.util.Scanner;
public class SmartCalculator {
static String str;
static int pos;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
str = sc.next();
pos = 0;
System.out.println(expression());
}
sc.close();
... | Main.java:3: error: class SmartCalculator is public, should be declared in a file named SmartCalculator.java
public class SmartCalculator {
^
1 error
|
s982949817 | p00109 | Java | import java.util.Scanner;
public class SmartCalculator {
static String str;
static int pos;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
str = sc.next();
pos = 0;
System.out.println(expression());
}
sc.close();
... | Main.java:3: error: class SmartCalculator is public, should be declared in a file named SmartCalculator.java
public class SmartCalculator {
^
1 error
|
s248209127 | p00109 | Java | def calc(array):
while not len(array) == 1:
if '*' in array:
x = array.index('*')
array[x + 1] = str(int(array[x - 1]) * int(array[x + 1]))
del array[x - 1:x + 1]
continue
if '/' in array:
x = array.index('/')
array[x + 1] = str(int(array[x - 1]) / int(array[x + 1]))
del array[x - 1:x + 1]
... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
def calc(array):
^
(use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
def calc(array):
^
Main.java:1: error: ';' expected
def calc(array):
^
Main.java:5: error: c... |
s585135031 | p00109 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
import static java.lang.Integer.parseInt;
/**
* Smart Calculator
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br ... | Main.java:33: error: illegal start of expression
while (stack.peek() == '*' || stack.peek() == '/')){
^
1 error
|
s634664300 | p00109 | Java | import java.util.Scanner;
import java.util.function.IntBinaryOperator;
public class Calc {
static int lastIndexOf(String e, char ch) {
int nest = 0;
for(int i = e.length()-1; i > 0 ; i--) {
char c = e.charAt(i);
if(c == ‘(’) {
nest++;
}
... | Main.java:10: error: illegal character: '\u2018'
if(c == ?(?) {
^
Main.java:10: error: illegal character: '\u2019'
if(c == ?(?) {
^
Main.java:13: error: illegal character: '\u2018'
if(c == ?)?) {
^
Main.java:13: error: ill... |
s262750091 | p00109 | Java | import java.util.Scanner;
import java.util.function.IntBinaryOperator;
public class Calc {
static int lastIndexOf(String e, char ch) {
int nest = 0;
for(int i = e.length()-1; i > 0 ; i--) {
char c = e.charAt(i);
if(c == ‘(’) {
nest++;
}
... | Main.java:10: error: illegal character: '\u2018'
if(c == ?(?) {
^
Main.java:10: error: illegal character: '\u2019'
if(c == ?(?) {
^
Main.java:13: error: illegal character: '\u2018'
if(c == ?)?) {
^
Main.java:13: error: ill... |
s528919221 | p00109 | Java | import java.util.Scanner;
import java.util.function.IntBinaryOperator;
public class Main {
static int lastIndexOf(String e, char ch) {
int nest = 0;
for(int i = e.length()-1; i > 0 ; i--) {
char c = e.charAt(i);
if(c == ‘(’) {
nest++;
}
... | Main.java:10: error: illegal character: '\u2018'
if(c == ?(?) {
^
Main.java:10: error: illegal character: '\u2019'
if(c == ?(?) {
^
Main.java:13: error: illegal character: '\u2018'
if(c == ?)?) {
^
Main.java:13: error: ill... |
s999527101 | p00109 | Java | import java.util.Scanner;
import java.util.function.IntBinaryOperator;
public class Main{
static int lastIndexOf(String e, char ch) {
int nest = 0;
for(int i = e.length()-1; i > 0 ; i--) {
char c = e.charAt(i);
if(c == ‘(’) {
nest++;
}
... | Main.java:10: error: illegal character: '\u2018'
if(c == ?(?) {
^
Main.java:10: error: illegal character: '\u2019'
if(c == ?(?) {
^
Main.java:13: error: illegal character: '\u2018'
if(c == ?)?) {
^
Main.java:13: error: ill... |
s528681363 | p00109 | Java | import javax.script.*;
public class EvalScript {
public static void main(String[] args) throws Exception {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("JavaScript");
engine.eval("println('Hello JavaScript from Java.')");
... | Main.java:3: error: class EvalScript is public, should be declared in a file named EvalScript.java
public class EvalScript {
^
1 error
|
s320054462 | p00109 | Java | import javax.script.*;
class Main{
public static void main(String[]z){
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("JavaScript");
engine.eval("println('Hello JavaScript from Java.')");
}
} | Main.java:7: error: unreported exception ScriptException; must be caught or declared to be thrown
engine.eval("println('Hello JavaScript from Java.')");
^
1 error
|
s985141824 | p00109 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String args[] ) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int line=Integer.parseInt(br.readLine);
Main calc=new Main();
for(int n=0;n<line;n++){
St... | Main.java:7: error: cannot find symbol
int line=Integer.parseInt(br.readLine);
^
symbol: variable readLine
location: variable br of type BufferedReader
Main.java:23: error: cannot find symbol
ArrayList<String> num=new ArrayList<String>();
^
symbol: class ArrayList
locatio... |
s758768808 | p00109 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String args[] ) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int line=Integer.parseInt(br.readLine());
Main calc=new Main();
... | Main.java:155: error: incompatible types: double cannot be converted to Integer
return doCalc1(expr.substring(6))/180*Math.PI;
^
Main.java:158: error: incompatible types: double cannot be converted to Integer
return Math.sin(doCalc1(expr.substring(3)));
... |
s528842065 | p00109 | Java | TERM_N = 0
TERM_OP_PM = 1
TERM_OP_MD = 2
TERM_OP_SIGN = 3
TERM_LB = 4
TERM_RB = 5
TERM_END = 6
def lex_analyze(str)
expr = []
come_sign = true
for t in str.scan(/\d+|[\+\-\*\/\(\)=]/)
case t
when '+', '-'
if come_sign
expr.push [TERM_OP_SIGN, t]
else
expr.push [TERM_OP_PM... | Main.java:1: error: class, interface, enum, or record expected
TERM_N = 0
^
Main.java:14: error: illegal character: '\'
for t in str.scan(/\d+|[\+\-\*\/\(\)=]/)
^
Main.java:14: error: illegal character: '\'
for t in str.scan(/\d+|[\+\-\*\/\(\)=]/)
^
Main.java:14: erro... |
s415642054 | p00109 | C | #include <iostream>
#include <string>
using namespace std;
string s;
int single(int& pos);
int figure(int& pos);
int solve(int& pos);
int main(){
int T;
cin>>T;
for(int i = 0; i < T; i++){
cin>>s;
int pos = 0;
cout<<solve(pos)<<endl;
}
return 0;
}
int single(int& pos){//??°??????????????????????????¢... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s038516727 | p00109 | C | #include <iostream>
#include <string>
using namespace std;
int calc1();
int calc2();
int calc3();
int p;
string eq;
int calc1() {
int a = calc2();
while (eq[p]=='+' || eq[p]=='-') {
if (eq[p]=='+') {
p++;
a += calc2();
} else if (eq[p]=='-') {
p++;
a -= calc2();
}
}
ret... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s440587529 | p00109 | C | #include<iostream>
#include<string>
#include<sstream>
typedef std::stringstream sst;
int ToInt(std::string str){
int i;
sst ss;
ss<<str;
ss>>i;
return i;
}
std::string ToStr(int i){
std::string str;
sst ss;
ss<<i;
ss>>str;
return str;
}
std::string SubStr(std::string str,in... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s256924474 | p00109 | C | #include <iostream>
#include <string>
using namespace std;
int calc1();
int calc2();
int calc3();
int p;
string eq;
int calc1() {
int a = calc2();
while (eq[p]=='+' || eq[p]=='-') {
if (eq[p]=='+') {
p++;
a += calc2();
} else if (eq[p]=='-') {
p++;
a -= calc2();
}
}
ret... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s835655295 | p00109 | C | #include<iostream>
#include<cstdlib>
#include<string>
using namespace std;
int i;
string str;
int Expression();
int Term();
int Factor();
int No(int);
int main(){
int n;
cin >> n;
while(n--){
cin >> str;
i = 0;
cout << Expression() << endl;
}
}
int Expression(){
int res = Term();
while(1){
s... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s448865560 | p00109 | C | #include<iostream>
#include<cstdlib>
#include<string>
using namespace std;
int i;
string str;
int Expression();
int Term();
int Factor();
int No(int);
int main(){
int n;
cin >> n;
while(n--){
cin >> str;
i = 0;
cout << Expression() << endl;
}
}
int Expression(){
int res = Term();
while(1){
s... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s300694298 | p00109 | C | l=[eval(raw_input()[:-1]) for i in range(int(input()))]
for i in l:
print i
| main.c:1:1: warning: data definition has no type or storage class
1 | l=[eval(raw_input()[:-1]) for i in range(int(input()))]
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'l' [-Wimplicit-int]
main.c:1:3: error: expected expression before '[' token
1 | l=[eval(raw_input()[:-1]) for i in ... |
s852514629 | p00109 | C | char*p,E[200];M(){int r;r=T();for(;;){if(*p=='*'){p++;r*=T();}else if(*p=='/'){p++;r/=T();}elsereturn r;}}A(){int r;r=M();for(;;){if(*p=='+'){p++;r+=M();}else if(*p=='-'){p++;r-=M();}elsereturn r;}}T(){int r,l;if(*p=='('){p++;r=A();p++;}else{sscanf(p,"%d%n",&r,&l);p+=l;}return r;}main(){scanf("%*d\n");for(;~scanf("%[^=... | main.c:1:15: error: return type defaults to 'int' [-Wimplicit-int]
1 | char*p,E[200];M(){int r;r=T();for(;;){if(*p=='*'){p++;r*=T();}else if(*p=='/'){p++;r/=T();}elsereturn r;}}A(){int r;r=M();for(;;){if(*p=='+'){p++;r+=M();}else if(*p=='-'){p++;r-=M();}elsereturn r;}}T(){int r,l;if(*p=='('){p++;r=A();p++;}else{ssc... |
s567570067 | p00109 | C | char*p,s[999];t();f();e(x){for(x=t(0);*p&&*p<46;)x+=*p++%5?t(0):-t(0);return x;}t(x){for(x=f(0);*p%5==2;x*=f(0))++p;return x;}f(x){return*p<41?++p,x=e(0),++p,x:*p<44?f(0):*p<46?-f(0)strtol(p,&p,0);}main(i){for(;~scanf("%s",p=s);)--i&&printf("%d\n",e(0));} | main.c:1:15: warning: data definition has no type or storage class
1 | char*p,s[999];t();f();e(x){for(x=t(0);*p&&*p<46;)x+=*p++%5?t(0):-t(0);return x;}t(x){for(x=f(0);*p%5==2;x*=f(0))++p;return x;}f(x){return*p<41?++p,x=e(0),++p,x:*p<44?f(0):*p<46?-f(0)strtol(p,&p,0);}main(i){for(;~scanf("%s",p=s);)--i&&printf("%d\... |
s796669036 | p00109 | C | i = 0
def number(begin):
global i
if begin[i] == "(":
i += 1
res = expression(begin)
i += 1
return res
res = 0
while begin[i].isdigit():
res *= 10
res += int(begin[i])
i+=1
return res
def term(begin):# your code goes here
global i
res = number(begin)
while True:
if begin[i] == "*"... | main.c:1:1: warning: data definition has no type or storage class
1 | i = 0
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:3:1: error: expected ',' or ';' before 'def'
3 | def number(begin):
| ^~~
main.c:21:17: error: stray '#' in program
21 | def term... |
s794053730 | p00109 | C | #include <iostream>
#include <cctype>
using namespace std;
int expr(string& s,int& i);
int term(string& s,int& i);
int factor(string& s,int& i);
int number(string& s,int& i);
int expr(string& s,int& i){
int val = term(s,i);
while(s[i]=='+' || s[i]=='-'){
char op = s[i];
i++;
int val2 = term(s,i);
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s476826520 | p00109 | C++ | n=int(input())
for i in range(n):
print(input())
| a.cc:1:1: error: 'n' does not name a type
1 | n=int(input())
| ^
|
s719213963 | p00109 | C++ | #include "pch.h"
#include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;
inline bool is_op(string &in) {
if (in.size() == 1 && !isdigit(in[0]))
{
return true;
}
else
{
return false;
}
}
inline bool is_num(string &in)
{
for (auto i : in)
{
if (!isdigit(i))
return ... | a.cc:1:10: fatal error: pch.h: No such file or directory
1 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s196138368 | p00109 | C++ | #include <iostream>
#include <cassert>
#include <cctype>
using namespace std;
string S;
size_t cur = 0;
int term();
int factor();
int expression();
int digit(){
assert(isdigit(S[cur]));
int n = S[cur] - '0';
cur = cur + 1;
return n;
}
int number(){
int n = digit();
while(cur<S.size() && isdigit(S[cur]))
n = n... | a.cc: In function 'int expression()':
a.cc:25:35: error: expected identifier before '(' token
25 | while (cur < S.size()) && (S[cur] == '+' || S[cur] == '-')){
| ^
|
s178294103 | p00109 | C++ | #include <cmath>
#include <cassert>
#include <iostream>
using namespace std;
string S;
size_t cur = 0;
int digit() {
int n;
assert(isdigit(S[cur]));
n = S[cur] -'0';
++cur;
return n;
}
int number() {
int n = digit();
while (cur < S.size() && isdigit(S[cur])) {
n = n*10 + digit();
}
return n;
}
int expre... | a.cc: In function 'int term()':
a.cc:43:53: error: 'trunk' was not declared in this scope; did you mean 'trunc'?
43 | if(op == '*') t *= b; else t = (int)trunk(1.0*t/b);
| ^~~~~
| trunc... |
s399349679 | p00109 | C++ | #include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
typedef string::const_iterator State;
class ParseError{};
int number(State &begin) {
int ret = 0;
while (isdigit(*begin)) {
ret *= 10;
ret += *begin - '0';
begin++;
}
return ret;
}
int term(State &... | a.cc: In function 'int main()':
a.cc:61:17: error: expected ';' before 'for'
61 | cin.ignore()
| ^
| ;
62 | for (int i = 0; i < N; i++) {
| ~~~
a.cc:62:21: error: 'i' was not declared in this scope
62 | for (int i = 0; i < N; i++) {
... |
s115493204 | p00109 | C++ | gets;$<.each_line.map{|s|p eval(s[0..-3])} | a.cc:1:35: error: too many decimal points in number
1 | gets;$<.each_line.map{|s|p eval(s[0..-3])}
| ^~~
a.cc:1:1: error: 'gets' does not name a type
1 | gets;$<.each_line.map{|s|p eval(s[0..-3])}
| ^~~~
a.cc:1:6: error: '$' does not name a type
1 | gets;$<.each... |
s480550309 | p00109 | C++ | #!/usr/bin/python3
import re
n = int(input())
for _ in range(n):
print(eval(re.sub(r'(\d+/\d+)', r'int(\1)', input()[0:-1]))) | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/python3
| ^
a.cc:6:24: warning: unknown escape sequence: '\d'
6 | print(eval(re.sub(r'(\d+/\d+)', r'int(\1)', input()[0:-1])))
| ^~~~~~~~~~~
a.cc:6:24: warning: unknown escape sequence: '\d'
a.cc:6:24: war... |
s423787646 | p00109 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef co... | a.cc: In function 'int calc(std::string)':
a.cc:89:17: error: jump to label 'next'
89 | next:;
| ^~~~
a.cc:68:38: note: from here
68 | goto next;
| ^~~~
a.cc:71:26: note: crosses initialization of ... |
s934386416 | p00109 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef co... | a.cc: In function 'int calc(std::string)':
a.cc:89:17: error: jump to label 'next'
89 | next:;
| ^~~~
a.cc:68:38: note: from here
68 | goto next;
| ^~~~
a.cc:71:26: note: crosses initialization of ... |
s589288081 | p00109 | C++ | #include <bits/stdc++.h>
using namespace std;
const int dx[]={0,1,0,-1,1,-1,-1,1};
const int dy[]={-1,0,1,0,1,1,-1,-1};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fi first
#define se second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#de... | a.cc:19:5: error: 'int index' redeclared as different kind of entity
19 | int index;
| ^~~~~
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
from a.cc:1:
/us... |
s452480671 | p00109 | C++ | //?????????
//??????00-440415D???Smart_Calculator.cpp
#include <iostream>
#include <string>
#include <cassert>
#include <cctype>
#include <stdio.h>
using namespace std;
string S = "1+2*(3+4)";
size_t cur = 0;
int expression();
int digit(){
assert(isdigit(S[cur]));
int n = S[cur++]-'0';
return n;
}
int number()... | a.cc: In function 'int factor()':
a.cc:37:31: error: invalid operands of types 'void' and 'char' to binary 'operator=='
37 | assert(S[cur])==')');
| ^~~~~
| |
| char
a.cc: In function 'int ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.