submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s374198669
|
p00004
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNextInt()) {
double a = scan.nextDouble();
double b = scan.nextDouble();
double c = scan.nextDouble();
double d = scan.nextDouble();
double e = scan.nextDouble();
double f = scan.nextDouble();
double db;
double ae;
double x;
double y;
double j;
double g;
db = d * b;
ae = a * e;
j = db - ae;
y = ((d * c) - (a * f)) / j;
g = y * b;
x = (-1 * (g) + c) / a;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
Main.java:24: error: illegal character: '\u3000'
????????????? y = ((d * c) - (a * f)) / j;
^
13 errors
|
s605426365
|
p00004
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double a,b,c,d,e,f;
double x,y;
while(sc.hasNext()){
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
d = sc.nextInt();
e = sc.nextInt();
f = sc.nextInt();
if(d!=0) y = (c-((a*f)/d))/(b-((a*e)/d));
else y = 0;
if(a!=0) x = (c-(b*y))/a;
else x = 0;
System.out.printf("%.3f %.3f\n", x,y);
}
}
|
Main.java:24: error: reached end of file while parsing
}
^
1 error
|
s528313207
|
p00004
|
Java
|
import java.util.Scanner;
public class SimultaneousEquation {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNextInt()){
double a = sc.nextInt();
double b = sc.nextInt();
double c = sc.nextInt();
double d = sc.nextInt();
double e = sc.nextInt();
double f = sc.nextInt();
double x, y;
x = c/a + (-1)*(b/a);
y = f/e + (-1)*d*x;
x = (-1*b*y + c)/a;
x = (int)(x*1000 + 0.5) / (double)1000;
y = (int)(y*1000 + 0.5) / (double)1000;
System.out.printf("\f \f",x ,y);
}
}
}
|
Main.java:4: error: class SimultaneousEquation is public, should be declared in a file named SimultaneousEquation.java
public class SimultaneousEquation {
^
1 error
|
s507249335
|
p00004
|
Java
|
import java.util.Scanner;
public Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a,b,c,d,e,f;
double x,y;
while(sc.hasNext()){
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
d=sc.nextInt();
e=sc.nextInt();
f=sc.nextInt();
y=(double)(c*d-a*f)/(b*d-a*e);
x=(double)(c-b*y)/a;
System.out.printf("%.3f %.3f\n",Math.round(x),Math.round(y));
}
}
}
|
Main.java:2: error: class, interface, enum, or record expected
public Main{
^
Main.java:3: 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:24: error: class, interface, enum, or record expected
}
^
3 errors
|
s335312172
|
p00004
|
Java
|
import java.util.Scanner;
public Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a,b,c,d,e,f;
double x,y;
while(sc.hasNext()){
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
d=sc.nextInt();
e=sc.nextInt();
f=sc.nextInt();
y=(double)(c*d-a*f)/(b*d-a*e);
x=(double)(c-b*y)/a;
System.out.printf("%.3f %.3f\n",x,y);
}
}
}
|
Main.java:2: error: class, interface, enum, or record expected
public Main{
^
Main.java:3: 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:24: error: class, interface, enum, or record expected
}
^
3 errors
|
s392365466
|
p00004
|
Java
|
import java.util.Scanner;
import java.util.ArrayList;
class Main
{
static class Answer
{
public double x;
public double y;
Answer( double x_, double y_ )
{
x = x_; y = y_;
}
}
public static void main(String[] av)
{
Scanner sc = new Scanner( System.in );
ArrayList<Answer> al = new ArrayList<Answer>();
final int N = 6;
while ( sc.hasNextDouble() )
{
double [] src = new double[N];
for ( int i = 0; i < N; ++i )
{
src[i] = sc.nextDouble();
}
double divisor1 = src[0];
double divisor2 = src[3];
for ( int i = 0; i < 3; ++i )
{
src[i] /= divisor1;
src[i+3] /= divisor2;
}
double ycoef1 = src[1] - src[4];
double value1 = src[2] - src[5];
double y = value1 / ycoef1;
double x = src[2] - y * src[1];
al.add( new Answer( x, y) );
}
for ( Answer ans : al )
{
java.math.BigDecimal bdx = new java.math.BigDecimal(ans.x);
java.math.BigDecimal bdy = new java.math.BigDecimal(ans.y);
java.math.BigDecimal x = bdx.setScale(4, java.math.BigDecimal.ROUND_HALF_UP );
java.math.BigDecimal y = bdy.setScale(4, java.math.BigDecimal.ROUND_HALF_UP );
if ( x==0) x = 0;
if ( y==0) y = 0;
System.out.printf("%.3f %.3f\n", x.doubleValue(), y.doubleValue());
}
}
}
|
Main.java:47: error: bad operand types for binary operator '=='
if ( x==0) x = 0;
^
first type: BigDecimal
second type: int
Main.java:47: error: incompatible types: int cannot be converted to BigDecimal
if ( x==0) x = 0;
^
Main.java:48: error: bad operand types for binary operator '=='
if ( y==0) y = 0;
^
first type: BigDecimal
second type: int
Main.java:48: error: incompatible types: int cannot be converted to BigDecimal
if ( y==0) y = 0;
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s500311168
|
p00004
|
Java
|
import java.text.DecimalFormat;
public class Simequ {
public static void main(String[] args){
double a = Double.parseDouble(args[0]);
double b = Double.parseDouble(args[1]);
double c = Double.parseDouble(args[2]);
double d = Double.parseDouble(args[3]);
double e = Double.parseDouble(args[4]);
double f = Double.parseDouble(args[5]);
DecimalFormat df = new DecimalFormat("0.000");
double x =(c*e-b*f)/(a*e-b*d);
double y = (a*f-c*d)/(a*e-b*d);
x = Math.floor((x+0.5)*1000)/1000;
x = Math.ceil((x-0.5)*1000)/1000;
y = Math.floor((y+0.5)*1000)/1000;
y = Math.ceil((y-0.5)*1000)/1000;
System.out.println(df.format(x)+" "+df.format(y) );
}
}
|
Main.java:3: error: class Simequ is public, should be declared in a file named Simequ.java
public class Simequ {
^
1 error
|
s768448600
|
p00004
|
Java
|
import java.text.DecimalFormat;
public class Simequ {
public static void main(String[] args){
double a = Double.parseDouble(args[0]);
double b = Double.parseDouble(args[1]);
double c = Double.parseDouble(args[2]);
double d = Double.parseDouble(args[3]);
double e = Double.parseDouble(args[4]);
double f = Double.parseDouble(args[5]);
DecimalFormat df = new DecimalFormat("0.000");
double x =(c*e-b*f)/(a*e-b*d);
double y = (a*f-c*d)/(a*e-b*d);
x = Math.floor((x+0.5)*1000)/1000;
x = Math.ceil((x-0.5)*1000)/1000;
y = Math.floor((y+0.5)*1000)/1000;
y = Math.ceil((y-0.5)*1000)/1000;
System.out.println(df.format(x)+" "+df.format(y) );
}
}
|
Main.java:3: error: class Simequ is public, should be declared in a file named Simequ.java
public class Simequ {
^
1 error
|
s008598291
|
p00004
|
Java
|
class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
double a = Double.parseDouble(scan.next());
double b = Double.parseDouble(scan.next());
double c = Double.parseDouble(scan.next());
double d = Double.parseDouble(scan.next());
double e = Double.parseDouble(scan.next());
double f = Double.parseDouble(scan.next());
DecimalFormat df = new DecimalFormat("0.000");
double x =(c*e-b*f)/(a*e-b*d);
double y = (a*f-c*d)/(a*e-b*d);
x = Math.floor((x+0.5)*1000)/1000;
x = Math.ceil((x-0.5)*1000)/1000;
y = Math.floor((y+0.5)*1000)/1000;
y = Math.ceil((y-0.5)*1000)/1000;
System.out.println(df.format(x)+" "+df.format(y) );
}
}
|
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:10: error: cannot find symbol
DecimalFormat df = new DecimalFormat("0.000");
^
symbol: class DecimalFormat
location: class Main
Main.java:10: error: cannot find symbol
DecimalFormat df = new DecimalFormat("0.000");
^
symbol: class DecimalFormat
location: class Main
4 errors
|
s400468919
|
p00004
|
Java
|
import java.util.Scanner;
public class a{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
double q,w,c,d;
q = 1;
w = 1;
while(s.hasNextDouble()){
double[] a = new double[6];
for(int b = 0; b < 6; b++){
a[b] = s.nextInt();
}
c = a[0];
d = a[3];
while(a[0] != a[3]){
if(a[0]<a[3]){
a[0] += c;
++q;
}else if(a[0] > a[3]){
a[3] += d;
++w;
}
}
a[1] = a[1]*q-a[4]*w;
a[2] = a[2]*q-a[5]*w;
a[2] = a[2]/a[1];
a[4] = a[4]*a[2];
a[5] = a[5]-a[4];
a[5] = a[5]/a[3];
System.out.printf("%.3f %.3f",a[5],a[2]);
}
}
}
|
Main.java:3: error: class a is public, should be declared in a file named a.java
public class a{
^
1 error
|
s333211130
|
p00004
|
Java
|
import java.util.*;
import java.math.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextDouble()){
double a=sc.nextDouble();
double b=sc.nextDouble();
double c=sc.nextnextDouble();
double d=sc.nextnextDouble();
double e=sc.nextnextDouble();
double f=sc.nextnextDouble();
double x=(c*e-b*f)/(a*e-b*d);
double y=(c*d-a*f)/(f*d-a*e);
BigDecimal p=new BigDecimal(x);
BigDecimal q=new BigDecimal(y);
p=p.setScale(3,BigDecimal.ROUND_HALF_UP);
q=q.setScale(3,BigDecimal.ROUND_HALF_UP);
System.out.printf("%.3f %.3f%n",x,y);
}
}
}
|
Main.java:10: error: cannot find symbol
double c=sc.nextnextDouble();
^
symbol: method nextnextDouble()
location: variable sc of type Scanner
Main.java:11: error: cannot find symbol
double d=sc.nextnextDouble();
^
symbol: method nextnextDouble()
location: variable sc of type Scanner
Main.java:12: error: cannot find symbol
double e=sc.nextnextDouble();
^
symbol: method nextnextDouble()
location: variable sc of type Scanner
Main.java:13: error: cannot find symbol
double f=sc.nextnextDouble();
^
symbol: method nextnextDouble()
location: variable sc of type Scanner
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s034300487
|
p00004
|
Java
|
import java.io.*;
import java.util.*;
public class p0_4{
public static void main(String args[]){
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
try{
String str=br.readLine();
StringTokenizer st=new StringTokenizer(str);
Double a=Double.parseDouble(st.nextToken());
Double b=Double.parseDouble(st.nextToken());
Double c=Double.parseDouble(st.nextToken());
Double d=Double.parseDouble(st.nextToken());
Double e=Double.parseDouble(st.nextToken());
Double f=Double.parseDouble(st.nextToken());
Double x=(f-(e*c/b))/(d-(e*a/b));
Double y=(c-(a*x))/b;
Double xx=x*10000%10/10000;
Double yy=y*10000%10/10000;
x=x-xx;
y=y-yy;
System.out.printf("%.3f",x);
System.out.print(" ");
System.out.printf("%.3f",y);
}catch(Exception e){
}
}
}
|
Main.java:3: error: class p0_4 is public, should be declared in a file named p0_4.java
public class p0_4{
^
1 error
|
s322283430
|
p00004
|
Java
|
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
List<Integer> list = new ArrayList<Integer>();
while (scanner.hasNext()) {
for (int i = 0; i < 6; i++) {
list.add(Integer.parseInt(scanner.next()));
}
String result = getResultOfRenritsu(list.get(0),
list.get(1),
list.get(2),
list.get(3),
list.get(4),
list.get(5));
System.out.println(result);
list.clear();
}
}
private static String getResultOfRenritsu(int a, int b, int c, int d, int e, int f) {
int xLCM = getLCM(a, d);
int aKake = xLCM / a;
a = a * aKake;
b = b * aKake;
c = c * aKake;
int dKake = xLCM / d;
d = d * dKake;
e = e * dKake;
f = f * dKake;
int g, h, x, y;
if (a > 0 && d > 0 || a < 0 && d < 0) {
g = b - e;
h = c - f;
y = h / g;
x = (-b * y + c) / a;
} else {
g = b + e;
h = c + f;
y = h / g;
x = (-b * y + c) / a;
}
return x + " " + y;
}
private static int getGCD(int a, int b) {
return b == 0 ? a : getGCD(b, a % b);
}
private static int getLCM(int a, int b) {
return a * b / getGCD(a, b);
}
}
|
Main.java:3: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
List<Integer> list = new ArrayList<Integer>();
^
symbol: class List
location: class Main
Main.java:4: error: cannot find symbol
List<Integer> list = new ArrayList<Integer>();
^
symbol: class ArrayList
location: class Main
4 errors
|
s225092011
|
p00004
|
Java
|
import java.text.DecimalFormat;
import java.util.Scanner;
public class Volume0_0004 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
DecimalFormat df = new DecimalFormat("0.000");
while (in.hasNext()) {
double[][] A = new double[2][2];
double[] b = new double[2];
A[0][0] = in.nextInt();
A[0][1] = in.nextInt();
b[0] = in.nextInt();
A[1][0] = in.nextInt();
A[1][1] = in.nextInt();
b[1] = in.nextInt();
double[] x = gaussJordan(A, b);
System.out.println(df.format(x[0])+" "+df.format(x[1]));
}
}
// solve Ax=b
static double[] gaussJordan(double[][] A, double[] b) {
int n = A.length;
double[][] B = new double[n][n+1];
for (int i=0;i<n;i++) {
for (int j=0;j<n;j++) {
B[i][j] = A[i][j];
}
B[i][n] = b[i];
}
for (int v=0;v<n;v++) { // for each variable(column)
// search for variable whose abs(coefficient) is max
int pivot = v;
for (int r=pivot;r<n;r++) {
if (Math.abs(B[r][v])>Math.abs(B[pivot][v])) {
pivot = r;
}
}
swapRowD(B, v, pivot);
for (int c=v+1;c<n+1;c++) {
B[v][c] /= B[v][v];
}
for (int r=0;r<n;r++) {
if (r==v) continue;
for (int c=v+1;c<n+1;c++) {
B[r][c] -= B[v][c]*B[r][v];
}
}
}
double[] res = new double[n];
for (int i=0;i<n;i++) {
res[i] = B[i][n];
}
return res;
}
static void swapRowD(double[][] A, int m, int n) {
double[] tmp = A[m];
A[m] = A[n];
A[n] = tmp;
}
}
|
Main.java:5: error: class Volume0_0004 is public, should be declared in a file named Volume0_0004.java
public class Volume0_0004 {
^
1 error
|
s506926219
|
p00004
|
Java
|
mport java.util.Scanner;
//Simultaneous Equation
public class AOJ0004 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double a[] = new double[6];
for(int i=0;i<6;i++)a[i]=sc.nextDouble();
double d = a[0]*a[4]-a[1]*a[3];
double x = (a[4]*a[2]-a[1]*a[5])/d;
double y = (a[0]*a[5]-a[2]*a[3])/d;
if(x==0)x=0;
if(y==0)y=0;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s601510015
|
p00004
|
Java
|
import java.util.Scanner;
//Simultaneous Equation
public class AOJ0004 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double a[] = new double[6];
for(int i=0;i<6;i++)a[i]=sc.nextDouble();
double d = a[0]*a[4]-a[1]*a[3];
double x = (a[4]*a[2]-a[1]*a[5])/d;
double y = (a[0]*a[5]-a[2]*a[3])/d;
if(x==0)x=0;
if(y==0)y=0;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:4: error: class AOJ0004 is public, should be declared in a file named AOJ0004.java
public class AOJ0004 {
^
1 error
|
s443587236
|
p00004
|
Java
|
package aizu_online_judge;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class Ex0004 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = null;
try {
while((line = br.readLine()) != null) {
line = line.trim();
String[] values = line.split("\\s");
if(values.length != 6) System.exit(-1);
double[] value = new double[6];
int i = 0;
for(String s : values) {
value[i] = Integer.parseInt(s);
if(value[i] < -1000 || value[i] > 1000) System.exit(-1);
i++;
}
double a = value[0];
double b = value[1];
double c = value[2];
double d = value[3];
double e = value[4];
double f = value[5];
double x = (c*e - f*b) / (a*e - b*d);
double y = (c*d - f*a) / (b*d - a*e);
BigDecimal bdX = new BigDecimal(x);
BigDecimal bdY = new BigDecimal(y);
bdX = bdX.setScale(3, BigDecimal.ROUND_HALF_UP);
bdY = bdY.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.println(bdX + " " + bdY);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
Main.java:8: error: class Ex0004 is public, should be declared in a file named Ex0004.java
public class Ex0004 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s376108624
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
class Main throws IOException {
public static void main(String[] a){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
while (line != null) {
String numArray[] = line.split(" ");
double a = Double.valueOf(numArray[0]);
double b = Double.valueOf(numArray[1]);
double c = Double.valueOf(numArray[2]);
double d = Double.valueOf(numArray[3]);
double e = Double.valueOf(numArray[4]);
double f = Double.valueOf(numArray[5]);
double x = (b * f - c * e) / (d * b - a * e);
double y = (c - a * x) / b;
BigDecimal xBD = new BigDecimal(x);
BigDecimal yBD = new BigDecimal(y);
BigDecimal xROUND = xBD.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal yROUND = yBD.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.print(xROUND);
System.out.print(" ");
System.out.println(yROUND);
line = br.readLine();
}
}
}
|
Main.java:7: error: '{' expected
class Main throws IOException {
^
1 error
|
s783685642
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
class Main throws IOException {
public static void main(String[] a){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
while (line != null) {
String numArray[] = line.split(" ");
double a = Double.valueOf(numArray[0]);
double b = Double.valueOf(numArray[1]);
double c = Double.valueOf(numArray[2]);
double d = Double.valueOf(numArray[3]);
double e = Double.valueOf(numArray[4]);
double f = Double.valueOf(numArray[5]);
double x = (b * f - c * e) / (d * b - a * e);
double y = (c - a * x) / b;
BigDecimal xBD = new BigDecimal(x);
BigDecimal yBD = new BigDecimal(y);
BigDecimal xROUND = xBD.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal yROUND = yBD.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.print(xROUND);
System.out.print(" ");
System.out.println(yROUND);
line = br.readLine();
}
}
}
|
Main.java:7: error: '{' expected
class Main throws IOException {
^
1 error
|
s139194974
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
class Main{
public static void main(String[] a) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
while (line != null) {
String numArray[] = line.split(" ");
double a = Double.valueOf(numArray[0]);
double b = Double.valueOf(numArray[1]);
double c = Double.valueOf(numArray[2]);
double d = Double.valueOf(numArray[3]);
double e = Double.valueOf(numArray[4]);
double f = Double.valueOf(numArray[5]);
double x = (b * f - c * e) / (d * b - a * e);
double y = (c - a * x) / b;
BigDecimal xBD = new BigDecimal(x);
BigDecimal yBD = new BigDecimal(y);
BigDecimal xROUND = xBD.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal yROUND = yBD.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.print(xROUND);
System.out.print(" ");
System.out.println(yROUND);
line = br.readLine();
}
}
}
|
Main.java:13: error: variable a is already defined in method main(String[])
double a = Double.valueOf(numArray[0]);
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s788183553
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
class Main{
public static void main(String[] a) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
while (line != null) {
String numArray[] = line.split(" ");
double a = Double.valueOf(numArray[0]);
double b = Double.valueOf(numArray[1]);
double c = Double.valueOf(numArray[2]);
double d = Double.valueOf(numArray[3]);
double e = Double.valueOf(numArray[4]);
double f = Double.valueOf(numArray[5]);
double x = (b * f - c * e) / (d * b - a * e);
double y = (c - a * x) / b;
BigDecimal xBD = new BigDecimal(x);
BigDecimal yBD = new BigDecimal(y);
BigDecimal xROUND = xBD.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal yROUND = yBD.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.print(xROUND);
System.out.print(" ");
System.out.println(yROUND);
line = br.readLine();
}
}
}
|
Main.java:11: error: variable a is already defined in method main(String[])
double a = Double.valueOf(numArray[0]);
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s521362289
|
p00004
|
Java
|
import java.util.Scanner;
class Main{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
while(input.hasNext())
{
double a1=input.nextDouble(),b1=input.nextDouble(),c1=input.nextDouble()
,a2=input.nextDouble(),b2=input.nextDouble(),c2=input.nextDouble();
double a=(c1*b2-b1*c2)/(a1*b2-b1*a2);
double b=(c2*a1-a2*c1)/(a1*b2-b1*a2);
if(a==-0)
{
a=0;
}
else if(b==-0)
{
b=0;
}
System.out.format("%.3f %.3f\n",a,b);
}
}
|
Main.java:24: error: reached end of file while parsing
}
^
1 error
|
s104036116
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class SimultaneousEquation {
public static void main(String args[]) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String buf;
int a,b,c,d,e,f;
double x,y;
try{
while((buf = br.readLine())!=null)
{
StringTokenizer st = new StringTokenizer(buf);
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
c = Integer.parseInt(st.nextToken());
d = Integer.parseInt(st.nextToken());
e = Integer.parseInt(st.nextToken());
f = Integer.parseInt(st.nextToken());
x = (e*c-b*f)/(a*e-b*d);
y = (-d*c+f*a)/(a*e-b*d);
System.out.println(String.format("%.3f", x)+" "+String.format("%.3f", y));
}
} catch (Exception err){
System.out.println("Exception");
}
}
}
|
Main.java:5: error: class SimultaneousEquation is public, should be declared in a file named SimultaneousEquation.java
public class SimultaneousEquation {
^
1 error
|
s498239188
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main{
public static void main(String a[]) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sir);
String buf;
int a,b,c,d,e,f;
double x,y;
try{
while((buf = br.readLine())!=null)
{
StringTokenizer st = new StringTokenizer(buf);
a = Integer.parseInt(st.nextToken());
b = Integer.parseInt(st.nextToken());
c = Integer.parseInt(st.nextToken());
d = Integer.parseInt(st.nextToken());
e = Integer.parseInt(st.nextToken());
f = Integer.parseInt(st.nextToken());
x = (e*c-b*f)/(a*e-b*d);
y = (-d*c+f*a)/(a*e-b*d);
if(x == -0.0) x = 0.0;
if(y == -0.0) y = 0.0;
System.out.printf("%4.3f %4.3f\n", x, y);
}
} catch (Exception err){
System.out.println("Exception");
}
}
}
|
Main.java:8: error: cannot find symbol
BufferedReader br = new BufferedReader(sir);
^
symbol: variable sir
location: class Main
Main.java:10: error: variable a is already defined in method main(String[])
int a,b,c,d,e,f;
^
2 errors
|
s123517903
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
public class Main {
public static void main(String[] a) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> al = new ArrayList<String>();
String str;
// 1???????????\?????????????????????????????????
while ((str = br.readLine()) != null) {
if (str.length() == 0) {
break;
}
al.add(str);
}
BigDecimal[][] ans = new BigDecimal[al.size()][2];
// ??£???????¨????
int len = al.size();
for (int i = 0; i < len; i++) {
String[] buf = al.get(0).split(" ");
// ???????????????1??????????????????????????°??????????????????
double a = Double.parseDouble(buf[0]);
double b = Double.parseDouble(buf[1]);
double c = Double.parseDouble(buf[2]);
double d = Double.parseDouble(buf[3]);
double e = Double.parseDouble(buf[4]);
double f = Double.parseDouble(buf[5]);
// y????±?????????????
double y = yOperation(a, b, c, d, e, f);
// x????±?????????????
double x = xOperation(a, b, c, y);
// ?°???°?????\????¬¬??????????????¨?????\
BigDecimal bdx = new BigDecimal(x);
bdx = bdx.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal bdy = new BigDecimal(y);
bdy = bdy.setScale(3, BigDecimal.ROUND_HALF_UP);
ans[i][0] = bdx;
ans[i][1] = bdy;
}
// ??????
for (int i = 0; i < ans.length; i++) {
System.out.printf("%4.3f" + " " + "%4.3f" + "\n", ans[i][0],
ans[i][1]);
}
}
private static double yOperation(double a, double b, double c, double d,
double e, double f) {
double y;
try {
y = (f + -(d * c / a)) / ((d * -b / a) + e);
} catch (ArithmeticException ae) {
y = 0;
}
return y;
}
private static double xOperation(double a, double b, double c, double y) {
double x;
try {
x = (c + -(b * y)) / a;
} catch (ArithmeticException ae) {
x=0;
}
return x;
}
}
|
Main.java:30: error: variable a is already defined in method main(String[])
double a = Double.parseDouble(buf[0]);
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s278024859
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class SimultaneousEquation {
public class UnknowNumbers{
float x;
float y;
}
public UnknowNumbers formula(float para_a, float para_b, float para_c, float para_d, float para_e, float para_f){
UnknowNumbers numbers = new UnknowNumbers();
if(para_a == 0){
numbers.y = para_c / para_b;
numbers.x = ((para_b * para_f) - (para_c * para_e)) / (para_d * para_b);
} else if((para_a * para_e) - (para_d * para_b) == 0){
System.out.println("The parallel lines!!!");
System.exit(0);
} else{
numbers.y = ((para_a * para_f) - (para_d * para_c)) / ((para_a * para_e) - (para_d * para_b));
numbers.x = (para_c - para_b * numbers.y) / para_a;
}
return numbers;
}
public static void main(String[] args){
SimultaneousEquation equation = new SimultaneousEquation();
UnknowNumbers numbers;
String[] strParameters;
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
while(true){
try{
String buf = br.readLine();
if(buf == null) break;
strParameters = buf.split(" ");
}catch(Exception e){
System.out.print(e);
break;
}
float[] parameters = new float[strParameters.length];
for(int iPara = 0; iPara < strParameters.length; iPara++){
parameters[iPara] = Float.parseFloat(strParameters[iPara]);
}
numbers = equation.formula(parameters[0],parameters[1],parameters[2],parameters[3],parameters[4],parameters[5]);
System.out.printf("%.3f %.3f\n",numbers.x,numbers.y);
}
}
}
|
Main.java:4: error: class SimultaneousEquation is public, should be declared in a file named SimultaneousEquation.java
public class SimultaneousEquation {
^
1 error
|
s945196860
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class SimultaneousEquation {
public class UnknowNumbers{
float x;
float y;
}
public UnknowNumbers formula(float para_a, float para_b, float para_c, float para_d, float para_e, float para_f){
UnknowNumbers numbers = new UnknowNumbers();
if(para_a == 0){
if(para_b == 0){
System.out.println("a and b should not equals 0 at the same time!!!");
System.exit(0);
}
numbers.y = para_c / para_b;
if(para_d == 0){
System.out.println("The parallel lines or the same line!!!");
System.exit(0);
}
numbers.x = ((para_b * para_f) - (para_c * para_e)) / (para_d * para_b);
} else if((para_a * para_e) - (para_d * para_b) == 0){
System.out.println("The parallel lines or the same line!!!");
System.exit(0);
} else{
numbers.y = ((para_a * para_f) - (para_d * para_c)) / ((para_a * para_e) - (para_d * para_b));
numbers.x = (para_c - para_b * numbers.y) / para_a;
}
return numbers;
}
public static void main(String[] args){
SimultaneousEquation equation = new SimultaneousEquation();
UnknowNumbers numbers;
String[] strParameters;
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
while(true){
try{
String buf = br.readLine();
if(buf == null) break;
strParameters = buf.split(" ");
}catch(Exception e){
System.out.print(e);
break;
}
float[] parameters = new float[strParameters.length];
for(int iPara = 0; iPara < strParameters.length; iPara++){
parameters[iPara] = Float.parseFloat(strParameters[iPara]);
if(parameters[iPara] < -1000 || parameters[iPara] > 1000){
System.out.println("Some parameters out of limit!");
System.exit(0);
}
}
numbers = equation.formula(parameters[0],parameters[1],parameters[2],parameters[3],parameters[4],parameters[5]);
if(numbers.x == -0f) numbers.x = 0.0f;
if(numbers.y == -0f) numbers.y = 0.0f;
System.out.printf("%.3f %.3f\n",numbers.x,numbers.y);
}
}
}
|
Main.java:4: error: class SimultaneousEquation is public, should be declared in a file named SimultaneousEquation.java
public class SimultaneousEquation {
^
1 error
|
s727355547
|
p00004
|
Java
|
package aoj;
import java.util.Scanner;
public class Renritsuhouteisiki {
static int a,b,c,d,e,f;
static double x,y;
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner s = new Scanner(System.in);
while(true){
a = s.nextInt();
b = s.nextInt();
c = s.nextInt();
d = s.nextInt();
e = s.nextInt();
f = s.nextInt();
x = (e*c-b*f)/(a+e-b*d);
y = (a*f-d*c)/(a*e-b*d);
System.out.printf("%4.3f",x);
System.out.print(" ");
System.out.printf("%4.3f",y);
}
}
}
|
Main.java:3: error: class Renritsuhouteisiki is public, should be declared in a file named Renritsuhouteisiki.java
public class Renritsuhouteisiki {
^
1 error
|
s979914826
|
p00004
|
Java
|
import java.util.Scanner;
public class Renritsuhouteisiki {
static int a,b,c,d,e,f;
static double x,y;
public static void main(String[] args) {
// TODO ?????????????????????????????????????????????
Scanner s = new Scanner(System.in);
while(true){
a = s.nextInt();
b = s.nextInt();
c = s.nextInt();
d = s.nextInt();
e = s.nextInt();
f = s.nextInt();
x = (e*c-b*f)/(a+e-b*d);
y = (a*f-d*c)/(a*e-b*d);
System.out.printf("%4.3f",x);
System.out.print(" ");
System.out.printf("%4.3f",y);
}
}
}
|
Main.java:3: error: class Renritsuhouteisiki is public, should be declared in a file named Renritsuhouteisiki.java
public class Renritsuhouteisiki {
^
1 error
|
s185581942
|
p00004
|
Java
|
import java.util.Scanner;
public class main {
static int a,b,c,d,e,f;
static double x,y;
private static Scanner s;
public static void main(String[] args) {
s = new Scanner(System.in);
while(true){
a = s.nextInt();
b = s.nextInt();
c = s.nextInt();
d = s.nextInt();
e = s.nextInt();
f = s.nextInt();
x = (e*c-b*f)/(a+e-b*d);
y = (a*f-d*c)/(a*e-b*d);
System.out.printf("%4.3f",x);
System.out.print(" ");
System.out.printf("%4.3f",y);
}
}
}
|
Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s749441832
|
p00004
|
Java
|
import java.util.Scanner;
public class SE{
public static void Main(String[] args){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double a = sc.nextDouble();double b = sc.nextDouble();double c = sc.nextDouble();
double d = sc.nextDouble();double e = sc.nextDouble();double f = sc.nextDouble();
double sum1 = 0.0;double sum2 = 0.0;
double x = 0.0;double y = 0.0;
if(a>d && 0>d){
sum1 = (b*(-d) + e*a);
sum2 = (c*(-d) + f*a);
y = sum2 / sum1;
x = (c - b*y)/a;
}else if(a>d && d>0){
sum1 = (b*d + e*(-a));
sum2 = (c*d + f*(-a));
y = sum2 / sum1;
x = (c - b*y)/a;
}else if(a<d && 0>a){
sum1 = (b*d + e*a);
sum2 = (c*d + f*a);
y = sum2 / sum1;
x = (c - b*y)/a;
}else if(a<d && 0<a){
sum1 = (b*d + e*(-a));
sum2 = (c*d + f*(-a));
y = sum2 / sum1;
x = (c - b*y)/a;
}else if(a == d){
sum1 = b - e;
sum2 = c - f;
y = sum2 / sum1;
x = (c - b*y)/a;
}else if(a == -d || -a == d){
sum1 = b + e;
sum2 = c + f;
y = sum2 / sum1;
x = (c - b*y)/a;
}
System.out.printf("%.3f %.3f",x,y);
}
}
}
|
Main.java:2: error: class SE is public, should be declared in a file named SE.java
public class SE{
^
1 error
|
s491005656
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.math.BigDecimal;
class Main{
public static void main(String[]args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
while((str= br.readLine()) != null){
String[] str2 = str.split(" ");
double a = Double.parseDouble(str2[0]);
double b = Double.parseDouble(str2[1]);
double c = Double.parseDouble(str2[2]);
double d = Double.parseDouble(str2[3]);
double e = Double.parseDouble(str2[4]);
double f = Double.parseDouble(str2[5]);
double x = (c*e - b*f) / (a*e - b*d);
double y = (c*d - a*f) / (b*d - a*e);
BigDecimal bdY = new BigDecimal(y);
BigDecimal bdX = new BigDecimal(x);
bdY = bdY.setScale(3, BigDecimal.ROUND_HALF_UP);
bdX = bdX.setScale(3, BigDecimal.ROUND_HALF_UP);
if(bdX == -0.000){
bdX = 0.000;
}
if(bdY == -0.000){
bdY = 0.000;
}
System.out.printf("%.3f %.3f",bdX,bdY);
}
}
}
|
Main.java:30: error: bad operand types for binary operator '=='
if(bdX == -0.000){
^
first type: BigDecimal
second type: double
Main.java:31: error: incompatible types: double cannot be converted to BigDecimal
bdX = 0.000;
^
Main.java:33: error: bad operand types for binary operator '=='
if(bdY == -0.000){
^
first type: BigDecimal
second type: double
Main.java:34: error: incompatible types: double cannot be converted to BigDecimal
bdY = 0.000;
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s706320659
|
p00004
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
ArrayList<Value> list = new ArrayList<>();
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
list.add(equation(sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()));
}
for(int i = 0,size = list.size();i < size;i++){
Value e = list.get(i);
System.out.println(String.format("%.3f %.3f",e.x,e.y));
}
}
static Value equation(int a,int b,int c,int d,int e,int f){
Value value = new Value(0,0);
int _a = a,_b = b,_c = c;
if(b < 0){
a *= -1;
b *= -1;
c *= -1;
}
if(e < 0){
d *= -1;
e *= -1;
f *= -1;
}
int lcm = getLcm(b,e);
{
int pow = lcm / b;
a *= pow;
c *= pow;
}
{
int pow = lcm / e;
d *= -pow;
f *= -pow;
}
int x = a + d;
int dust = c + f;
value.x = dust / (double)x;
value.y = (_a * value.x + _c) / (double)b;
return value;
}
static double getX(
static int getGed(int a,int b){
while(a != b){
if(a > b) a -= b;
else b -= a;
}
return a;
}
static int getLcm(int a,int b){
return a * b / getGed(a,b);
}
static class Value{
double x,y;
Value(double x,double y){
this.x = x;
this.y = y;
}
}
}
|
Main.java:49: error: modifier static not allowed here
static int getGed(int a,int b){
^
Main.java:49: error: ',', ')', or '[' expected
static int getGed(int a,int b){
^
Main.java:49: error: <identifier> expected
static int getGed(int a,int b){
^
Main.java:49: error: ';' expected
static int getGed(int a,int b){
^
4 errors
|
s031069635
|
p00004
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<String> ans = new ArrayList<>();
while(sc.hasNext()){
double a = {sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble()};
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
}
for(int i = 0,size = ans.size();i < size;i++){
System.out.println(ans.get(i));
}
}
static double getX(double[] v){
double x1 = v[0] * Math.abs(v[4]);
double c1 = v[2] * Math.abs(v[4]);
double x2 = v[3] * Math.abs(v[1]);
double c2 = v[5] * Math.abs(v[1]);
if((v[1] >= 0) == (v[4] >= 0)){
x2 *= -1;
c2 *= -1;
}
return (c1 + c2) / (x1 + x2);
}
static double getY(double[] v){
double y1 = v[1] * Math.abs(v[3]);
double c1 = v[2] * Math.abs(v[3]);
double y2 = v[4] * Math.abs(v[0]);
double c2 = v[5] * Math.abs(v[0]);
if((v[1] >= 0) == (v[4] >= 0)){
y2 *= -1;
c2 *= -1;
}
return (c1 + c2) / (y1 + y2);
}
}
|
Main.java:8: error: illegal initializer for double
double a = {sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble()};
^
Main.java:9: error: incompatible types: double cannot be converted to double[]
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
^
Main.java:9: error: incompatible types: double cannot be converted to double[]
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
|
s142103057
|
p00004
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<String> ans = new ArrayList<>();
while(sc.hasNext()){
double a = {sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble()};
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
}
for(int i = 0,size = ans.size();i < size;i++){
System.out.println(ans.get(i));
}
}
static double getX(double[] v){
double x1 = v[0] * Math.abs(v[4]);
double c1 = v[2] * Math.abs(v[4]);
double x2 = v[3] * Math.abs(v[1]);
double c2 = v[5] * Math.abs(v[1]);
if((v[1] >= 0) == (v[4] >= 0)){
x2 *= -1;
c2 *= -1;
}
return (c1 + c2) / (x1 + x2);
}
static double getY(double[] v){
double y1 = v[1] * Math.abs(v[3]);
double c1 = v[2] * Math.abs(v[3]);
double y2 = v[4] * Math.abs(v[0]);
double c2 = v[5] * Math.abs(v[0]);
if((v[1] >= 0) == (v[4] >= 0)){
y2 *= -1;
c2 *= -1;
}
return (c1 + c2) / (y1 + y2);
}
}
|
Main.java:8: error: illegal initializer for double
double a = {sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble(),sc.nextDouble()};
^
Main.java:9: error: incompatible types: double cannot be converted to double[]
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
^
Main.java:9: error: incompatible types: double cannot be converted to double[]
ans.add(String.format("%.3f %.3f",getX(a),getY(a)));
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
|
s549334700
|
p00004
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
List<Double> listX = new ArrayList<Double>();
List<Double> listY = new ArrayList<Double>();
while(scan.hasNext()){
double a = scan.nextDouble();
double b = scan.nextDouble();
double c = scan.nextDouble();
double d = scan.nextDouble();
double e = scan.nextDouble();
double f = scan.nextDouble();
double y = (f * a - d * c)/(-d * b + e * a);
double x = (f * b - e * c)/(b * d - e * a);
listX.add(x);
listY.add(y);
}
Iterator<Double> itX = listX.iterator();
Iterator<Double> itY = listY.iterator();
while(itX.hasNext()){
x = itX.next();
y = itY.next();
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:24: error: cannot find symbol
x = itX.next();
^
symbol: variable x
location: class Main
Main.java:25: error: cannot find symbol
y = itY.next();
^
symbol: variable y
location: class Main
Main.java:26: error: cannot find symbol
System.out.printf("%.3f %.3f\n", x, y);
^
symbol: variable x
location: class Main
Main.java:26: error: cannot find symbol
System.out.printf("%.3f %.3f\n", x, y);
^
symbol: variable y
location: class Main
4 errors
|
s439508524
|
p00004
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
List<Double> listX = new ArrayList<Double>();
List<Double> listY = new ArrayList<Double>();
while(scan.hasNext()){
double a = scan.nextDouble();
double b = scan.nextDouble();
double c = scan.nextDouble();
double d = scan.nextDouble();
double e = scan.nextDouble();
double f = scan.nextDouble();
double y = (f * a - d * c)/(-d * b + e * a);
double x = (f * b - e * c)/(b * d - e * a);
if(x == 0)x = 0.; // 0????°???°?????\?????¨???????????????
if(y == 0)y = 0.;
listX.add(x);
listY.add(y);
}
Iterator<Double> itX = listX.iterator();
Iterator<Double> itY = listY.iterator();
while(itX.hasNext()){
double x = itX.next();
double y = itY.next();
System.out.printf("%.3f %.3f\n", x, y);
}
}
|
Main.java:30: error: reached end of file while parsing
}
^
1 error
|
s093137477
|
p00004
|
Java
|
import java.util.Scanner;
public class vol0_0004 {
public static void main(String[] a) {
Scanner scn = new Scanner(System.in);
try {
while (true) {
float sim_eq[] = new float[6];
float x, y;
for (int i = 0; i < 6; i++) {
sim_eq[i] = scn.nextFloat();
}
float div = sim_eq[3] / sim_eq[0];
sim_eq[0] *= div;
sim_eq[1] *= div;
sim_eq[2] *= div;
y = (sim_eq[5] - sim_eq[2]) / (sim_eq[4] - sim_eq[1]);
x = (sim_eq[5] - sim_eq[4] * y) / sim_eq[3];
String x_str = String.format("%.3f", x);
String y_str = String.format("%.3f", y);
System.out.println(x_str + " " + y_str);
}
} catch (Exception e) {
}
}
}
|
Main.java:3: error: class vol0_0004 is public, should be declared in a file named vol0_0004.java
public class vol0_0004 {
^
1 error
|
s513392612
|
p00004
|
Java
|
import java.util.Scanner;
public class Q4 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
String[] data = scan.nextLine().split(" ", 0);
double[] num = new double[6];
for (int i = 0; i < 6; i++) {
num[i] = Double.parseDouble(data[i]);
}
double x = (num[2]*num[4]-num[1]*num[5])/(num[0]*num[4]-num[1]*num[3]);
if (x < 10E-9) x = 0;
double y = -(num[2]*num[3]-num[0]*num[5])/(num[0]*num[4]-num[1]*num[3]);
if (y < 10E-9) y = 0;
System.out.println(x + " " + y);
}
}
}
|
Main.java:3: error: class Q4 is public, should be declared in a file named Q4.java
public class Q4 {
^
1 error
|
s135163149
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inData = br.readLine();
do {
String[] abcdef = inData.split(" ");
double x = (getDouble(abcdef[1]) * getDouble(abcdef[5])
- getDouble(abcdef[2]) * getDouble(abcdef[4]))
/ (getDouble(abcdef[1]) * getDouble(abcdef[3])
- getDouble(abcdef[0]) * getDouble(abcdef[4]));
double y = (getDouble(abcdef[2]) - getDouble(abcdef[0]) * x) / getDouble(abcdef[1]);
System.out.printf("%.3f ", x);
System.out.printf("%.3f\n", y);
} while (!"".equals(inData = br.readLine()) || inDate == null);
}
private static double getDouble(String d) {
return Double.parseDouble(d);
}
}
|
Main.java:19: error: cannot find symbol
} while (!"".equals(inData = br.readLine()) || inDate == null);
^
symbol: variable inDate
location: class Main
1 error
|
s412645146
|
p00004
|
Java
|
import java.util.*;
import java.util.stream.*;
import java.io.*;
class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
br.lines()
.map(line -> Stream.of(line.split(" "))
.mapToInt(Integer::parseInt)
.toArray())
.map(ar -> Stream.of(
(double)(ar[1] * ar[5] - ar[4] * ar[2])/(ar[1] * ar[3] - ar[4] * ar[0]),
(double)(ar[5] * ar[0] - ar[2] * ar[3])/(ar[0] * ar[4] - ar[1] * ar[3])
).toArray())
.forEach(xy -> System.out.printf("%.3f %.3f\n", Math.round(xy[0], 3), Math.round(xy[1], 3)));
}
}
|
Main.java:15: error: no suitable method found for round(Object,int)
.forEach(xy -> System.out.printf("%.3f %.3f\n", Math.round(xy[0], 3), Math.round(xy[1], 3)));
^
method Math.round(float) is not applicable
(actual and formal argument lists differ in length)
method Math.round(double) is not applicable
(actual and formal argument lists differ in length)
Main.java:15: error: no suitable method found for round(Object,int)
.forEach(xy -> System.out.printf("%.3f %.3f\n", Math.round(xy[0], 3), Math.round(xy[1], 3)));
^
method Math.round(float) is not applicable
(actual and formal argument lists differ in length)
method Math.round(double) is not applicable
(actual and formal argument lists differ in length)
2 errors
|
s590427132
|
p00004
|
Java
|
import java.util.*;
import java.util.stream.*;
import java.io.*;
class Main {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
br.lines()
.map(line -> Stream.of(line.split(" "))
.mapToInt(Integer::parseInt)
.toArray())
.map(ar -> Stream.of(
new BigDecimal((double)(ar[1] * ar[5] - ar[4] * ar[2])/(ar[1] * ar[3] - ar[4] * ar[0])).setScale(3, RoundingMode.HALF_UP),
new BigDecimal((double)(ar[5] * ar[0] - ar[2] * ar[3])/(ar[0] * ar[4] - ar[1] * ar[3])).setScale(3, RoundingMode.HALF_UP)
).toArray())
.forEach(xy -> System.out.println(xy[0].toString() + " " + xy[1].toString()));
}
}
|
Main.java:12: error: cannot find symbol
new BigDecimal((double)(ar[1] * ar[5] - ar[4] * ar[2])/(ar[1] * ar[3] - ar[4] * ar[0])).setScale(3, RoundingMode.HALF_UP),
^
symbol: variable RoundingMode
location: class Main
Main.java:12: error: cannot find symbol
new BigDecimal((double)(ar[1] * ar[5] - ar[4] * ar[2])/(ar[1] * ar[3] - ar[4] * ar[0])).setScale(3, RoundingMode.HALF_UP),
^
symbol: class BigDecimal
location: class Main
Main.java:13: error: cannot find symbol
new BigDecimal((double)(ar[5] * ar[0] - ar[2] * ar[3])/(ar[0] * ar[4] - ar[1] * ar[3])).setScale(3, RoundingMode.HALF_UP)
^
symbol: variable RoundingMode
location: class Main
Main.java:13: error: cannot find symbol
new BigDecimal((double)(ar[5] * ar[0] - ar[2] * ar[3])/(ar[0] * ar[4] - ar[1] * ar[3])).setScale(3, RoundingMode.HALF_UP)
^
symbol: class BigDecimal
location: class Main
Main.java:15: error: array required, but Object found
.forEach(xy -> System.out.println(xy[0].toString() + " " + xy[1].toString()));
^
Main.java:15: error: array required, but Object found
.forEach(xy -> System.out.println(xy[0].toString() + " " + xy[1].toString()));
^
6 errors
|
s794186076
|
p00004
|
Java
|
import java.util.Scanner;
//Simultaneous Equation
public class AOJ0004 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double a[] = new double[6];
for(int i=0;i<6;i++)a[i]=sc.nextDouble();
double d = a[0]*a[4]-a[1]*a[3];
double x = (a[4]*a[2]-a[1]*a[5])/d;
double y = (a[0]*a[5]-a[2]*a[3])/d;
if(x==0)x=0;
if(y==0)y=0;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:4: error: class AOJ0004 is public, should be declared in a file named AOJ0004.java
public class AOJ0004 {
^
1 error
|
s311168112
|
p00004
|
Java
|
import java.util.*;
public class aoj0004 {
static final Scanner stdin = new Scanner(System.in);
public static void main(String[] args) {
while(stdin.hasNext()){
double a = stdin.nextDouble();
double b = stdin.nextDouble();
double c = stdin.nextDouble();
double d = stdin.nextDouble();
double e = stdin.nextDouble();
double f = stdin.nextDouble();
double x[] = solve(a,b,c,d,e,f);
System.out.printf("%.3f %.3f\n", x[0], x[1]);
}
}
static final double[] solve(double a, double b, double c, double d, double e, double f){
double[] ans = new double[2];
ans[0] = (c*e - b*f) / (a*e - b*d) + 0.0; //+0.0 ???????????¨??´???????????£??????
ans[1] = (a*f - c*d) / (a*e - b*d) + 0.0; //printf????????¨??? -0.000??¨??????wrong answer????????£????????????
return ans;
}
}
|
Main.java:2: error: class aoj0004 is public, should be declared in a file named aoj0004.java
public class aoj0004 {
^
1 error
|
s147896842
|
p00004
|
Java
|
import java.math.BigDecimal;
import java.util.Scanner;
public class SimultaneousEquation {
static Scanner sc = new java.util.Scanner(System.in);
public static void main(String[] args) {
while ( sc.hasNext() ){
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
int e = sc.nextInt();
int f = sc.nextInt();
double x = ( c*e - b*f ) / ( a*e - b*d );
double y = ( a*f - c*d ) / ( a*e - b*d );
BigDecimal bix = new BigDecimal (String.valueOf(x));
BigDecimal biy = new BigDecimal (String.valueOf(y));
x =bix.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
y =biy.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
String xx = String.format("%.3f",x);
String yy = String.format("%.3f",y);
System.out.println( xx + " " + yy );
}
}
}
|
Main.java:4: error: class SimultaneousEquation is public, should be declared in a file named SimultaneousEquation.java
public class SimultaneousEquation {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s893803117
|
p00004
|
Java
|
import java.math.BigDecimal;
import java.util.Scanner;
public class Main1 {
public static void main(String[] args) {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
Scanner stdin = new Scanner(System.in);
a = stdin.nextInt();
b = stdin.nextInt();
c = stdin.nextInt();
d = stdin.nextInt();
e = stdin.nextInt();
f = stdin.nextInt();
BigDecimal biX = new BigDecimal(String.valueOf((e * c - b * f)/(a * e - b * d)));
BigDecimal biY = new BigDecimal(String.valueOf((d * c - a * f)/(b * d - a * e)));
double x = biX.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double y = biY.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
System.out.println(x + "," + y);
}
}
|
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s854257955
|
p00004
|
Java
|
public class Main {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
int a = stdin.nextInt();
int b = stdin.nextInt();
int c = stdin.nextInt();
int d = stdin.nextInt();
int e = stdin.nextInt();
int f = stdin.nextInt();
int h = stdin.nextInt();
int i = stdin.nextInt();
int j = stdin.nextInt();
int k = stdin.nextInt();
int l = stdin.nextInt();
int m = stdin.nextInt();
System.out.println(a + ", " + b + ", " + c + ", " + d + ", " + e + ", " + f);
System.out.println(h + ", " + i + ", " + j + ", " + k + ", " + l + ", " + m);
BigDecimal biX = new BigDecimal(String.valueOf((e * c - b * f)/(a * e - b * d)));
BigDecimal biY = new BigDecimal(String.valueOf((d * c - a * f)/(b * d - a * e)));
BigDecimal biZ = new BigDecimal(String.valueOf((l * j - i * m)/(h * l - i * k)));
BigDecimal biW = new BigDecimal(String.valueOf((k * j - h * m)/(i * k - h * l)));
double x = biX.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double y = biY.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double z = biZ.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double w = biW.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
System.out.println(x + "," + y);
System.out.println(z + "," + w);
}
}
|
Main.java:5: error: cannot find symbol
Scanner stdin = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner stdin = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:26: error: cannot find symbol
BigDecimal biX = new BigDecimal(String.valueOf((e * c - b * f)/(a * e - b * d)));
^
symbol: class BigDecimal
location: class Main
Main.java:26: error: cannot find symbol
BigDecimal biX = new BigDecimal(String.valueOf((e * c - b * f)/(a * e - b * d)));
^
symbol: class BigDecimal
location: class Main
Main.java:27: error: cannot find symbol
BigDecimal biY = new BigDecimal(String.valueOf((d * c - a * f)/(b * d - a * e)));
^
symbol: class BigDecimal
location: class Main
Main.java:27: error: cannot find symbol
BigDecimal biY = new BigDecimal(String.valueOf((d * c - a * f)/(b * d - a * e)));
^
symbol: class BigDecimal
location: class Main
Main.java:28: error: cannot find symbol
BigDecimal biZ = new BigDecimal(String.valueOf((l * j - i * m)/(h * l - i * k)));
^
symbol: class BigDecimal
location: class Main
Main.java:28: error: cannot find symbol
BigDecimal biZ = new BigDecimal(String.valueOf((l * j - i * m)/(h * l - i * k)));
^
symbol: class BigDecimal
location: class Main
Main.java:29: error: cannot find symbol
BigDecimal biW = new BigDecimal(String.valueOf((k * j - h * m)/(i * k - h * l)));
^
symbol: class BigDecimal
location: class Main
Main.java:29: error: cannot find symbol
BigDecimal biW = new BigDecimal(String.valueOf((k * j - h * m)/(i * k - h * l)));
^
symbol: class BigDecimal
location: class Main
Main.java:31: error: cannot find symbol
double x = biX.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
^
symbol: variable BigDecimal
location: class Main
Main.java:32: error: cannot find symbol
double y = biY.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
^
symbol: variable BigDecimal
location: class Main
Main.java:33: error: cannot find symbol
double z = biZ.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
^
symbol: variable BigDecimal
location: class Main
Main.java:34: error: cannot find symbol
double w = biW.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
^
symbol: variable BigDecimal
location: class Main
14 errors
|
s869920820
|
p00004
|
Java
|
import java.math.BigDecimal;
import java.util.Scanner;
public class Main1 {
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
int a = stdin.nextInt();
int b = stdin.nextInt();
int c = stdin.nextInt();
int d = stdin.nextInt();
int e = stdin.nextInt();
int f = stdin.nextInt();
int h = stdin.nextInt();
int i = stdin.nextInt();
int j = stdin.nextInt();
int k = stdin.nextInt();
int l = stdin.nextInt();
int m = stdin.nextInt();
System.out.println(a + ", " + b + ", " + c + ", " + d + ", " + e + ", " + f);
System.out.println(h + ", " + i + ", " + j + ", " + k + ", " + l + ", " + m);
BigDecimal biX = new BigDecimal(String.valueOf((e * c - b * f)/(a * e - b * d)));
BigDecimal biY = new BigDecimal(String.valueOf((d * c - a * f)/(b * d - a * e)));
BigDecimal biZ = new BigDecimal(String.valueOf((l * j - i * m)/(h * l - i * k)));
BigDecimal biW = new BigDecimal(String.valueOf((k * j - h * m)/(i * k - h * l)));
double x = biX.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double y = biY.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double z = biZ.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
double w = biW.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
System.out.println(x + "," + y);
System.out.println(z + "," + w);
}
}
|
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s391700738
|
p00004
|
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));
String str = br.readLine();
while(str != null){
String lns[] = str.split(" ");
int a = lns[0];
int b = lns[1];
int c = lns[2];
int d = lns[3];
int e = lns[4];
int f = lns[5];
System.out.println(a + " " + b + " " + c + " " + d + " " + e + " " + f );
}
// System.out.println(String.format("%d:%d:%d", hour, min, sec));
}
}
|
Main.java:13: error: incompatible types: String cannot be converted to int
int a = lns[0];
^
Main.java:14: error: incompatible types: String cannot be converted to int
int b = lns[1];
^
Main.java:15: error: incompatible types: String cannot be converted to int
int c = lns[2];
^
Main.java:16: error: incompatible types: String cannot be converted to int
int d = lns[3];
^
Main.java:17: error: incompatible types: String cannot be converted to int
int e = lns[4];
^
Main.java:18: error: incompatible types: String cannot be converted to int
int f = lns[5];
^
6 errors
|
s060607859
|
p00004
|
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));
String str = br.readLine();
while(str != null){
String lns[] = str.split(" ");
int a = (int) lns[0];
int b = lns[1];
int c = lns[2];
int d = lns[3];
int e = lns[4];
int f = lns[5];
System.out.println(a + " " + b + " " + c + " " + d + " " + e + " " + f );
}
// System.out.println(String.format("%d:%d:%d", hour, min, sec));
}
}
|
Main.java:13: error: incompatible types: String cannot be converted to int
int a = (int) lns[0];
^
Main.java:14: error: incompatible types: String cannot be converted to int
int b = lns[1];
^
Main.java:15: error: incompatible types: String cannot be converted to int
int c = lns[2];
^
Main.java:16: error: incompatible types: String cannot be converted to int
int d = lns[3];
^
Main.java:17: error: incompatible types: String cannot be converted to int
int e = lns[4];
^
Main.java:18: error: incompatible types: String cannot be converted to int
int f = lns[5];
^
6 errors
|
s646897999
|
p00004
|
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));
String line;
while ((line = br.readLine())!=null) {
String[] splited = line.split(" ", 6);
int a = Integer.parseInt(splited[0]);
int b = Integer.parseInt(splited[0]);
int c = Integer.parseInt(splited[0]);
int d = Integer.parseInt(splited[0]);
int e = Integer.parseInt(splited[0]);
int f = Integer.parseInt(splited[0]);
double y = (af / d -c ) / (ae -b);
double x = x = (c - by) / a;
String output = String.format("%.3f %.3f", x, y);
System.out.println(output);
}
}
}
/*
ax+by=c
dx+ey=f
ax = c - by
x = (c - by) / a
d((c - by) / a) + ey = f
(c -by) / a + ey = f /d
c - by + aey = af / d
- by + aey = af/d - c
(ae - b) y = af/d - c
y = (af /d -c )/(ae -b)
*/
|
Main.java:21: error: cannot find symbol
double y = (af / d -c ) / (ae -b);
^
symbol: variable af
location: class Main
Main.java:21: error: cannot find symbol
double y = (af / d -c ) / (ae -b);
^
symbol: variable ae
location: class Main
Main.java:22: error: cannot find symbol
double x = x = (c - by) / a;
^
symbol: variable by
location: class Main
3 errors
|
s153501119
|
p00004
|
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));
String str = br.readLine();
while(str != null){
String lns[] = str.split(" ");
double a = Double.parseDouble?\(lns[0]);
double b = Double.parseDouble?\(lns[1]);
double c = Double.parseDouble?\(lns[2]);
double d = Double.parseDouble?\(lns[3]);
double e = Double.parseDouble?\(lns[4]);
double f = Double.parseDouble?\(lns[5]);
for(int y = -1000 ; y < 1000; y++){
x = c + f / (b * y + e * y) / ( a + d);
if(x>-1000 && x<1000){
System.out.prdoubleln(x + "," + y);
break;
}
}
// System.out.prdoubleln(a + " " + b + " " + c + " " + d + " " + e + " " + f );
str = br.readLine();
}
// System.out.prdoubleln(String.format("%d:%d:%d", hour, min, sec));
}
}
|
Main.java:13: error: illegal character: '\'
double a = Double.parseDouble?\(lns[0]);
^
Main.java:13: error: not a statement
double a = Double.parseDouble?\(lns[0]);
^
Main.java:13: error: ';' expected
double a = Double.parseDouble?\(lns[0]);
^
Main.java:14: error: illegal character: '\'
double b = Double.parseDouble?\(lns[1]);
^
Main.java:14: error: not a statement
double b = Double.parseDouble?\(lns[1]);
^
Main.java:14: error: ';' expected
double b = Double.parseDouble?\(lns[1]);
^
Main.java:15: error: illegal character: '\'
double c = Double.parseDouble?\(lns[2]);
^
Main.java:15: error: not a statement
double c = Double.parseDouble?\(lns[2]);
^
Main.java:15: error: ';' expected
double c = Double.parseDouble?\(lns[2]);
^
Main.java:16: error: illegal character: '\'
double d = Double.parseDouble?\(lns[3]);
^
Main.java:16: error: not a statement
double d = Double.parseDouble?\(lns[3]);
^
Main.java:16: error: ';' expected
double d = Double.parseDouble?\(lns[3]);
^
Main.java:17: error: illegal character: '\'
double e = Double.parseDouble?\(lns[4]);
^
Main.java:17: error: not a statement
double e = Double.parseDouble?\(lns[4]);
^
Main.java:17: error: ';' expected
double e = Double.parseDouble?\(lns[4]);
^
Main.java:18: error: illegal character: '\'
double f = Double.parseDouble?\(lns[5]);
^
Main.java:18: error: not a statement
double f = Double.parseDouble?\(lns[5]);
^
Main.java:18: error: ';' expected
double f = Double.parseDouble?\(lns[5]);
^
18 errors
|
s384881266
|
p00004
|
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));
String str = br.readLine();
while(str != null){
String lns[] = str.split(" ");
double a = Double.parseDouble(lns[0]);
double b = Double.parseDouble(lns[1]);
double c = Double.parseDouble(lns[2]);
double d = Double.parseDouble(lns[3]);
double e = Double.parseDouble(lns[4]);
double f = Double.parseDouble(lns[5]);
for(int y = -1000 ; y < 1000; y++){
x = c + f / (b * y + e * y) / ( a + d);
if(x>-1000 && x<1000){
System.out.prdoubleln(x + "," + y);
break;
}
}
// System.out.prdoubleln(a + " " + b + " " + c + " " + d + " " + e + " " + f );
str = br.readLine();
}
// System.out.prdoubleln(String.format("%d:%d:%d", hour, min, sec));
}
}
|
Main.java:21: error: cannot find symbol
x = c + f / (b * y + e * y) / ( a + d);
^
symbol: variable x
location: class Main
Main.java:22: error: cannot find symbol
if(x>-1000 && x<1000){
^
symbol: variable x
location: class Main
Main.java:22: error: cannot find symbol
if(x>-1000 && x<1000){
^
symbol: variable x
location: class Main
Main.java:23: error: cannot find symbol
System.out.prdoubleln(x + "," + y);
^
symbol: variable x
location: class Main
4 errors
|
s517035662
|
p00004
|
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));
String str = br.readLine();
while(str != null){
String lns[] = str.split(" ");
double a = Double.parseDouble(lns[0]);
double b = Double.parseDouble(lns[1]);
double c = Double.parseDouble(lns[2]);
double d = Double.parseDouble(lns[3]);
double e = Double.parseDouble(lns[4]);
double f = Double.parseDouble(lns[5]);
for(int y = -1000 ; y < 1000; y++){
double x = c + f / (b * y + e * y) / ( a + d);
if(x>-1000 && x<1000){
System.out.prdoubleln(x + "," + y);
break;
}
}
// System.out.prdoubleln(a + " " + b + " " + c + " " + d + " " + e + " " + f );
str = br.readLine();
}
// System.out.prdoubleln(String.format("%d:%d:%d", hour, min, sec));
}
}
|
Main.java:23: error: cannot find symbol
System.out.prdoubleln(x + "," + y);
^
symbol: method prdoubleln(String)
location: variable out of type PrintStream
1 error
|
s333651321
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
String line;
List outputs = new ArrayList();
while ((line = br.readLine())!=null) {
String[] splited = line.split(" ", 6);
int a = Integer.parseInt(splited[0]);
int b = Integer.parseInt(splited[1]);
int c = Integer.parseInt(splited[2]);
int d = Integer.parseInt(splited[3]);
int e = Integer.parseInt(splited[4]);
int f = Integer.parseInt(splited[5]);
double y = (a * f / d - c ) / (a * e / d - b);
double x = x = (c - b * y) / a;
outputs.add(String.format("%.3f %.3f", x, y));
}
for (String output : outputs) {
System.out.println(output);
}
}
}
/*
ax+by=c
dx+ey=f
ax = c - by
x = (c - by) / a
d((c - by) / a) + ey = f
(c -by) / a + ey = f /d
c - by + aey = af / d
- by + aey = af/d - c
(ae - b) y = af/d - c
y = (af /d -c )/(ae -b)
*/
|
Main.java:28: error: incompatible types: Object cannot be converted to String
for (String output : outputs) {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s423023157
|
p00004
|
Java
|
import java.io.*;
public class Main{
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str[] = new String[200];
str[0] = br.readLine();
int i = 0;
while(str[i] != null){
i++;
str[i] = br.readLine();
}
double a[] = new double[6];
for(int j=0;j<i+1;j++){
String str2[] = str[j].split(" ",0);
for(int k=0;k<6;k++){
a[k] = Double.parseDouble(str2[k]);
}
double x,y;
if(a[0]==0 && a[4]==0){
y=a[2]/a[1];
x=a[5]/a[3];
}else if(a[1]==0 && a[3]==0){
x=a[2]/a[0];
y=a[5]/a[4];
}else if(a[4]==0){
x=a[5]/a[3];
y=(a[2]-a[0]*x)/a[1];
}else if(a[3]==0){
y=a[5]/a[4];
x=(a[2]-a[1]*y)/a[0];
}else{
x = (a[2]-a[1]*a[5]/a[4])/(a[0]-a[1]*a[3]/a[4]);
y = (a[2]-a[0]*a[5]/a[3])/(a[1]-a[0]*a[4]/a[3]);
}
System.out.println(String.format("%.3f",x)+" "+String.format("%.3f",y));
}
}
}
|
Main.java:7: error: unreported exception IOException; must be caught or declared to be thrown
str[0] = br.readLine();
^
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown
str[i] = br.readLine();
^
2 errors
|
s578881715
|
p00004
|
Java
|
import java.util.*;
import java.util.stream.Collectors;
import static java.lang.System.*;
public class Main extends CodingSupport {
protected void solve() {
while(sc.hasNext()) {
Double[] inputs = scanDoubles();
Double[] equation1 = {inputs[0], inputs[1], inputs[2]};// ax + by = cのa,b,c
Double[] equation2 = {inputs[3], inputs[4], inputs[5]};// ax + by = cのa,b,c
Double[] equation2_1 = new Double[4];
Double resultX = null;
Double resultY = null;
if( equation2[0] != 0 && equation2[1] != 0) {
Double coeeficient1 = equation2[0] / equation1[0];
for( int i = 0; i < equation1.length; i++ ) {
equation2_1[i] = equation2[i] - equation1[i] * coeeficient1;
}
resultY = equation2_1[2] / equation2_1[1];
resultX = (equation1[2] - equation1[1] * resultY) / equation1[0];
} else if (equation2[0] == 0 && equation2[1] == 0) {
resultY = 0;
resultX = 0;
} else if (equation2[0] == 0 ) {
resultY = equation2[2] / equation2[1];
resultX = (equation1[2] - equation1[1] * resultY) / equation1[0];
} else if ( equation2[1] == 0 ) {
resultX = equation2[2] / equation2[0];
resultY = (equation1[2] - equation1[0] * resultX) / equation1[0];
}
if(-0.0005 < resultX && resultX <0.0+0.0001) resultX = 0.0;
if(-0.0005 < resultY && resultY < 0.0+0.0001) resultY = 0.0;
out.println(String.format("%.3f %.3f", resultX,resultY));
}
}
}
abstract class CodingSupport {
protected Scanner sc;
protected CodingSupport() {
sc = new Scanner(in);
}
public static void main(String[] args) throws Exception {
new Main().solve();
}
protected abstract void solve();
protected void print(Object o) {
out.println(o);
}
protected Double[] scanDoubles() {
return
Arrays
.stream(scanInts())
.map(Integer::doubleValue)
.toArray(Double[]::new);
}
protected Integer[] scanInts() {
return strArrayToIntArray(sc.nextLine().split(" "));
}
protected String[] scanLineToTokens(String delimiter) {
return sc.nextLine().split(delimiter);
}
protected int scanInt() {
return sc.nextInt();
}
protected List<Integer> strArrayToIntList(String[] strArray) {
List<Integer> intList =
Arrays
.stream(strArray)
.map(Integer::valueOf)
.collect(Collectors.toList());
return intList;
}
protected Integer[] strArrayToIntArray(String[] strArray) {
Integer[] intArray =
Arrays
.stream(strArray)
.map(Integer::valueOf)
.toArray(Integer[]::new);
return intArray;
}
}
|
Main.java:23: error: incompatible types: int cannot be converted to Double
resultY = 0;
^
Main.java:24: error: incompatible types: int cannot be converted to Double
resultX = 0;
^
2 errors
|
s170100445
|
p00004
|
Java
|
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int i;
double x, y, tmp0,tmp3;
List<Double> list = new ArrayList<Double>();
Scanner scanner = new Scanner(System.in);
//list.add(Integer.parseInt(scanner.next()));
for(i=0; i<6; i++) {
list.add(scanner.nextDouble());
}
tmp0 = list.get(0);
tmp3 = list.get(3);
for(i=0; i<3; i++) {
list.set(i, list.get(i)*tmp3);
list.set(i+3, list.get(i+3)*tmp0);
}
list.add(list.get(1)-list.get(4));
list.add(list.get(2)-list.get(5));
if(list.get(6) == 0){
x=0;
y=list.get(2)/list.get(1);
}else {
y = list.get(7)/list.get(6);
x = (list.get(2)-list.get(1)*y)/list.get(0);
}
//System.out.println(list);
//System.out.println(x + " " + y);
System.out.println(String.format("%.3f", x) + " " + String.format("%.3f", y) );
scanner.close();
}
}
|
Main.java:6: error: '{' expected
public class Main public static void main(String[] args) {
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
public class Main public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:37: error: class, interface, enum, or record expected
}
^
3 errors
|
s094246281
|
p00004
|
Java
|
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
int i;
double x, y, tmp0,tmp3;
List<Double> list = new ArrayList<Double>();
Scanner scanner = new Scanner(System.in);
//list.add(Integer.parseInt(scanner.next()));
for(i=0; i<6; i++) {
list.add(scanner.nextDouble());
}
tmp0 = list.get(0);
tmp3 = list.get(3);
for(i=0; i<3; i++) {
list.set(i, list.get(i)*tmp3);
list.set(i+3, list.get(i+3)*tmp0);
}
list.add(list.get(1)-list.get(4));
list.add(list.get(2)-list.get(5));
if(list.get(6) == 0){
x=0;
y=list.get(2)/list.get(1);
}else {
y = list.get(7)/list.get(6);
x = (list.get(2)-list.get(1)*y)/list.get(0);
}
//System.out.println(list);
//System.out.println(x + " " + y);
System.out.println(String.format("%.3f", x) + " " + String.format("%.3f", y) );
scanner.close();
}
}
|
Main.java:6: error: '{' expected
public class Main public static void main(String[] args) {
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
public class Main public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
Main.java:37: error: class, interface, enum, or record expected
}
^
3 errors
|
s341329277
|
p00004
|
Java
|
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
public class Main {
private static FastScanner sc = new FastScanner();
public static void main(String[] args) {
double a = sc.nextDouble();
double b = sc.nextDouble();
double c = sc.nextDouble();
double d = sc.nextDouble();
double e = sc.nextDouble();
double f = sc.nextDouble();
if(d != 0) {
d = d * (a/d);
e = e * (a/d);
f = f * (a/d);
double y = (c-f) / (b-e);
double x = (e/d) * y - (f/d);
} else {
a = a * (d/a);
b = b * (d/a);
c = c * (d/a);
double y = (c-f) / (b-e);
double x = (b/a) * y - (c/a);
}
System.out.println(x + " " + y);
}
static class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if(ptr < buflen) {
return true;
} else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch(IOException e) {
e.printStackTrace();
}
if(buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
public boolean hasNext() { skipUnprintable(); return hasNextByte();}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while(isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
return Long.parseLong(next());
}
public int nextInt(){
return Integer.parseInt(next());
}
public double nextDouble(){
return Double.parseDouble(next());
}
}
}
|
Main.java:30: error: cannot find symbol
System.out.println(x + " " + y);
^
symbol: variable x
location: class Main
Main.java:30: error: cannot find symbol
System.out.println(x + " " + y);
^
symbol: variable y
location: class Main
2 errors
|
s468678164
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String args[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputString;
while((inputString = br.readLine()) != null) {
// inputs.length = 6ツづ債陛崢湘伉つウツづェツづつ「ツづゥ
double[] inputs = stringsToDoubles(inputString.split(" "));
// ツ係ツ青板行ツ療ア
double[][] matrix = { {inputs[0], inputs[1]},
{inputs[3], inputs[4]} };
// ツ陛サツ津カツ篠ョツ右ツ陛督づ個ベツクツトツδ仰表ツ記
double[] vector = {inputs[2], inputs[5]};
// ツ係ツ青板行ツ療アツづ個行ツ療アツ篠ョ
double det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
// ツ係ツ青板行ツ療アツづ個逆ツ行ツ療ア
double[][] inverse = { {matrix[1][1] / det, -1 * matrix[0][1] / det},
{-1 * matrix[1][0] / det, matrix[0][0] / det} };
// ツ嘉ー
double[] solution = {inverse[0][0] * vector[0] + inverse[0][1] * vector[1],
inverse[1][0] * vector[0] + inverse[1][1] * vector[1]};
System.out.printf("%.4g %.4g\n", solution[0], solution[1]);
}
}
private static double[] stringsToDoubles(String[] s) {
double[] results = new double[s.length];
for(int i = 0; i < s.length; i++)
results[i] = Double.parseDouble(s[i]);
return results;
}
}
|
Main.java:9: error: unreported exception IOException; must be caught or declared to be thrown
while((inputString = br.readLine()) != null) {
^
1 error
|
s115170300
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
void run(){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputString;
while((inputString = br.readLine()) != null) {
// inputs.length = 6ツづ債陛崢湘伉つウツづェツづつ「ツづゥ
double[] inputs = stringsToDoubles(inputString.split(" "));
// ツ係ツ青板行ツ療ア
double[][] matrix = { {inputs[0], inputs[1]},
{inputs[3], inputs[4]} };
// ツ陛サツ津カツ篠ョツ右ツ陛督づ個ベツクツトツδ仰表ツ記
double[] vector = {inputs[2], inputs[5]};
// ツ係ツ青板行ツ療アツづ個行ツ療アツ篠ョ
double det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
// ツ係ツ青板行ツ療アツづ個逆ツ行ツ療ア
double[][] inverse = { {matrix[1][1] / det, -1 * matrix[0][1] / det},
{-1 * matrix[1][0] / det, matrix[0][0] / det} };
// ツ嘉ー
double[] solution = {inverse[0][0] * vector[0] + inverse[0][1] * vector[1],
inverse[1][0] * vector[0] + inverse[1][1] * vector[1]};
// System.out.printf("%.4g %.4g\n", solution[0], solution[1]);
}
public static void main(String args[]) throws Exception {
new Main().run();
}
}
private double[] stringsToDoubles(String[] s) {
double[] results = new double[6];
// double[] results = new double[s.length];
for(int i = 0; i < s.length; i++)
results[i] = Double.parseDouble(s[i]);
return results;
}
}
|
Main.java:29: error: illegal start of expression
public static void main(String args[]) throws Exception {
^
Main.java:34: error: unnamed classes are a preview feature and are disabled by default.
private double[] stringsToDoubles(String[] s) {
^
(use --enable-preview to enable unnamed classes)
Main.java:44: error: class, interface, enum, or record expected
}
^
3 errors
|
s866469888
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
void run(){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputString;
while((inputString = br.readLine()) != null) {
// inputs.length = 6ツづ債陛崢湘伉つウツづェツづつ「ツづゥ
double[] inputs = stringsToDoubles(inputString.split(" "));
// ツ係ツ青板行ツ療ア
double[][] matrix = { {inputs[0], inputs[1]},
{inputs[3], inputs[4]} };
// ツ陛サツ津カツ篠ョツ右ツ陛督づ個ベツクツトツδ仰表ツ記
double[] vector = {inputs[2], inputs[5]};
// ツ係ツ青板行ツ療アツづ個行ツ療アツ篠ョ
double det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
// ツ係ツ青板行ツ療アツづ個逆ツ行ツ療ア
double[][] inverse = { {matrix[1][1] / det, -1 * matrix[0][1] / det},
{-1 * matrix[1][0] / det, matrix[0][0] / det} };
// ツ嘉ー
double[] solution = {inverse[0][0] * vector[0] + inverse[0][1] * vector[1],
inverse[1][0] * vector[0] + inverse[1][1] * vector[1]};
// System.out.printf("%.4g %.4g\n", solution[0], solution[1]);
}
public static void main(String args[]){
new Main().run();
}
private double[] stringsToDoubles(String[] s) {
double[] results = new double[6];
// double[] results = new double[s.length];
for(int i = 0; i < s.length; i++)
results[i] = Double.parseDouble(s[i]);
return results;
}
}
|
Main.java:29: error: illegal start of expression
public static void main(String args[]){
^
1 error
|
s376415746
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
void run() throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String inputString;
while((inputString = br.readLine()) != null) {
// inputs.length = 6ツづ債陛崢湘伉つウツづェツづつ「ツづゥ
double[] inputs = stringsToDoubles(inputString.split(" "));
// ツ係ツ青板行ツ療ア
double[][] matrix = { {inputs[0], inputs[1]},
{inputs[3], inputs[4]} };
// ツ陛サツ津カツ篠ョツ右ツ陛督づ個ベツクツトツδ仰表ツ記
double[] vector = {inputs[2], inputs[5]};
// ツ係ツ青板行ツ療アツづ個行ツ療アツ篠ョ
double det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
// ツ係ツ青板行ツ療アツづ個逆ツ行ツ療ア
double[][] inverse = { {matrix[1][1] / det, -1 * matrix[0][1] / det},
{-1 * matrix[1][0] / det, matrix[0][0] / det} };
// ツ嘉ー
double[] solution = {inverse[0][0] * vector[0] + inverse[0][1] * vector[1],
inverse[1][0] * vector[0] + inverse[1][1] * vector[1]};
// System.out.printf("%.4g %.4g\n", solution[0], solution[1]);
}
public static void main(String args[]) throws Exception{
new Main().run();
}
private double[] stringsToDoubles(String[] s) {
double[] results = new double[6];
// double[] results = new double[s.length];
for(int i = 0; i < s.length; i++)
results[i] = Double.parseDouble(s[i]);
return results;
}
}
|
Main.java:29: error: illegal start of expression
public static void main(String args[]) throws Exception{
^
1 error
|
s820618905
|
p00004
|
Java
|
import java.io.*;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) throws IOException {
// System.out.println("Hello world");
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
while(true){
double x, y;
int n = 6;
String c = br.readLine();
if(c == 0)
break;
int[] arr = new int[n];
for(int i = 0; i < n; i++){
if(c.indexOf(" ") != -1){
String str = c.substring(0, c.indexOf(" "));
arr[i] = Integer.parseInt(str);
c = c.substring(c.indexOf(" ") + 1);
}
else{
arr[i] = Integer.parseInt(c);
}
}
int[] arr2 = arr.clone();
int k1=1, k2=1;
if(!(arr2[0] == 0 || arr2[3] == 0)){
while(arr2[0]%arr2[3] != 0){
arr2[0] += arr[0];
k1++;
}
k2 = arr2[0]/arr2[3];
for(int i = 1; i < n; i++){
if(i < 3)
arr2[i] = arr2[i] * k1;
else
arr2[i] = arr2[i] * k2;
}
}
else if(!(arr2[1] == 0 || arr2[4] == 0)){
while(arr2[1]%arr2[4] != 0){
arr2[1] += arr[1];
k1++;
}
k2 = arr2[1]/arr2[4];
for(int i = 1; i < n; i++){
if(i < 3)
arr2[i] = arr2[i] * k1;
else
arr2[i] = arr2[i] * k2;
}
}
else{
if(arr[0] == 0){
y = (double)arr[2] / (double)arr[1];
x = (double)arr[5] / (double)arr[3];
}
else{
x = (double)arr[2] / (double)arr[0];
y = (double)arr[5] / (double)arr[4];
}
}
arr2[1] = arr2[1] - arr2[4];
arr2[2] = arr2[2] - arr2[5];
y = (double)arr2[2] / (double)arr2[1];
x = (double)arr[2]-(double)arr[1]*y;
//System.out.println(round(x) +" "+ round(y));
//System.out.println(String.format("%1$.4g", x) + " " + String.format("%1$.4g", y));
keta(x);
System.out.print(" ");
keta(y);
System.out.println();
}}
private static double round(double d){
int newScale = 3; // ツ渉ャツ青板点ツ暗按可コ6ツ個づ慊づ仰づ淞づゥ
BigDecimal bd = new BigDecimal(d);
BigDecimal bd2 = bd.setScale(newScale, BigDecimal.ROUND_HALF_UP);
double d2 = bd2.doubleValue();
return d2;
}
private static void keta(double d){
int k = (int)d;
System.out.print(k + ".");
d = d-k;
if(d < 0)
d *= -1;
d = round(d);
d *= 1000;
k = (int)d;
if(k == 0)
System.out.print("000");
else
System.out.print(String.format("%03", k));
}
}
|
Main.java:15: error: bad operand types for binary operator '=='
if(c == 0)
^
first type: String
second type: int
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s044651563
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
//public class Problem0004_SimultaneousEquation {
public class Main {
public static void main(String[] args) {
try {
Problem0004_SimultaneousEquation test = new Problem0004_SimultaneousEquation();
// Main test = new Main();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line;
while((line = reader.readLine()) != null) {
try {
String[] textArray = line.split(" ");
double[] numbers = new double[6];
for(int i = 0; i < textArray.length; i++) {
numbers[i] = Double.parseDouble(textArray[i]);
}
test.showAnswer(numbers);
} catch(NumberFormatException e) {
break;
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
void showAnswer(double[] array) {
checkLength(array);
double x = getX(array);
double y = getY(array);
System.out.printf("%.3f %.3f%n", x, y);
}
double getX(double[] array) {
checkLength(array);
double x = (array[2]*array[4] - array[1]*array[5]) / (array[0]*array[4] - array[3]*array[1]);
x = round(x);
return x;
}
double getY(double[] array) {
checkLength(array);
double y = (array[2]*array[3] - array[0]*array[5]) / (array[1]*array[3] - array[0]*array[4]);
y = round(y);
return y;
}
private double round(double number) {
int large = (int)(number * 10000);
int small = (int)(number * 1000) * 10;
double result;
if(large - small < 5) { //ツ静伉づィツ可コツつー
result = small;
} else { //ツ静伉づィツ湘」ツつー
result = small + 10;
}
result = result/10000;
return result;
}
private void checkLength(double[] array) {
if(array.length != 6) {
throw new IllegalArgumentException();
}
}
}
|
Main.java:8: error: cannot find symbol
Problem0004_SimultaneousEquation test = new Problem0004_SimultaneousEquation();
^
symbol: class Problem0004_SimultaneousEquation
location: class Main
Main.java:8: error: cannot find symbol
Problem0004_SimultaneousEquation test = new Problem0004_SimultaneousEquation();
^
symbol: class Problem0004_SimultaneousEquation
location: class Main
2 errors
|
s951982347
|
p00004
|
Java
|
import java.util.Scanner;
public class M0004 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true) {
if(!sc.hasNextInt()) break;
double a = sc.nextInt();
double b = sc.nextInt();
double c = sc.nextInt();
double d = sc.nextInt();
double e = sc.nextInt();
double f = sc.nextInt();
double x = (c*e - b*f) / (a*e - b*d);
double y = (a*f - c*d) / (a*e - b*d);
if(Math.abs(x)<0.001) x = 0;
if(Math.abs(y)<0.001) y = 0;
System.out.printf("%.3f %.3f\n",x,y);
}
}
}
|
Main.java:3: error: class M0004 is public, should be declared in a file named M0004.java
public class M0004 {
^
1 error
|
s266793869
|
p00004
|
Java
|
import java.math.BigDecimal;
import java.util.Scanner;
public static void main(String[] args) {
double a, b, c, d, e, f;
double x, y;
Scanner scan = new Scanner(System.in);
while ((scan.hasNext())) {
a = Double.parseDouble(scan.next());
b = Double.parseDouble(scan.next());
c = Double.parseDouble(scan.next());
d = Double.parseDouble(scan.next());
e = Double.parseDouble(scan.next());
f = Double.parseDouble(scan.next());
y = (a * f - c * d) / (a * e - b * d);
x = (c - b * y) / a;
BigDecimal xb = new BigDecimal(String.valueOf(x));
BigDecimal yb = new BigDecimal(String.valueOf(y));
System.out.println(xb.setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue()
+ " " + yb.setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue());
}
}
}
|
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:32: error: class, interface, enum, or record expected
}
^
2 errors
|
s816431910
|
p00004
|
Java
|
public class Main {
public static void main(String[] args) throws IOException {
// Formatter fm = new Formatter(System.out);
List<String> ans = new ArrayList<String>();
for (int[] in = readInts(); in != null; in = readInts()) {
int a11 = in[0], a12 = in[1], b1 = in[2];
int a21 = in[3], a22 = in[4], b2 = in[5];
double D = a11 * a22 - a12 * a21;
int xx = +a22 * b1 - a12 * b2;
int yy = +a11 * b2 - a21 * b1;
double ansX = (xx / D);
double ansY = (yy / D);
// fm.format("%1$.3f", ansX);
// fm.format(" %1$.3f\n", ansY);
// fm.flush();
String s = String.format("%.3f", ansX) + " "
+ String.format("%.3f", ansY);
ans.add(s);
}
for (Iterator<String> iterator = ans.iterator(); iterator.hasNext();) {
String string = (String) iterator.next();
System.out.println(string);
}
// fm.close();
}
static BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
private static int[] readInts() throws IOException {
String readLine = br.readLine();
if (readLine == null || readLine.equals("")) {
return null;
}
String[] s = readLine.split(" ");
int[] result = new int[s.length];
for (int i = 0; i < result.length; i++)
result[i] = Integer.parseInt(s[i], 10);
return result;
}
}
|
Main.java:3: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:29: error: cannot find symbol
static BufferedReader br = new BufferedReader(new InputStreamReader(
^
symbol: class BufferedReader
location: class Main
Main.java:32: error: cannot find symbol
private static int[] readInts() throws IOException {
^
symbol: class IOException
location: class Main
Main.java:5: error: cannot find symbol
List<String> ans = new ArrayList<String>();
^
symbol: class List
location: class Main
Main.java:5: error: cannot find symbol
List<String> ans = new ArrayList<String>();
^
symbol: class ArrayList
location: class Main
Main.java:21: error: cannot find symbol
for (Iterator<String> iterator = ans.iterator(); iterator.hasNext();) {
^
symbol: class Iterator
location: class Main
Main.java:29: error: cannot find symbol
static BufferedReader br = new BufferedReader(new InputStreamReader(
^
symbol: class BufferedReader
location: class Main
Main.java:29: error: cannot find symbol
static BufferedReader br = new BufferedReader(new InputStreamReader(
^
symbol: class InputStreamReader
location: class Main
8 errors
|
s995523470
|
p00004
|
Java
|
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
double[] d = new double[6];
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
for(int i=0; i<d.length; i++) {<br /> d[i] = sc.nextDouble();
}
double adbc = d[0]*d[4] - d[1]*d[3];
if(Double.compare(adbc, 0.0f) == 0) {
continue;
}
double[][] m1 = {{ d[4]/adbc, -d[1]/adbc},
{-d[3]/adbc, d[0]/adbc}};
double[][] m2 = {{d[2]}, {d[5]}};
double x = m1[0][0] * m2[0][0] + m1[0][1] * m2[1][0];
double y = m1[1][0] * m2[0][0] + m1[1][1] * m2[1][0];
System.out.println(String.format("%.3f %.3f", x, y));
}
}
}
|
Main.java:9: error: > or ',' expected
for(int i=0; i<d.length; i++) {<br /> d[i] = sc.nextDouble();
^
Main.java:9: error: illegal start of expression
for(int i=0; i<d.length; i++) {<br /> d[i] = sc.nextDouble();
^
2 errors
|
s880455271
|
p00004
|
Java
|
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
NumberFormat format = NumberFormat.getInstance();
format.setMaximumFractionDigits(3);
format.setMinimumFractionDigits(3);
while (s.hasNextInt()) {
int a = s.nextInt();
int b = s.nextInt();
int c = s.nextInt();
int d = s.nextInt();
int e = s.nextInt();
int f = s.nextInt();
int nx = b * f - e * c;
int dx = b * d - e * a;
int ny = a * f - d * c;
int dy = a * e - d * b;
double x = nx == 0 ? nx : (double) nx / dx;
double y = ny == 0 ? ny : (double) ny / dy;
System.out.println(format.format(x) + " " + format.format(y));
}
}
}
|
Main.java:3: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
NumberFormat format = NumberFormat.getInstance();
^
symbol: class NumberFormat
location: class Main
Main.java:4: error: cannot find symbol
NumberFormat format = NumberFormat.getInstance();
^
symbol: variable NumberFormat
location: class Main
4 errors
|
s083850860
|
p00004
|
Java
|
import java.util.Scanner;
import java.Math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv] > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:18: error: ')' expected
if(Math.abs(a[i][ipv] > max) {
^
1 error
|
s965819639
|
p00004
|
Java
|
import java.util.Scanner;
import java.Math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv] > max)) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:2: error: package java.Math does not exist
import java.Math.BigDecimal;
^
Main.java:17: error: cannot find symbol
for(i = ipv; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:17: error: cannot find symbol
for(i = ipv; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:17: error: cannot find symbol
for(i = ipv; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:18: error: cannot find symbol
if(Math.abs(a[i][ipv] > max)) {
^
symbol: variable i
location: class Main
Main.java:18: error: no suitable method found for abs(boolean)
if(Math.abs(a[i][ipv] > max)) {
^
method Math.abs(int) is not applicable
(argument mismatch; boolean cannot be converted to int)
method Math.abs(long) is not applicable
(argument mismatch; boolean cannot be converted to long)
method Math.abs(float) is not applicable
(argument mismatch; boolean cannot be converted to float)
method Math.abs(double) is not applicable
(argument mismatch; boolean cannot be converted to double)
Main.java:19: error: cannot find symbol
max = a[i][ipv];
^
symbol: variable i
location: class Main
Main.java:20: error: cannot find symbol
row = i;
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:25: error: cannot find symbol
double temp = a[ipv][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:27: error: cannot find symbol
a[row][i] = temp;
^
symbol: variable i
location: class Main
Main.java:38: error: cannot find symbol
temp = a[i][ipv];
^
symbol: variable temp
location: class Main
Main.java:40: error: cannot find symbol
a[i][j] -= temp*a[ipv][j];
^
symbol: variable temp
location: class Main
Main.java:45: error: cannot find symbol
BigDecimal x[] = new BigDecimal[n];
^
symbol: class BigDecimal
location: class Main
Main.java:45: error: cannot find symbol
BigDecimal x[] = new BigDecimal[n];
^
symbol: class BigDecimal
location: class Main
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: variable BigDecimal
location: class Main
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(double)
location: class Main
21 errors
|
s336419256
|
p00004
|
Java
|
import java.util.Scanner;
import java.util.Math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:2: error: package java.util.Math does not exist
import java.util.Math.BigDecimal;
^
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:25: error: cannot find symbol
double temp = a[ipv][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:27: error: cannot find symbol
a[row][i] = temp;
^
symbol: variable i
location: class Main
Main.java:45: error: cannot find symbol
BigDecimal x[] = new BigDecimal[n];
^
symbol: class BigDecimal
location: class Main
Main.java:45: error: cannot find symbol
BigDecimal x[] = new BigDecimal[n];
^
symbol: class BigDecimal
location: class Main
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: variable BigDecimal
location: class Main
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(double)
location: class Main
12 errors
|
s183594473
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:24: error: cannot find symbol
for(i = 0; i < n; i++) {
^
symbol: variable i
location: class Main
Main.java:25: error: cannot find symbol
double temp = a[ipv][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:26: error: cannot find symbol
a[ipv][i] = a[row][i];
^
symbol: variable i
location: class Main
Main.java:27: error: cannot find symbol
a[row][i] = temp;
^
symbol: variable i
location: class Main
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(double)
location: class Main
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
8 errors
|
s081195801
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(int i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:47: error: cannot find symbol
x[i] = BigDecimal(a[i][m]).setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(double)
location: class Main
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s039376145
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(int i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
BigDecimal bda = new BigDecimal(a[i][m]);
x[i] = bda.setscale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:48: error: cannot find symbol
x[i] = bda.setscale(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method setscale(int,int)
location: variable bda of type BigDecimal
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s498730857
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(ipv != row) {
for(int i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
BigDecimal bda = new BigDecimal(a[i][m]);
x[i] = bda.setScale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:23: error: variable row might not have been initialized
if(ipv != row) {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s686304575
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = 2, m = 3;
double a[][] = new double[n][m];
while(sc.hasNext()) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = sc.nextDouble();
}
}
for (int ipv = 0; ipv < n; ipv++) {
double max = 0.0;
int row;
for(int i = ipv; i < n; i++) {
if(Math.abs(a[i][ipv]) > max) {
max = a[i][ipv];
row = i;
}
}
if(max == 0.0) {
break;
}
if(ipv != row) {
for(int i = 0; i < n; i++) {
double temp = a[ipv][i];
a[ipv][i] = a[row][i];
a[row][i] = temp;
}
}
double inv_pv = 1.0/a[ipv][ipv];
for (int i = 0; i < n; i++) {
a[ipv][i] *= inv_pv;
}
for (int i = 0; i < n; i++) {
if (i != ipv) {
double temp = a[i][ipv];
for (int j = 0; j < m; j++) {
a[i][j] -= temp*a[ipv][j];
}
}
}
}
BigDecimal x[] = new BigDecimal[n];
for (int i = 0; i < n; i++) {
BigDecimal bda = new BigDecimal(a[i][m]);
x[i] = bda.setScale(3, BigDecimal.ROUND_HALF_UP);
}
System.out.println(x[0]+" "+x[1]);
}
}
}
|
Main.java:26: error: variable row might not have been initialized
if(ipv != row) {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s374240293
|
p00004
|
Java
|
import java.util.Scanner;
public class main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
doIt();
}
public static void doIt(){
Scanner sc = new Scanner(System.in);
//a0 1b 2c 3d 4e 5f
double[] v = new double[6];
double x = 0;
double y = 0;
while(sc.hasNext()){
//System.out.println("ts");
//Math.round
for(int i = 0; i < 6; i++){
v[i] = sc.nextDouble();
//System.out.println(i + " " + v[i]);
}
//sc.nextInt();
// if(v[0] == 0){
// y = v[2] / v[1];
// x =
// }
double tmp1 = v[1] * v[3] - v[0] * v[4];
double tmp2 = v[3] * v[2] - v[0] * v[5];
y = tmp2 / tmp1;
//小数点代4位を四捨五入
y *= 1000;
y = Math.round(y) / 1000;
x = v[2] - v[1]*y;
x /= v[0];
x *= 1000;
x = Math.round(x) / 1000;
x += 0.000;
//System.out.println(x + " " + y);
System.out.printf("%.3f %.3f\n", x,y);
}
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s635423922
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
while(cin.hasNext())
{
double a = cin.nextInt();
double b = cin.nextInt();
double c = cin.nextInt();
double d = cin.nextInt();
double e = cin.nextInt();
double f = cin.nextInt();
BigDecimal x = ((double)(c*e-b*f)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
BigDecimal y = ((double)(a*f-c*d)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
System.out.println(x.doublevalue()+" "+y.doublevalue());
}
}
}
|
Main.java:17: error: double cannot be dereferenced
BigDecimal x = ((double)(c*e-b*f)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
Main.java:18: error: double cannot be dereferenced
BigDecimal y = ((double)(a*f-c*d)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
Main.java:19: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable x of type BigDecimal
Main.java:19: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable y of type BigDecimal
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s627062949
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
while(cin.hasNext())
{
double a = cin.nextInt();
double b = cin.nextInt();
double c = cin.nextInt();
double d = cin.nextInt();
double e = cin.nextInt();
double f = cin.nextInt();
BigDecimal x = ((c*e-b*f)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
BigDecimal y = ((a*f-c*d)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
System.out.println(x.doublevalue()+" "+y.doublevalue());
}
}
}
|
Main.java:17: error: double cannot be dereferenced
BigDecimal x = ((c*e-b*f)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
Main.java:18: error: double cannot be dereferenced
BigDecimal y = ((a*f-c*d)/(a*e-b*d)).BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
Main.java:19: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable x of type BigDecimal
Main.java:19: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable y of type BigDecimal
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s235950267
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
while(cin.hasNext())
{
double a = cin.nextInt();
double b = cin.nextInt();
double c = cin.nextInt();
double d = cin.nextInt();
double e = cin.nextInt();
double f = cin.nextInt();
BigDecimal xbd = new BigDecimal((c*e-b*f)/(a*e-b*d));
BigDecimal ybd = new BigDecimal((a*f-c*d)/(a*e-b*d));
BigDecimal x = xbd.BigDecimal(3, BigDecimal.ROUND_HALF_UP);
BigDecimal y = ybd.BigDecimal(3, BigDecimal.ROUND_HALF_UP);
System.out.println(x.doublevalue()+" "+y.doublevalue());
}
}
}
|
Main.java:19: error: cannot find symbol
BigDecimal x = xbd.BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(int,int)
location: variable xbd of type BigDecimal
Main.java:20: error: cannot find symbol
BigDecimal y = ybd.BigDecimal(3, BigDecimal.ROUND_HALF_UP);
^
symbol: method BigDecimal(int,int)
location: variable ybd of type BigDecimal
Main.java:21: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable x of type BigDecimal
Main.java:21: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable y of type BigDecimal
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
|
s668856187
|
p00004
|
Java
|
import java.util.Scanner;
import java.math.BigDecimal;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
while(cin.hasNext())
{
double a = cin.nextInt();
double b = cin.nextInt();
double c = cin.nextInt();
double d = cin.nextInt();
double e = cin.nextInt();
double f = cin.nextInt();
BigDecimal xbd = new BigDecimal((c*e-b*f)/(a*e-b*d));
BigDecimal ybd = new BigDecimal((a*f-c*d)/(a*e-b*d));
BigDecimal x = xbd.setScale(3, BigDecimal.ROUND_HALF_UP);
BigDecimal y = ybd.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.println(x.doublevalue()+" "+y.doublevalue());
}
}
}
|
Main.java:21: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable x of type BigDecimal
Main.java:21: error: cannot find symbol
System.out.println(x.doublevalue()+" "+y.doublevalue());
^
symbol: method doublevalue()
location: variable y of type BigDecimal
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
|
s183272402
|
p00004
|
Java
|
import java.util.*;
import java.math.*;
public class Math {
/**
* @param args
*/
static void solve(int[] a){
double d = a[0]*a[4]-a[1]*a[3];
BigDecimal x = new BigDecimal(String.valueOf(((double)a[4]*a[2]-a[1]*a[5])/d));
BigDecimal y = new BigDecimal(String.valueOf(((double)-a[2]*a[3]+a[0]*a[5])/d));
System.out.printf(
"%.3f %.3f",
x.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue(),
y.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue()
);
}
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int[] a= new int[6];
for(int i=0;i<6;i++){
a[i]=scan.nextInt();
}
solve(a);
}
}
}
|
Main.java:4: error: class Math is public, should be declared in a file named Math.java
public class Math {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s604516670
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
String inputStr;
BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
while ((inputStr = bReader.readLine()) != null) {
String[] editedStr = inputStr.split(" ");
int a = Integer.parseInt(editedStr[0]);
int b = Integer.parseInt(editedStr[1]);
int c = Integer.parseInt(editedStr[2]);
int d = Integer.parseInt(editedStr[3]);
int e = Integer.parseInt(editedStr[4]);
int f = Integer.parseInt(editedStr[5]);
double x = (c*e-b*f)/(a*e-b*d);
y = (c-a*x)/b;
System.out.println(String.format("%1.3g %1.3g",x , y));
}
}
}
|
Main.java:19: error: cannot find symbol
y = (c-a*x)/b;
^
symbol: variable y
location: class Main
Main.java:20: error: cannot find symbol
System.out.println(String.format("%1.3g %1.3g",x , y));
^
symbol: variable y
location: class Main
2 errors
|
s791925461
|
p00004
|
Java
|
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
static double a, b, c, d, e, f;
public static void main(String[] args) {
while(read()){
solve();
}
}
static boolean read(){
if(!sc.hasNext())return false;
a = sc.nextDouble();
b = sc.nextDouble();
c = sc.nextDouble();
d = sc.nextDouble();
e = sc.nextDouble();
f = sc.nextDouble();
return true;
}
static void solve(){
double det = a*e - b*d;
double x = (c*e - b*f)/det, y = (-c*d + a*f)/det;
if(x==0)x=0;
if(y==0)y=0;
System.out.printf("%.3f %.3f\n", x, y);
}
|
Main.java:26: error: reached end of file while parsing
}
^
1 error
|
s672154333
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class CopyOfMain {
public static void main(String[] a){
String str;
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
try {
while(null != ( str = bf.readLine() )){
String[] arr = str.split(" ");
BigDecimal ansX = new BigDecimal(
(Integer.parseInt(arr[2]) * Integer.parseInt(arr[4]) - Integer.parseInt(arr[5]) * Integer.parseInt(arr[1])) /
(Integer.parseInt(arr[0]) * Integer.parseInt(arr[4]) - Integer.parseInt(arr[1]) * Integer.parseInt(arr[3])));
BigDecimal ansY = new BigDecimal(
(Integer.parseInt(arr[2]) * Integer.parseInt(arr[3]) - Integer.parseInt(arr[0]) * Integer.parseInt(arr[5])) /
(Integer.parseInt(arr[1]) * Integer.parseInt(arr[3]) - Integer.parseInt(arr[0]) * Integer.parseInt(arr[4])));
System.out.println(ansX.setScale(3, BigDecimal.ROUND_UP) + " " + ansY.setScale(3, BigDecimal.ROUND_UP));
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
bf.close();
} catch (IOException e) {
}
}
}
}
|
Main.java:6: error: class CopyOfMain is public, should be declared in a file named CopyOfMain.java
public class CopyOfMain {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s190721165
|
p00004
|
Java
|
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
float num[] = new float[6];
while(scan.hasNextFloat()){
for(int i=0; i<6;i++){
num[i] = scan.nextFloat();
}
float det = num[0]*num[4] - num[1]*num[3];
float x = (num[1]*num[5] - num[4]*num[2])/det;
float y = (num[2]-num[0]*x)/num[1];
System.out.printf("%.3f %.3f",x,y);
}
}
}
|
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s199634066
|
p00004
|
Java
|
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNextInt()){
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int d = scan.nextInt();
int e = scan.nextInt();
int f = scan.nextInt();
double tmp = a*e-b*d;
double x = (double)(c*e-b*f)/tmp;
double y = (double)(-c*d+a*f)/tmp;
System.out.println(String.format("%.3f",x) +" " + String.format("%.3f",y));
}
}
}
|
Main.java:21: error: illegal character: '\u3000'
System.out.println(String.format("%.3f",x) +" "?+ String.format("%.3f",y));
^
Main.java:21: error: ';' expected
System.out.println(String.format("%.3f",x) +" "?+ String.format("%.3f",y));
^
2 errors
|
s676941284
|
p00004
|
Java
|
import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
DecimalFormat df = new DecimalFormat(".000");
while (sc.hasNext()) {
double v[] = new double[6];
for (int i = 0; i < 6; i++) {
v[i] = sc.nextDouble();
}
double root = v[0]*v[4] - v[1]*v[3];
double x = (v[4]*v[2] - v[1]*v[5]) / root;
double y = (v[0]*v[5] - v[3]*v[2]) / root;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:6: error: cannot find symbol
DecimalFormat df = new DecimalFormat(".000");
^
symbol: class DecimalFormat
location: class Main
Main.java:6: error: cannot find symbol
DecimalFormat df = new DecimalFormat(".000");
^
symbol: class DecimalFormat
location: class Main
2 errors
|
s418620871
|
p00004
|
Java
|
import java.util.Scanner;
public class aoj0004 {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
double a = sc.nextDouble();
double b = sc.nextDouble();
double c = sc.nextDouble();
double d = sc.nextDouble();
double e = sc.nextDouble();
double f = sc.nextDouble();
b = b*d;
c = c*d;
e = e*a;
f = f*a;
double y = (c-f)/(b-e);
double x = (c-(b*y))/(a*d);
if(x>0)x = (double)((int)((x * 1000)+0.5))/1000;
if(x<0)x = (double)((int)((x * 1000)-0.5))/1000;
if(y>0)y = (double)((int)((y * 1000)+0.5))/1000;
if(y<0)y = (double)((int)((y * 1000)-0.5))/1000;
if(x==-0.0)x=0.0;
if(y==-0.0)y=0.0;
System.out.println(x +" "+ y);
}
}
}
|
Main.java:3: error: class aoj0004 is public, should be declared in a file named aoj0004.java
public class aoj0004 {
^
1 error
|
s041463288
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
public class AOJ_004 {
public static void main(String[] args)throws IOException {
BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
DecimalFormat df=new DecimalFormat("0.000");
int a,b,c,d,e,f;
float x,y;
List<String> xlist=new ArrayList<String>();
List<String> ylist=new ArrayList<String>();
String line;
while((line=buf.readLine())!=null){
a=Integer.parseInt(line.split(" ")[0]);
b=Integer.parseInt(line.split(" ")[1]);
c=Integer.parseInt(line.split(" ")[2]);
d=Integer.parseInt(line.split(" ")[3]);
e=Integer.parseInt(line.split(" ")[4]);
f=Integer.parseInt(line.split(" ")[5]);
x=(e*c-b*f)/(e*a-b*d);
y=(d*c-a*f)/(d*b-a*e);
xlist.add(df.format(x));
ylist.add(df.format(y));
}
for(int i=0;i<xlist.size();i++){
System.out.println(xlist.get(i)+" "+ylist.get(i));
}
}
}
|
Main.java:9: error: class AOJ_004 is public, should be declared in a file named AOJ_004.java
public class AOJ_004 {
^
1 error
|
s508493722
|
p00004
|
Java
|
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
// ax + by = c
double a = in.nextDouble();
double b = in.nextDouble();
double c = in.nextDouble();
// dx + ey = f
double d = in.nextDouble();
double e = in.nextDouble();
double f = in.nextDouble();
double y = (f + (-1 * d * (c / a))) / ((-1 * (d / a) * b) + e);
double x = (f + (-1 * e * y)) / d;
if(x == -0.000 || x == +0.000) {
x = 0.000;
}
if(y == -0.000 || y == +0.000) {
y = 0.000;
}
System.out.println(String.format("%.3f %.3f", x, y));
}
|
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner in = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:3: error: class, interface, enum, or record expected
while(in.hasNext()) {
^
Main.java:16: error: class, interface, enum, or record expected
if(x == -0.000 || x == +0.000) {
^
Main.java:18: error: class, interface, enum, or record expected
}
^
Main.java:21: error: class, interface, enum, or record expected
}
^
Main.java:24: error: class, interface, enum, or record expected
}
^
6 errors
|
s131054369
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
/*
* 連立方程式
ax + by = c
dx + ey = f
の解、x, y を出力して終了するプログラムを作成して下さい。
a, b, c, d, e, f はそれぞれ、 -1000 以上 1000 以下の実数とし、連立方程式の解が一意に存在するように与えれれるものとします。
Input
複数のデータセットが与えられます。入力の最後まで処理して下さい。1つのデータセットが1行に与えられます。
1つのデータセットに a, b, c, d, e, f が1つのスペースで区切られて与えられます。
Output
各データセットに対して、x, y を1つのスペースで区切って1行に出力して下さい。
各値は小数点以下第3位まで出力して下さい。小数点以下第4位を四捨五入して下さい。
x,yは以下の解法で求める
x = (ce - fb) / (ae -bd)
y = (cd - fa) / (bd - ae)
*/
public class SimultaneousEquation0004 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = null;
try {
while((line = br.readLine()) != null) {
line = line.trim();
String[] values = line.split("\\s");
if(values.length != 6) System.exit(-1);
int[] value = new int[6];
int i = 0;
for(String s : values) {
value[i] = Integer.parseInt(s);
if(value[i] < -1000 || value[i] > 1000) System.exit(-1);
i++;
}
int a = value[0];
int b = value[1];
int c = value[2];
int d = value[3];
int e = value[4];
int f = value[5];
double x = (double)(c*e - f*b) / (a*e - b*d);
double y = (double)(c*d - f*a) / (b*d - a*e);
BigDecimal bdX = new BigDecimal(x);
BigDecimal bdY = new BigDecimal(y);
bdX = bdX.setScale(3, BigDecimal.ROUND_HALF_UP);
bdY = bdY.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.println(bdX + " " + bdY);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
Main.java:26: error: class SimultaneousEquation0004 is public, should be declared in a file named SimultaneousEquation0004.java
public class SimultaneousEquation0004 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s603864989
|
p00004
|
Java
|
import java.io.*;
public class aoj {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
while ((line = br.readLine()) != null && line.length() > 0) {
String[] data = line.split(" ");
double[] d = new double[data.length];
for (int i = 0; i < d.length; i++) {
d[i] = Double.parseDouble(data[i]);
}
double x = (d[2] * d[4] - d[5] * d[1]) / (d[0] * d[4] - d[3] * d[1]),
y = (d[0] * d[5] - d[3] * d[2]) / (d[0] * d[4] - d[3] * d[1]);
x = Math.round(x * 1000) / (double) 1000;
y = Math.round(y * 1000) / (double) 1000;
System.out.printf("%.3f %.3f\n", x, y);
}
}
}
|
Main.java:3: error: class aoj is public, should be declared in a file named aoj.java
public class aoj {
^
1 error
|
s168100300
|
p00004
|
Java
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a,b,c,d,e,f;
double x,y;
while(sc.hasNext()){
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
d = sc.nextInt();
e = sc.nextInt();
f = sc.nextInt();
x = (c*e - b*f)/(a*e - b*d);
y = (c*d - a*f)/(b*d - a*e);
if(x == -0) x = 0;
if(y == -0) y = 0;
System.out.printf("%.3f %.3f",x1,y1);
}
}
}
|
Main.java:19: error: cannot find symbol
System.out.printf("%.3f %.3f",x1,y1);
^
symbol: variable x1
location: class Main
Main.java:19: error: cannot find symbol
System.out.printf("%.3f %.3f",x1,y1);
^
symbol: variable y1
location: class Main
2 errors
|
s488664761
|
p00004
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class Equation {
private static double a, b, c, d, e, f;
private static double x, y;
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line;
String[] array;
try{
while((line = br.readLine()) != null) {
array = line.split(" ");
setParams(array);
y = c - f * a / d;
y = y / (b - e * a / d);
x = (c - b * y) / a;
System.out.println(new BigDecimal(x).setScale(3, BigDecimal.ROUND_HALF_UP) + " " + new BigDecimal(y).setScale(3, BigDecimal.ROUND_HALF_UP));
}
} catch(Exception e){
System.out.println(e);
}
}
private static void setParams(String[] array) {
a = Double.parseDouble(array[0]);
b = Double.parseDouble(array[1]);
c = Double.parseDouble(array[2]);
d = Double.parseDouble(array[3]);
e = Double.parseDouble(array[4]);
f = Double.parseDouble(array[5]);
}
}
|
Main.java:5: error: class Equation is public, should be declared in a file named Equation.java
public class Equation {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s674151398
|
p00004
|
Java
|
//
// SimultaneousEquation.java
// SimultaneousEquation
//
// Created by hajime on 14/04/29.
// Copyright (c) 2014 __MyCompanyName__. All rights reserved.
import java.util.*;
import java.io.*;
import java.text.*;
public class Main {
public static void main (String args[]) {
double x = 0.0;
double y = 0.0;
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while ((line = br.readLine()) != null) {
String[] str = line.split(" ");
if (str.length == 6) {
double a = Double.parseDouble(str[0]);
double b = Double.parseDouble(str[1]);
double c = Double.parseDouble(str[2]);
double d = Double.parseDouble(str[3]);
double e = Double.parseDouble(str[4]);
double f = Double.parseDouble(str[5]);
x = (b*f - c*e)/(b*d - a*e);
y = (c*d - a*f)/(b*d - a*e);
//NumberFormat format = NumberFormat.getInstance();
//format.setMaximumFractionDigits(4);
System.out.println(format.format(x) + " " + format.format(y));
}else {
System.exit(0);
}
}
}
catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
finally {
System.exit(0);
}
}
}
|
Main.java:42: error: cannot find symbol
System.out.println(format.format(x) + " " + format.format(y));
^
symbol: variable format
location: class Main
Main.java:42: error: cannot find symbol
System.out.println(format.format(x) + " " + format.format(y));
^
symbol: variable format
location: class Main
2 errors
|
s332128883
|
p00004
|
C
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
float si(float a) {
a *= 1000;
if (a > 0) {
a += 0.5;
}
else {
a -= 0.5;
}
a = int(a);
a /= 1000;
return a;
}
int main() {
float a, b, c, d, e, f;
while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) {
b *= d;
c *= d;
e *= a;
f *= a;
float x, y;
y = (c - f) / (b - e);
x = (c / d - b / d * y) / a;
printf("%.3f %.3f\n", si(x), si(y));
}
}
|
main.c: In function 'si':
main.c:13:13: error: expected expression before 'int'
13 | a = int(a);
| ^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.