Bug in resulting system verdict.

The forum to report every bug you find or tell us what you'd like to find in UVa OJ's new system

Moderator: Board moderators

Locked
SyFyKid
New poster
Posts: 26
Joined: Tue May 08, 2012 9:47 am

Bug in resulting system verdict.

Post by SyFyKid » Thu May 31, 2012 1:27 pm

I have send many codes for http://uva.onlinejudge.org/index.php?op ... D+10174951 problem...

Why I have WA instead of RE ?

Code: Select all

import java.io.*;
//import java.math.BigInteger;
import java.util.*;
//import java.awt.geom.*;
//import java.util.regex.*;
import java.util.StringTokenizer;

public class Main implements Runnable {
//    ArrayList<Integer>[] graph;
//    boolean[] used;

    void solve(){
        console(true);//!System.getProperty("user.name").equals("skydos"));

        //int n = RI();

        for(int i=0;;i++) out.println(10/0);

//        for(int i=0; i<n; i++){
//            int verts = RS().trim().charAt(0) - 'A' + 1;
//
//            if(verts<0 || verts>26) out.println(10/0); // EXCEPTION
//
////            out.println("verts = "+verts);
//
//            // graph init
//            graph = new ArrayList[verts];
//            used = new boolean[verts]; // default == false
//            for(int j=0; j<verts; j++) graph[j] = new ArrayList<Integer>();
//
//            // reading edges
//            String edge;
//            while((edge = RLine())!=null && edge.trim().length()!=0){
//                edge = edge.trim();
//
//                if(edge.length()!=2) out.println(10/0); // EXCEPTION
//
//                int from = edge.charAt(0) - 'A', to = edge.charAt(1) - 'A';
//
////                out.println("=>"+from+" "+to);
//
//                graph[from].add(to);
//                graph[to].add(from);
//            }
//
//            // bfsing from each vertex
//            int components = 0;
//            for(int j=0; j<verts; j++){
//                if(!used[j]){
//                    components++;
//
//                    used[j] = true;
//                    bfs(j);
//                }
//            }
//
//            if(i == n-1) out.print(components);
//            else out.println(components+"\n");
//        }
    }

//    void bfs(int v){
//        Queue<Integer> q = new LinkedList<Integer>();
//
//        q.add(v);
//        while(!q.isEmpty()){
//            int curV = q.poll();
//
//            for(int to:graph[curV]){
//                if(!used[to]){
//                    q.add(to);
//                    used[to] = true;
//                }
//            }
//        }
//    }

    StringTokenizer st;
    PrintWriter out;
    BufferedReader br;
    boolean eof = false;

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }

    String nextToken(){
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }

    String RLine() {
        String ret;
        try {
            ret = br.readLine();
        } catch (Exception e) {
            ret = "";
        }
        if (ret == null) {
            eof = true;
            return null;
        }
        return ret;
    }

    int RC() {
        try {
            return br.read();
        } catch (Exception e) {
            return -1;
        }
    }

    String RS() {
        return nextToken();
    }

    int RI() {
        return Integer.parseInt(nextToken());
    }

    long RL() {
        return Long.parseLong(nextToken());
    }

    double RD() {
        return Double.parseDouble(nextToken());
    }

    void console(boolean f) {
        if (f) {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            try {
                File input = new File("input.txt");
                if (!input.exists()) {
                    input.createNewFile();
                }

                br = new BufferedReader(new InputStreamReader(new FileInputStream("input.txt")));
                out = new PrintWriter(new OutputStreamWriter(new FileOutputStream("output.txt")));
            } catch (Exception e) {
                e.printStackTrace();
                System.exit(111);
            }
        }
    }

    @Override
    public void run() {
        solve();
        out.close();
    }
}
And why I am getting TL indead of OL in this code:

Code: Select all

import java.io.*;
//import java.math.BigInteger;
import java.util.*;
//import java.awt.geom.*;
//import java.util.regex.*;
import java.util.StringTokenizer;

public class Main implements Runnable {
//    ArrayList<Integer>[] graph;
//    boolean[] used;

    void solve(){
        console(true);//!System.getProperty("user.name").equals("skydos"));

        //int n = RI();

        for(int i=0;;i++) out.println("A");

//        for(int i=0; i<n; i++){
//            int verts = RS().trim().charAt(0) - 'A' + 1;
//
//            if(verts<0 || verts>26) out.println(10/0); // EXCEPTION
//
////            out.println("verts = "+verts);
//
//            // graph init
//            graph = new ArrayList[verts];
//            used = new boolean[verts]; // default == false
//            for(int j=0; j<verts; j++) graph[j] = new ArrayList<Integer>();
//
//            // reading edges
//            String edge;
//            while((edge = RLine())!=null && edge.trim().length()!=0){
//                edge = edge.trim();
//
//                if(edge.length()!=2) out.println(10/0); // EXCEPTION
//
//                int from = edge.charAt(0) - 'A', to = edge.charAt(1) - 'A';
//
////                out.println("=>"+from+" "+to);
//
//                graph[from].add(to);
//                graph[to].add(from);
//            }
//
//            // bfsing from each vertex
//            int components = 0;
//            for(int j=0; j<verts; j++){
//                if(!used[j]){
//                    components++;
//
//                    used[j] = true;
//                    bfs(j);
//                }
//            }
//
//            if(i == n-1) out.print(components);
//            else out.println(components+"\n");
//        }
    }

//    void bfs(int v){
//        Queue<Integer> q = new LinkedList<Integer>();
//
//        q.add(v);
//        while(!q.isEmpty()){
//            int curV = q.poll();
//
//            for(int to:graph[curV]){
//                if(!used[to]){
//                    q.add(to);
//                    used[to] = true;
//                }
//            }
//        }
//    }

    StringTokenizer st;
    PrintWriter out;
    BufferedReader br;
    boolean eof = false;

    public static void main(String[] args) {
        new Thread(new Main()).start();
    }

    String nextToken(){
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }

    String RLine() {
        String ret;
        try {
            ret = br.readLine();
        } catch (Exception e) {
            ret = "";
        }
        if (ret == null) {
            eof = true;
            return null;
        }
        return ret;
    }

    int RC() {
        try {
            return br.read();
        } catch (Exception e) {
            return -1;
        }
    }

    String RS() {
        return nextToken();
    }

    int RI() {
        return Integer.parseInt(nextToken());
    }

    long RL() {
        return Long.parseLong(nextToken());
    }

    double RD() {
        return Double.parseDouble(nextToken());
    }

    void console(boolean f) {
        if (f) {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            try {
                File input = new File("input.txt");
                if (!input.exists()) {
                    input.createNewFile();
                }

                br = new BufferedReader(new InputStreamReader(new FileInputStream("input.txt")));
                out = new PrintWriter(new OutputStreamWriter(new FileOutputStream("output.txt")));
            } catch (Exception e) {
                e.printStackTrace();
                System.exit(111);
            }
        }
    }

    @Override
    public void run() {
        solve();
        out.close();
    }
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Bug in resulting system verdict.

Post by brianfry713 » Fri Jun 01, 2012 12:13 am

The Judge's compiler might handle your obvious divide by zero differently.

I don't think it's currently possible to get Output Limit Exceeded.
Check input and AC output for thousands of problems on uDebug!

Locked

Return to “Bugs and suggestions”