Question:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.PriorityQueue;
public class Main {
  public static void main(String[] args) {
    Main m = new Main();
    m.run();
  }
  private void run() {
    int n = 0;
    long[] a = new long[0];
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
      n = Integer.parseInt(br.readLine());
      a = Arrays.stream(br.readLine().split("\\s+"))
        .mapToLong(Long::parseLong).toArray();
    } catch (IOException e) {
      e.printStackTrace();
    }
    long m = 0L;
    for (int i=0;i<n;i++) {
      PriorityQueue<Long> pq = new PriorityQueue<>();
      for (int j=i;j<n;j++) {
        pq.offer(a[j]);
        long b = pq.poll();
        m += b;
        pq.offer(b);
      }
    }
    System.out.println(m);
  }
}

Choices:
- Runtime Error
- Memory Limit Exceeded
- No abnormally found
- Time Limit Exceeded


Question:
import java.io.*;
import java.util.*;

public class Main {
    static final long MOD = 1000000007L;
    //static final long MOD = 998244353L;
    static final int INF = 50000000;
    static final int NINF = -500000000;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int N = sc.ni();
        long[][] nums = new long[N][2];
        TreeSet<Long> Ys = new TreeSet<Long>();
        for (int i = 0; i < N; i++) {
        	nums[i] = new long[] {sc.nl(),sc.nl()};
        	Ys.add(nums[i][1]);
        }
        sort(nums);
        HashMap<Long,Integer> hm = new HashMap<Long,Integer>();
        int T = 0;
        for (long y: Ys) {
        	hm.put(y,T);
        	T++;
        }

        SegmentTree st1 = new SegmentTree(T);
        SegmentTree st2 = new SegmentTree(T);
        for (int i = 0; i < T; i++) {
        	st1.update(i, -100000000000L);
        	st2.update(i, -100000000000L);
        }
        long ans = 0;
        for (long[] p: nums) {
        	int index = hm.get(p[1]);
        	long v1 = p[1]-p[0];
        	long v2 = 0-p[0]-p[1];
        	long val = Math.max(st1.query(index,T-1)-v1,st2.query(0, index)-v2);
        	ans = Math.max(ans, val);
        	if (v1 > st1.arr[index])
        		st1.update(index, v1);
        	if (v2 > st2.arr[index])
        		st2.update(index, v2);
        }
        pw.println(ans);
        pw.close();
    }

    //No lazy propagation. 0 indexed. Very fast.
    static class SegmentTree {
    	public long[] tree;
    	public long[] arr;
    	public long NONE;
    	public int N;

    	//Zero initialization
    	public SegmentTree(int n) {
    		N = n;
    		tree = new long[4*N+1];
    		arr = new long[N];
    		NONE = Long.MIN_VALUE; //set this manually (Long.MIN_VALUE for max-st, Long.MAX_VALUE for min-st, 0 for sum,xor-st, etc.)
    	}

    	public long merge(long a, long b) {
    		return Math.max(a, b); //set this manually
    	}

    	public long query(int i, int j) {
    		return query(0,0,N-1,i,j);
    	}

    	public void update(int arrIndex, long val) {
    		arr[arrIndex] = val;
    		update(0,0,N-1,arrIndex,val);
    	}

    	private long query(int treeIndex, int lo, int hi, int i, int j) {
    		// query for arr[i..j]
    		if (lo > j || hi < i)
    			return NONE;
    		if (i <= lo && j >= hi)
    			return tree[treeIndex];
    		int mid = lo + (hi - lo) / 2;

    		if (i > mid)
    			return query(2 * treeIndex + 2, mid + 1, hi, i, j);
    		else if (j <= mid)
    			return query(2 * treeIndex + 1, lo, mid, i, j);

    		long leftQuery = query(2 * treeIndex + 1, lo, mid, i, mid);
    		long rightQuery = query(2 * treeIndex + 2, mid + 1, hi, mid + 1, j);

    		// merge query results
    		return merge(leftQuery, rightQuery);
    	}

    	private void update(int treeIndex, int lo, int hi, int arrIndex, long val) {
    		if (lo == hi) {
    			tree[treeIndex] = val;
    			return;
    		}

    		int mid = lo + (hi - lo) / 2;

    		if (arrIndex > mid)
    			update(2 * treeIndex + 2, mid + 1, hi, arrIndex, val);
    		else if (arrIndex <= mid)
    			update(2 * treeIndex + 1, lo, mid, arrIndex, val);

    		// merge updates
    		tree[treeIndex] = merge(tree[2 * treeIndex + 1], tree[2 * treeIndex + 2]);
    	}
    }

    public static void sort(long[][] arr) {
    	//Sort an array (immune to quicksort TLE)
    	Random rgen = new Random();
    	for (int i = 0; i < arr.length; i++) {
    		int randomPosition = rgen.nextInt(arr.length);
    		long[] temp = arr[i];
    		arr[i] = arr[randomPosition];
    		arr[randomPosition] = temp;
    	}
    	Arrays.sort(arr, new Comparator<long[]>() {
    		@Override
    		public int compare(long[] arr1, long[] arr2) {
    			if (arr1[0] > arr2[0])
    				return 1;
    			else
    				return -1;
    			//Ascending order.
    		}
    	});
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- Runtime Error
- Memory Limit Exceeded
- Internal error
- Compile Error


Question:
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
	//static final long MOD = 1000000007L;
	static final int INF = 1000000007;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);

		int N = sc.ni();
		long[][] cnt = new long[30][55];
		int ints = 0;
		for (int i = 0; i < N; i++) {
			String s = sc.next();

			int ind = s.indexOf(".");
			if (ind==-1) {
				s += ".0";
				ind = s.indexOf(".");
			}
			int M = s.length();
			String str = s.substring(0,ind);
			if (ind < M)
				str += s.substring(ind+1,M);
			long num = Long.parseLong(str);
			int[] pow = new int[2];
			pow[0] = (ind-M+1);
			pow[1] = (ind-M+1);
			while (num % 2 == 0) {
				pow[0] += 1;
				num /= 2;
			}
			while (num % 5 == 0) {
				pow[1] += 1;
				num /= 5;
			}
			if (pow[0] >= 0 && pow[1] >= 0)
				ints += 1;
			cnt[pow[0]+9][pow[1]+9] += 1;
		}

		long ans = 0;

		for (int i = 0; i < cnt.length; i++) {
			for (int j = 0; j < cnt[0].length; j++) {
				for (int a = Math.max(18-i,0); a < cnt.length; a++) {
					for (int b = Math.max(18-j,0); b < cnt[1].length; b++) {
						ans += cnt[i][j]*cnt[a][b];
					}
				}
			}
		}
		ans = (ans-ints)/2;
		pw.println(ans);
		pw.close();
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- Memory Limit Exceeded
- No abnormally found
- Runtime Error
- Compile Error


Question:
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Main {
	static final long MOD = 998244353L;
	//static final long INF = 1000000000000000007L;
	static String letters = "abcdefghijklmnopqrstuvwxyz";
	//static final long MOD = 1000000007L;
	static final int INF = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);

		int N = sc.ni();
		int S = sc.ni();
		int[] nums = new int[N];
		for (int i = 0; i < N; i++)
			nums[i] = sc.ni();
		nums = shuffle(nums);
		Arrays.sort(nums);
		long[][] dp = new long[S+1][N+1]; //sum,size
		dp[0][0] = 1L;

		for (int i = 1; i <= N; i++) {
			int n = nums[i-1];
			long[][] newDP = new long[S+1][N+1];
			for (int j = 0; j <= S; j++) {
				for (int k = 0; k <= N; k++) {
					if (j >= n && k >= 1) {
						newDP[j][k]=(dp[j-n][k-1]+dp[j][k])%MOD;
					} else {
						newDP[j][k] = dp[j][k];
					}
				}
			}
			dp = newDP;
		}

		long ans = 0;
		for (int i = 1; i <= N; i++) {
			ans += dp[S][i]*power(2,N-i,MOD);
			ans %= MOD;
		}
		//pw.println(Arrays.toString(nums));
		pw.println(ans);
		pw.close();
	}

	static class SegmentTree {
		public int[] tree;
		public int N;

		//Zero initialization
		public SegmentTree(int n) {
			N = n;
			tree = new int[4*N+1];
		}

		public int query(int treeIndex, int lo, int hi, int i, int j) {
			// query for arr[i..j]
			if (lo > j || hi < i)
				return 0;
			if (i <= lo && j >= hi)
				return tree[treeIndex];
			int mid = lo + (hi - lo) / 2;

			if (i > mid)
				return query(2 * treeIndex + 2, mid + 1, hi, i, j);
			else if (j <= mid)
				return query(2 * treeIndex + 1, lo, mid, i, j);

			int leftQuery = query(2 * treeIndex + 1, lo, mid, i, mid);
			int rightQuery = query(2 * treeIndex + 2, mid + 1, hi, mid + 1, j);

			// merge query results
			return merge(leftQuery, rightQuery);
		}

		public void update(int treeIndex, int lo, int hi, int arrIndex, int val) {
			if (lo == hi) {
				tree[treeIndex] = val;
				return;
			}

			int mid = lo + (hi - lo) / 2;

			if (arrIndex > mid)
				update(2 * treeIndex + 2, mid + 1, hi, arrIndex, val);
			else if (arrIndex <= mid)
				update(2 * treeIndex + 1, lo, mid, arrIndex, val);

			// merge updates
			tree[treeIndex] = merge(tree[2 * treeIndex + 1], tree[2 * treeIndex + 2]);
		}

		public int merge(int a, int b) {
			return Math.max(a,b);
		}
	}

	public static long dist(long[] p1, long[] p2) {
		return (Math.abs(p2[0]-p1[0])+Math.abs(p2[1]-p1[1]));
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		if (y < 0) return 0L;
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[] shuffle(int[] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

	public static long[] shuffle(long[] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] a, int[] b) {
				  return a[0]-b[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] a, long[] b) {
				  if (a[0] < b[0])
					  return -1;
				  else
					  return 1;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- No abnormally found
- Internal error
- Time Limit Exceeded
- Runtime Error


Question:
import java.io.*;
import java.util.*;
//import java.math.*;
//import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int N = sc.ni();
		int K = sc.ni();
		long[] factorial = new long[2001];
		factorial[0] = 1L;
		for (int i = 1; i <= 2000; i++) {
			factorial[i] = (factorial[i-1]*i)%MOD;
		}
		for (int i = 1; i <= K; i++) {
			//(N-K+1) C (i)
			long den1 = (factorial[i]*factorial[N-K+1-i])%MOD;
			long ans1 = (factorial[N-K+1]*power(den1,MOD-2,MOD))%MOD;

			//(K-1) C (i-1)
			long den2 = (factorial[i-1]*factorial[K-i])%MOD;
			long ans2 = (factorial[K-1]*power(den2,MOD-2,MOD))%MOD;

			long ans = (ans1*ans2)%MOD;
			pw.println(ans);
		}
		pw.close();
	}

	public static long dist(long[] p1, long[] p2) {
		return (Math.abs(p2[0]-p1[0])+Math.abs(p2[1]-p1[1]));
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  //return arr1[0]-arr2[0]; //ascending order
				  if (arr1[0] != arr2[0]) {
					  return arr1[0]-arr2[0];
				  } else {
					  return arr1[1] - arr2[1];
				  }
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  //return 0;
				  if (arr1[0] < arr2[0]) {
					  return -1;
				  } else if (arr1[1] > arr2[1]) {
					  return 1;
				  } else {
					  return 0;
				  }
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- No abnormally found
- Internal error
- Memory Limit Exceeded
- Runtime Error


Question:
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Code {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		long t1 = System.currentTimeMillis();
		int N = sc.ni();
		int[][] info = new int[N][3];
		int minH = 0;
		for (int i = 0; i < N; i++) {
			info[i][0] = sc.ni(); //x
			info[i][1] = sc.ni(); //y
			info[i][2] = sc.ni(); //h
			minH = Math.max(info[i][2],minH);
		}
		int h = minH;
		while (true) {
			for (int x = 0; x <= 100; x++) {
				for (int y = 0; y <= 100; y++) {
					boolean good = true;
					for (int i = 0; i < N; i++) {
						if (Math.max(h-Math.abs(info[i][0]-x)-Math.abs(info[i][1]-y),0)!=info[i][2]) {
							good = false;
							break;
						}
					}
					if (good) {
						pw.println(x + " " + y + " " + h);
						long t2 = System.currentTimeMillis();
						pw.println(t2-t1);
						pw.close();
						return;
					}
				}
			}
			h++;
		}
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[0]-arr2[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- Memory Limit Exceeded
- Runtime Error
- Time Limit Exceeded
- Compile Error


Question:
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		long t1 = System.currentTimeMillis();
		int N = sc.ni();
		int[][] info = new int[N][3];
		int minH = 0;
		for (int i = 0; i < N; i++) {
			info[i][0] = sc.ni(); //x
			info[i][1] = sc.ni(); //y
			info[i][2] = sc.ni(); //h
			minH = Math.max(h,minH);
		}
		int h = minH;
		while (true) {
			for (int x = 0; x <= 100; x++) {
				for (int y = 0; y <= 100; y++) {
					boolean good = true;
					for (int i = 0; i < N; i++) {
						if (Math.max(h-Math.abs(info[i][0]-x)-Math.abs(info[i][1]-y),0)!=info[i][2]) {
							good = false;
							break;
						}
					}
					if (good) {
						pw.println(x + " " + y + " " + h);
						long t2 = System.currentTimeMillis();
						pw.println(t2-t1);
						pw.close();
						return;
					}
				}
			}
			h++;
		}
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[0]-arr2[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- Compile Error
- Internal error
- Memory Limit Exceeded
- Time Limit Exceeded


Question:
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public class Main {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int N = sc.ni();
		int[][] info = new int[N][3];
		for (int i = 0; i < N; i++) {
			info[i][0] = sc.ni(); //x
			info[i][1] = sc.ni(); //y
			info[i][2] = sc.ni(); //h
		}
		int h = 0;
		while (true) {
			for (int x = 0; x <= 100; x++) {
				for (int y = 0; y <= 100; y++) {
					boolean good = true;
					for (int i = 0; i < N; i++) {
						if (Math.max(h-Math.abs(info[i][0]-x)-Math.abs(info[i][1]-y),0)!=info[i][2]) {
							good = false;
							break;
						}
					}
					if (good) {
						pw.println(x + " " + y + " " + h);
						pw.close();
						return;
					}
				}
			}
			h++;
		}
	}

	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}

	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) {
		long ans = 1;
		x %= m;
		while (y > 0) {
			if(y % 2 == 1)
				ans = (ans * x) % m;
			y /= 2;
			x = (x * x) % m;
		}
		return ans;
	}

	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)

		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[0]-arr2[0]; //ascending order
	          }
		});
		return array;
	}

    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  return 0;
	          }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int ni() {
            return Integer.parseInt(next());
        }

        long nl() {
            return Long.parseLong(next());
        }

        double nd() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Choices:
- Compile Error
- Runtime Error
- No abnormally found
- Time Limit Exceeded


Question:
import java.io.*;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class C {

    public static void main(String[] args) throws IOException {
        init();

        BigInteger a = new BigInteger(next()), b = new BigInteger(next());
        System.out.println(a.multiply(b).divide(a.gcd(b)));
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }
}

Choices:
- Memory Limit Exceeded
- Compile Error
- No abnormally found
- Internal error


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	static int[][] map;
	static int[][] directions8= {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
	static int[][] directions25= {{-2,-2},{-2,-1},{-2,0},{-2,1},{-2,2},{-1,-2},{-1,-1},{-1,1},{-1, 2}
	,{0,-2},{0,2},{1,-2},{1,-1},{1,1},{1,2},{2,-2},{2, -1},{2,0},{2,1},{2,2}};
	static int[][] directions4= {{-1,0},{1,0},{0,-1},{0,1}};
	static int ans;
	static int[] parent;//union-find用
	static int[] rank;//union-find用
	static int[][] warp;
	static Queue<int[]> q;
	static int H;
	static int W;
	static int Dh;
	static int Dw;
	static char[][] S;

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int M = sc.nextInt();

		int[] h = new int[H];
		int[] w = new int[W];
		HashSet<String> exists = new HashSet<>();

		for(int i = 0;i<M ; i++) {
			int nowH =sc.nextInt()-1;
			int nowW =sc.nextInt()-1;
			h[nowH]++;
			w[nowW]++;
			String now =nowH+","+nowW;
			exists.add(now);
		}

		int maxH = 0;
		int maxW = 0;
		List<Integer> selectedH = new ArrayList<Integer>();
		List<Integer> selectedW = new ArrayList<Integer>();

		for(int i = 0;i<H ; i++) {
			if(maxH < h[i] ) {
				maxH = h[i];
				selectedH.clear();
				selectedH.add(i);
			}else if(maxH == h[i]) {
				selectedH.add(i);
			}
		}
		for(int i = 0;i<W ; i++) {
			if(maxW < w[i] ) {
				maxW = w[i];
				selectedW.clear();
				selectedW.add(i);
			}else if(maxW == w[i]) {
				selectedW.add(i);
			}
		}

		boolean allExist = true;

		for(int sH:selectedH) {
			for(int sW: selectedW) {
				if(!exists.contains(sH+","+sW)) {
					allExist = false;
				}
			}
		}
		ans = maxH + maxW;

		if(allExist) {
			ans--;
		}

		System.out.println(ans);
	}

//	public static void walk(int nowH, int nowW, int warped) {
//		if(nowH < 0 || nowH >= H || nowW <0 || nowW >= W || S[nowH][nowW] == '#' || warped >= warp[nowH][nowW]) {
//			return;
//		}
//		if(nowH == Dh && nowW == Dw && ans > warped) {
//			ans = warped;
//		}
//		int[] now = {nowH, nowW, warped};
//		q.add(now);
//		warp[nowH][nowW] = warped;
//		for(int i = 0;i<4 ; i++) {
//			walk(nowH+directions4[i][0], nowW+directions4[i][1], warped);
//		}
//	}
	//	public static void warp(int nowH, int nowW, int warped) {
	//
	//
	//
	//
	//	}

	//素数判定
	public static boolean isPrime(long num) {
		if (num < 2) return false;
		else if (num == 2) return true;
		else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

		double sqrtNum = Math.sqrt(num);
		for (int i = 3; i <= sqrtNum; i += 2)
		{
			if (num % i == 0)
			{
				// 素数ではない
				return false;
			}
		}

		// 素数である
		return true;
	}

	//BFS用に二つの配列を足し算する
	static int[] addArrayElms(int[] a, int[] b) {
		int[] c = new int[a.length];
		for(int i = 0; i < a.length; i++) {
			c[i] = a[i] + b[i];
		}
		return c;
	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray){
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedArray[mid]<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList){
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedList.get(mid)<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a: gcd(b, a % b);
	}
	public static long gcd(long a, long b) {
		return b == 0 ? a: gcd(b, a % b);
	}

	//Union-Find用の配列を要素数nで初期化
	static void ufInit(int n){
		parent = new int[n];
		rank = new int[n];
	}

	//Union-Findの要素の最上位の親（グループ名）を返す
	static int ufFind(int a) {
		if(parent[a]==a) {
			return a;
		}else {
			return ufFind(parent[a]);
		}
	}

	//Union-Find木を連結する
	static void ufUnite(int a, int b) {
		a = parent[a];
		b = parent[b];

		if(a==b) {
			return;
		}
		if(rank[a] > rank[b]){
			parent[b]=a;
		}else {
			parent[a]=b;
			if(rank[a]==rank[b]) {
				rank[b]++;
			}
		}
	}

	static boolean ufSame(int a, int b) {
		return ufFind(a)==ufFind(b);
	}
}

Choices:
- Runtime Error
- No abnormally found
- Time Limit Exceeded
- Memory Limit Exceeded


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	static int[][] map;
	static int[][] directions8= {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
	static int[][] directions25= {{-2,-2},{-2,-1},{-2,0},{-2,1},{-2,2},{-1,-2},{-1,-1},{-1,1},{-1, 2}
	,{0,-2},{0,2},{1,-2},{1,-1},{1,1},{1,2},{2,-2},{2, -1},{2,0},{2,1},{2,2}};
	static int[][] directions4= {{-1,0},{1,0},{0,-1},{0,1}};
	static int ans;
	static int[] parent;//union-find用
	static int[] rank;//union-find用
	static int[][] warp;
	static Queue<int[]> q;
	static int H;
	static int W;
	static int Dh;
	static int Dw;
	static char[][] S;

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int M = sc.nextInt();

		int[] h = new int[H];
		int[] w = new int[W];
		boolean[][] exists = new boolean[H][W];

		for(int i = 0;i<M ; i++) {
			int nowH =sc.nextInt()-1;
			int nowW =sc.nextInt()-1;
			h[nowH]++;
			w[nowW]++;
			exists[nowH][nowW] = true;
		}

		int maxH = 0;
		int maxW = 0;
		List<Integer> selectedH = new ArrayList<Integer>();
		List<Integer> selectedW = new ArrayList<Integer>();

		for(int i = 0;i<H ; i++) {
			if(maxH < h[i] ) {
				maxH = h[i];
				selectedH.clear();
				selectedH.add(i);
			}else if(maxH == h[i]) {
				selectedH.add(i);
			}
		}
		for(int i = 0;i<W ; i++) {
			if(maxW < w[i] ) {
				maxW = w[i];
				selectedW.clear();
				selectedW.add(i);
			}else if(maxW == w[i]) {
				selectedW.add(i);
			}
		}

		boolean allExist = true;

		for(int sH:selectedH) {
			for(int sW: selectedW) {
				if(!exists[sH][sW]) {
					allExist = false;
				}
			}
		}
		ans = maxH + maxW;

		if(allExist) {
			ans--;
		}

		System.out.println(ans);
	}

	public static void walk(int nowH, int nowW, int warped) {
		if(nowH < 0 || nowH >= H || nowW <0 || nowW >= W || S[nowH][nowW] == '#' || warped >= warp[nowH][nowW]) {
			return;
		}
		if(nowH == Dh && nowW == Dw && ans > warped) {
			ans = warped;
		}
		int[] now = {nowH, nowW, warped};
		q.add(now);
		warp[nowH][nowW] = warped;
		for(int i = 0;i<4 ; i++) {
			walk(nowH+directions4[i][0], nowW+directions4[i][1], warped);
		}
	}
	//	public static void warp(int nowH, int nowW, int warped) {
	//
	//
	//
	//
	//	}

	//素数判定
	public static boolean isPrime(long num) {
		if (num < 2) return false;
		else if (num == 2) return true;
		else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

		double sqrtNum = Math.sqrt(num);
		for (int i = 3; i <= sqrtNum; i += 2)
		{
			if (num % i == 0)
			{
				// 素数ではない
				return false;
			}
		}

		// 素数である
		return true;
	}

	//BFS用に二つの配列を足し算する
	static int[] addArrayElms(int[] a, int[] b) {
		int[] c = new int[a.length];
		for(int i = 0; i < a.length; i++) {
			c[i] = a[i] + b[i];
		}
		return c;
	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray){
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedArray[mid]<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList){
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedList.get(mid)<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a: gcd(b, a % b);
	}
	public static long gcd(long a, long b) {
		return b == 0 ? a: gcd(b, a % b);
	}

	//Union-Find用の配列を要素数nで初期化
	static void ufInit(int n){
		parent = new int[n];
		rank = new int[n];
	}

	//Union-Findの要素の最上位の親（グループ名）を返す
	static int ufFind(int a) {
		if(parent[a]==a) {
			return a;
		}else {
			return ufFind(parent[a]);
		}
	}

	//Union-Find木を連結する
	static void ufUnite(int a, int b) {
		a = parent[a];
		b = parent[b];

		if(a==b) {
			return;
		}
		if(rank[a] > rank[b]){
			parent[b]=a;
		}else {
			parent[a]=b;
			if(rank[a]==rank[b]) {
				rank[b]++;
			}
		}
	}

	static boolean ufSame(int a, int b) {
		return ufFind(a)==ufFind(b);
	}
}

Choices:
- Memory Limit Exceeded
- Internal error
- Runtime Error
- Compile Error


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		//		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//		String W	 = in.readLine();
		//		int num = Integer.parseInt(W.split(" ")[0]);

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		long[] nums = new long[100000];
		long ans = 0;

		for(int i = 0;i<N ; i++) {
			A[i] = sc.nextLong();
			ans += A[i];
			nums[(int)A[i]]++;
		}
		long Q = sc.nextLong();
		long[] B = new long[(int)Q];
		long[] C = new long[(int)Q];
		for(int i = 0;i<Q ; i++) {
			B[i] = sc.nextLong();
			C[i] = sc.nextLong();
			ans += (C[i]-B[i])*nums[(int)B[i]];
			nums[(int)C[i]] += nums[(int)B[i]];
			nums[(int)B[i]] = 0;
			System.out.println(ans);
		}
	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray){
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedArray[mid]<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList){
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedList.get(mid)<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a: gcd(b, a % b);
	}
	public static long gcd(long a, long b) {
		return b == 0 ? a: gcd(b, a % b);
	}

}

Choices:
- Runtime Error
- Internal error
- No abnormally found
- Time Limit Exceeded


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		//		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//		String W	 = in.readLine();
		//		int num = Integer.parseInt(W.split(" ")[0]);

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[] nums = new int[100000];
		int ans = 0;

		for(int i = 0;i<N ; i++) {
			A[i] = sc.nextInt();
			ans += A[i];
			nums[A[i]]++;
		}
		int Q = sc.nextInt();
		int[] B = new int[Q];
		int[] C = new int[Q];
		for(int i = 0;i<Q ; i++) {
			B[i] = sc.nextInt();
			C[i] = sc.nextInt();
			ans += (C[i]-B[i])*nums[B[i]];
			nums[C[i]] += nums[B[i]];
			nums[B[i]] = 0;
			System.out.println(ans);
		}
	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray){
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedArray[mid]<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList){
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedList.get(mid)<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a: gcd(b, a % b);
	}
	public static long gcd(long a, long b) {
		return b == 0 ? a: gcd(b, a % b);
	}

}

Choices:
- No abnormally found
- Internal error
- Runtime Error
- Time Limit Exceeded


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		//				int num = Integer.parseInt(W.split(" ")[0]);

		//		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(W.split(" ")[0]);

		int[] A = new int[N];
		int ans = 0;

		W = in.readLine();
		int thisHeight;
		int tmpValue = 0;
		Map<Integer, Integer> conditionMap = new HashMap<Integer, Integer>();
		for (int i = 0; i < N; i++) {
			thisHeight = Integer.parseInt(W.split(" ")[i]);

			if (conditionMap.containsKey(i - thisHeight)) {
				tmpValue = conditionMap.get(i - thisHeight);
				ans += tmpValue;
			}
			if (conditionMap.containsKey(i + thisHeight)) {
				conditionMap.put(thisHeight + i, conditionMap.get(i + thisHeight)+1);
			} else {
				conditionMap.put(thisHeight + i, 1);
			}
		}
		System.out.println(ans);
	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray) {
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedArray[mid] <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList) {
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedList.get(mid) <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

}

Choices:
- Internal error
- Memory Limit Exceeded
- Time Limit Exceeded
- Compile Error


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) throws IOException {
				BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
				String W	 = in.readLine();
//				int num = Integer.parseInt(W.split(" ")[0]);

//		Scanner sc = new Scanner(System.in);
		long N = Integer.parseInt(W.split(" ")[0]);

		long[] A = new long[(int) N];
		W	 = in.readLine();
		for (long i = 0; i < N; i++) {
			A[(int) i] = Integer.parseInt(W.split(" ")[(int) (i)]);
		}

		int ans = 0;
		for (long i = 0; i < N; i++) {
			for (long j = i+1;j<N; j++) {
				long tall = A[(int) i] + A[(int) j];

				if (Math.abs(i - j) == tall) {
					ans++;
				}
			}
		}
		System.out.println(ans);

	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray) {
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedArray[mid] <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList) {
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedList.get(mid) <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

}

Choices:
- Compile Error
- Internal error
- Time Limit Exceeded
- Runtime Error


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) throws IOException {
				BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
				String W	 = in.readLine();
//				int num = Integer.parseInt(W.split(" ")[0]);

//		Scanner sc = new Scanner(System.in);
		long N = Integer.parseInt(W.split(" ")[0]);
		long[] A = new long[(int) N];

		for (long i = 0; i < N; i++) {
			A[(int) i] = Integer.parseInt(W.split(" ")[(int) (i+1)]);
		}

		int ans = 0;
		for (long i = 0; i < N; i++) {
			for (long j = i+1;j<N; j++) {
				long tall = A[(int) i] + A[(int) j];

				if (Math.abs(i - j) == tall) {
					ans++;
				}
			}
		}
		System.out.println(ans);

	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray) {
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedArray[mid] <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList) {
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedList.get(mid) <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

}

Choices:
- Time Limit Exceeded
- Memory Limit Exceeded
- Runtime Error
- Compile Error


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		//		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//		String W	 = in.readLine();
		//		int num = Integer.parseInt(W.split(" ")[0]);

		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long[] A = new long[(int) N];

		for (long i = 0; i < N; i++) {
			A[(int) i] = sc.nextLong();
		}

		int ans = 0;
		for (long i = 0; i < N; i++) {
			for (long j = i+1;j<N; j++) {
				long tall = A[(int) i] + A[(int) j];

				if (Math.abs(i - j) == tall) {
					ans++;
				}
			}
		}
		System.out.println(ans);

	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray) {
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedArray[mid] <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList) {
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while (upperBorder - lowerBorder > 1) {
			mid = (upperBorder + lowerBorder) / 2;
			if (orderedList.get(mid) <= num) {
				lowerBorder = mid;
			} else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

}

Choices:
- Time Limit Exceeded
- No abnormally found
- Compile Error
- Internal error


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N= Integer.parseInt(W.split(" ")[0]);
			int M= Integer.parseInt(W.split(" ")[1]);
			W = in.readLine();
//			int[] A = new int[M];
			int homework =0;

			for(int i=0;i<M;i++) {
				homework+= Integer.parseInt(W.split(" ")[i]);
			}

			int ans = N - homework;

			if(ans >=0) {
				System.out.println(ans);
			}else {
				System.out.println(-1);
			}

	}

}

Choices:
- Internal error
- Time Limit Exceeded
- Runtime Error
- Memory Limit Exceeded


Question:
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextInt();
		long K = sc.nextInt();
		long ans = 0;
		long nSum = (N+1)*N/2+1;

		for(long k = K; k<=N+1; k++) {
			ans+=((2*N+1-k)*k/2-(k-1)*k/2+1);
			ans%=Math.pow(10,9)+7;
//			System.out.println(ans);
		}

		ans%=Math.pow(10,9)+7;

		System.out.println(ans);

	}

Choices:
- Runtime Error
- No abnormally found
- Compile Error
- Time Limit Exceeded


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String input	 = in.readLine();
		String S	 = in.readLine();

		int N = Integer.parseInt(input.split(" ")[0]);

		int[] s = new int[N];

		for(int i = 0;i<N;i++) {
			if(S.charAt(i)=='R') {
				s[i]=0;
			}else if(S.charAt(i)=='G') {
				s[i]=1;
			}else {
				s[i]=2;
			}
		}
		int ans=0;

		for(int i = 0; i<N; i++) {
			for(int j=i;i+2*j<N;j++) {
				if(s[i]!=s[i+j] && s[i+j]!=s[i+2*j] && s[i]!=s[i+2*j]) {
					ans++;
				}
			}
		}

		System.out.println(ans);
	}

Choices:
- Compile Error
- Runtime Error
- Memory Limit Exceeded
- No abnormally found


Question:
import java.io.IOException;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);

			BigInteger N = scanner.nextBigInteger();
			BigInteger K = scanner.nextBigInteger();

			BigInteger newN = N;

			if(N.compareTo(K) == 1) {
				newN = N.remainder(K);
			}else {
			newN = K.remainder(N);
			}

			N = newN.subtract(K);

			if(N.compareTo(newN) == 1) {
				System.out.println(newN);
			}else {
				System.out.println(N);
			}

	}

}

Choices:
- Time Limit Exceeded
- Runtime Error
- Compile Error
- No abnormally found


Question:
import java.io.IOException;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);

			BigInteger N = scanner.nextBigInteger();
			BigInteger K = scanner.nextBigInteger();

			BigInteger newN = N;

			while(true) {
				if(N.compareTo(K) == 1) {
					newN = (N.subtract(K));
				}else {
					newN = (K.subtract(N));
				}
//				System.out.println(N);
//				System.out.println(K);
//				System.out.println(newN);

				if(newN.add(N).compareTo(K) == 0) {
					break;
				}
				N = newN;
			}

			if(N.compareTo(newN) == 1) {
				System.out.println(newN);
			}else {
				System.out.println(N);
			}

	}

}

Choices:
- Memory Limit Exceeded
- Internal error
- Time Limit Exceeded
- Compile Error


Question:
package code;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

}

Choices:
- Internal error
- Memory Limit Exceeded
- Compile Error
- Runtime Error


Question:
package code;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			String W = in.readLine();

			int N = Integer.parseInt(W.split(" ")[0]);
			int M = Integer.parseInt(W.split(" ")[1]);

         int allPatternsNM = 0;
         allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);
	}

}

Choices:
- Runtime Error
- Compile Error
- Memory Limit Exceeded
- Time Limit Exceeded


Question:
package code;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		 BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());

         int allPatternsNM = 0;
         allPatternsNM = (N + M)*(N + M -1)/2;
         int eachPatternsNM = N*M;
         int ans= allPatternsNM - eachPatternsNM;
         System.out.println(ans);

	}

}

Choices:
- Compile Error
- Runtime Error
- Internal error
- Time Limit Exceeded


Question:
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int num= sc.nextInt();

		int[] n = new int[num];
		int[] match = new int[num];

		for (int i = 0; i < num; i++) {
			n[i] = sc.nextInt();
		}

		for (int i = 0; i < num; i++) {
			for (int j = 0; j < num; j++) {
				if (n[i] == n[j]) {
					match[i]++;
				}
			}
			match[i]--;
		}

		int sum = 0;
		for (int count : match) {
			sum += count;
		}
		sum /= 2;

		for (int i = 0; i < num; i++) {
			System.out.println(sum - match[i]);
		}

	}

}

Choices:
- No abnormally found
- Time Limit Exceeded
- Compile Error
- Memory Limit Exceeded


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String W = sc.next();
		int num = Integer.parseInt(W.split(" ")[0]);

		int[] n = new int[num];
		int[] match = new int[num];

		for (int i = 0; i < num; i++) {
			n[i] = sc.nextInt();
		}

		for (int i = 0; i < num; i++) {
			for (int j = 0; j < num; j++) {
				if (n[i] == n[j]) {
					match[i]++;
				}
			}
			match[i]--;
		}

		int sum = 0;
		for (int count : match) {
			sum += count;
		}
		sum /= 2;

		for (int i = 0; i < num; i++) {
			System.out.println(sum - match[i]);
		}

	}

}

Choices:
- No abnormally found
- Runtime Error
- Time Limit Exceeded
- Internal error


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int num = Integer.parseInt(W.split(" ")[0]);

		String Y = in.readLine();
		int[] n = new int[num];
		int[] match = new int[num];

		for (int i = 0; i < num; i++) {
			n[i] = Integer.parseInt(Y.split(" ")[i]);
		}

		for (int j = 0; j < num; j++) {
			if (n[0] == n[j]) {
				match[0]++;
			}
		}
		match[0]--;

		int sum = match[0];

		for (int i = 1; i < num; i++) {
			for (int j = 0; j < num; j++) {
				if (n[i] == n[j]) {
					if (j < i) {
						match[i] = match[j] + 1;
						break;
					} else {
						match[i]++;
					}
				}
			}
			match[i]--;
			sum += match[i];
		}

		sum /= 2;

		for (int i = 0; i < num; i++) {
			System.out.println(sum - match[i]);
		}

	}

}

Choices:
- No abnormally found
- Time Limit Exceeded
- Compile Error
- Memory Limit Exceeded


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		int num = Integer.parseInt(W.split(" ")[0]);

		String Y = in.readLine();
		int[] n = new int[num];
		int[] match = new int[num];

		for (int i = 0; i < num; i++) {
			n[i] = Integer.parseInt(Y.split(" ")[i]);
		}

		for (int i = 0; i < num; i++) {
			for (int j = 0; j < num; j++) {
				if (n[i] == n[j]) {
					match[i]++;
				}
			}
			match[i]--;
		}

		int sum = 0;
		for (int count : match) {
			sum += count;
		}
		sum /= 2;

		for (int i = 0; i < num; i++) {
			System.out.println(sum - match[i]);
		}

	}

}

Choices:
- Memory Limit Exceeded
- Time Limit Exceeded
- No abnormally found
- Runtime Error


Question:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();

		int num = Integer.parseInt(W.split(" ")[0]);
		int[] n = new int[num];
		int[] match = new int[num];

		for (int i = 0; i < num; i++) {
			n[i] = Integer.parseInt(W.split(" ")[i + 1]);
		}

		for (int i = 0; i < num; i++) {
			for (int j = 0; j < num; j++) {
				if (n[i] == n[j]) {
					match[i]++;
				}
			}
			match[i]--;
		}

		int sum = 0;
		for (int count : match) {
			sum += count;
		}
		sum /= 2;

		for (int i = 0; i < num; i++) {
			System.out.println(sum - match[i]);
		}

	}

}

Choices:
- Memory Limit Exceeded
- Time Limit Exceeded
- No abnormally found
- Runtime Error


Question:
import java.util.*;

class Main{

  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    for(int i = 0;i <= n;i++){
      arr[i] = sc.nextInt();
    }

    Arrays.sort(arr);

    int x = 0;
    for(int i = 0;i < n-1;i++){
      x += arr[i];
    }
    if(arr[n-1]>x){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }

  }

}

Choices:
- No abnormally found
- Time Limit Exceeded
- Internal error
- Runtime Error


Question:
import java.util.*;

class Main{

  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    for(int i = 0;i < n;i++){
      arr[i] = sc.nextInt();
    }

    Arrays.sort(arr);

    int x = 0;
    for(int i = 0;i < n-1;i++){
      x += arr[i];
    }
    if(arr[n]>x){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }

  }

}

Choices:
- Internal error
- Time Limit Exceeded
- Runtime Error
- Compile Error


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int N = one.get(0);
		int K = one.get(1);
		int mod = 998244353;
		long[] dp = new long[N];
		dp[0] = 1;
		ArrayList<Node> S = new ArrayList<>();
		for(int i = 0; i < K; i++){
			ArrayList<Integer> tmp = nextIntArray();
			S.add(new Node(tmp.get(0), tmp.get(1)));
		}
		for(int i = 0; i < N; i++){
			for(int j = 0; j < S.size(); j++){
				Node check = S.get(j);
				for(int k = check.L; k <= check.R; k++){
					try{
						dp[i + k] += dp[i];
						dp[i + k] %= mod;
					}catch(Exception e){}
				}
			}
		}
		myout(dp[N - 1]);

	}
	//Method addition frame start

static class Node{
	int L;
	int R;
	Node(int L, int R){
		this.L = L;
		this.R = R;
	}
}

	//Method addition frame end

	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	@SuppressWarnings("unchecked")
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
}

Choices:
- Time Limit Exceeded
- Internal error
- Runtime Error
- Memory Limit Exceeded


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> one = nextCharArray();
		double D = Double.parseDouble(one.get(0));
		double T = Double.parseDouble(one.get(1));
		double S = Double.parseDouble(one.get(2));
		if(D / S <= T){
			myout("Yes");
		}else{
			myout("No");
		}
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Runtime Error
- No abnormally found
- Compile Error
- Internal error


Question:
import java.util.*;import java.io.*;import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			while(true){
				String read;
				try{
					read = br.readLine();
				}catch(IOException e){
					read = null;
				}
				if(read != null){
					inputLine.add(read);
				}else{
					break;
				}
			}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				String returnStr = inputLine.get(index);
				index++;
				return returnStr;
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}

	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static ArrayList<String> nextStrArray(){return myHanSpSplit(next());}
	static ArrayList<String> myHanSpSplit(String str){return new ArrayList<String>(Arrays.asList(str.split(" ")));}
	static ArrayList<String> nextCharArray(){return mySingleSplit(next());}
	static ArrayList<String> mySingleSplit(String str){return new ArrayList<String>(Arrays.asList(str.split("")));}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<Integer> ret = new ArrayList<Integer>();
		ArrayList<String> input = nextStrArray();
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<Long> ret = new ArrayList<Long>();
		ArrayList<String> input = nextStrArray();
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String kaigyoToStr(String[] list){return String.join("\n",list);}
	static String kaigyoToStr(ArrayList<String> list){return String.join("\n",list);}
	static String hanSpToStr(String[] list){return String.join(" ",list);}
	static String hanSpToStr(ArrayList<String> list){return String.join(" ",list);}
	public static void main(String[] args){
		Runtime rt = Runtime.getRuntime();
		long mae = System.currentTimeMillis();
		solve();
		flush();
		long ato = System.currentTimeMillis();
		myerr("time : " + (ato - mae) + "ms");
		myerr("memory : " + ((rt.totalMemory() - rt.freeMemory()) / 1024) + "KB");
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		int N = nextInt();
		ArrayList<String> list = nextCharArray();
		HashMap<String, TreeSet<Integer>> map = new HashMap<String, TreeSet<Integer>>(1000);
		ArrayList<String> alpha = mySingleSplit("abcdefghijklmnopqrstuvwxyz");
		for(int i = 0; i < alpha.size(); i++){
			map.put(alpha.get(i), new TreeSet(100));
		}
		for(int i = 0; i < N; i++){
			TreeSet<Integer> tmp = map.get(list.get(i));
			tmp.add(i + 1);
			map.put(list.get(i), tmp);
		}
		int Q = nextInt();
		for(int i = 0; i < Q; i++){
			ArrayList<String> tmp = nextStrArray();
			if(tmp.get(0).equals("1")){
				int changeIndex = Integer.parseInt(tmp.get(1));
				for(int j = 0; j < alpha.size(); j++){
					TreeSet set = map.get(alpha.get(j));
					if(set.contains(changeIndex)){
						set.remove(changeIndex);
						map.put(alpha.get(j), set);
						break;
					}
				}
				TreeSet set = map.get(tmp.get(2));
				set.add(changeIndex);
				map.put(tmp.get(2), set);
			}else{
				int L = Integer.parseInt(tmp.get(1));
				int R = Integer.parseInt(tmp.get(2));
				int count = 0;
				for(int j = 0; j < alpha.size(); j++){
					TreeSet set = map.get(alpha.get(j));
					Object high = set.floor(R);
					Object low = set.ceiling(L);
					if(low != null && high != null){
						if((int)low <= (int)high){
							count++;
						}
					}
				}
				myout(count);
			}
		}
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Compile Error
- Time Limit Exceeded
- No abnormally found
- Internal error


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> one = nextStrArray();
		String S = one.get(0);
		String T = one.get(1);
		ArrayList<Integer> two = nextIntArray();
		int A = two.get(0);
		int B = two.get(1);
		String S = next();
		if(S.equals(U)){
			A--;
		}else{
			B--;
		}
		myout(A + " " + B);
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Internal error
- Time Limit Exceeded
- Runtime Error
- Compile Error


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int N = one.get(0);
		int K = one.get(1);
		long output = 0;
		ArrayList<Integer> list = nextIntArray();
		Collections.sort(list, Comparator.reverseOrder());
		for(int i = K; i < H; i++){
			output += list.get(i);
		}
		myout(output);
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Time Limit Exceeded
- Internal error
- Compile Error
- No abnormally found


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int H = one.get(0);
		int K = one.get(1);
		long output = 0;
		ArrayList<Integer> list = nextIntArray();
		Collections.sort(list, Comparator.reverseOrder());
		for(int i = K; i < N; i++){
			output += list.get(i);
		}
		myout(output);
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Time Limit Exceeded
- No abnormally found
- Runtime Error
- Compile Error


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");

		solve();flush();

	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		int N = nextInt();
		int[][] list = new int[10][10];
		for(int i = 1; i <= N; i++){
			int tmp = i;
			while(tmp >= 10){
				tmp /= 10;
			}
			list[i % 10][tmp]++;
		}
		long output = 0;
		for(int i = 1; i <= 9; i++){
			for(int j = 1 j <= 9; j++){
				output += list[i][j] * list[j][i];
			}
		}
		myout(output);
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Runtime Error
- Compile Error
- Memory Limit Exceeded
- Internal error


Question:
import java.util.*;
public class Main {
	public static void myout(Object text){//standard output
		System.out.println(text);
	}
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      Long output = new Long(0);
      int N = sc.nextInt();
      int M = sc.nextInt();
      //int[] list = new int[N];
      ArrayList<Integer> list = new ArrayList<Integer>(N);
      int i;
      for(i = 0; i < N; i++){
        list.add(sc.nextInt());
      }
      for(i = 0; i < M; i++){
        int max = Collections.max(list);
        if(max == 0){
          myout(0);
          return;
        }
        list.set(list.indexOf(max),max / 2);
      }

      int max2 = Collections.max(list);
      if(max2 == 0){
          myout(0);
          return;
        }
      for(i = 0; i < N; i++){
        output += list.get(i);
      }
      myout(output);
	}
}

Choices:
- Compile Error
- No abnormally found
- Memory Limit Exceeded
- Time Limit Exceeded


Question:
import java.util.*;
public class Main {
	public static void myout(Object text){//standard output
		System.out.println(text);
	}
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      Long output = new Long(0);
      int N = sc.nextInt();
      int M = sc.nextInt();
      //int[] list = new int[N];
      ArrayList<Integer> list = new ArrayList<Integer>(N);
      int i;
      for(i = 0; i < N; i++){
        list.add(sc.nextInt());
      }
      for(i = 0; i < M; i++){
        int max = Collections.max(list);
        if(max == 0){
          myout(0);
          return;
        }
        list.set(list.indexOf(max),max / 2);
      }
      for(i = 0; i < N; i++){
        output += list.get(i);
      }
      myout(output);
	}
}

Choices:
- Time Limit Exceeded
- Memory Limit Exceeded
- Internal error
- No abnormally found


Question:
import java.util.*;
public class Main {
	public static void myout(Object text){//standard output
		System.out.println(text);
	}
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      Long output = new Long(0);
      int N = sc.nextInt();
      int M = sc.nextInt();
      //int[] list = new int[N];
      ArrayList<Integer> list = new ArrayList<Integer>(N);
      int i;
      for(i = 0; i < N; i++){
        list.add(sc.nextInt());
      }
      for(i = 0; i < M; i++){
        int max = Collections.max(list);
        //myout(list.indexOf(max));
        list.set(list.indexOf(max),max / 2);
      }
      for(i = 0; i < N; i++){
        output += list.get(i);
      }
      myout(output);
	}
}

Choices:
- Compile Error
- Runtime Error
- Time Limit Exceeded
- Memory Limit Exceeded


Question:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		  int N = nextInt();
		  ArrayList<Integer> list = nextIntArray();
		  int[] newlist = new int[N];
		  newlist[0] = list.get(i);
		  for(int i = 1; i < N; i++){
		    newlist[i - 1] = Math.min(newlist[i - 1], list.get(i - 1));
		    newlist[i] = list.get(i - 1);
		  }
		  int output = 0;
		  for(int i = 0; i < N; i++){
		    output += newlist[i];
		  }
		  myout(output);
	}
	//Method addition frame start

	//Method addition frame end
}

Choices:
- Time Limit Exceeded
- Memory Limit Exceeded
- Compile Error
- Internal error


Question:
import java.util.*;import java.io.*;import java.math.*;
public class Main{
  //↓見なくていいよ！ここから------------------------------------------
  static class InputIterator{
    ArrayList<String> inputLine = new ArrayList<String>(1024);
    int index = 0; int max;
    InputIterator(){
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      while(true){
        String read;
        try{
          read = br.readLine();
        }catch(IOException e){
          read = null;
        }
        if(read != null){
          inputLine.add(read);
        }else{
          break;
        }
      }
      max = inputLine.size();
    }
    boolean hasNext(){return (index < max);}
    String next(){
      if(hasNext()){
        String returnStr = inputLine.get(index);
        index++;
        return returnStr;
      }else{
        throw new IndexOutOfBoundsException("これ以上入力はないよ");
      }
    }
  }

  static InputIterator ii = new InputIterator();//リアクティブでは使えないので諦めてScanner使うこと
  static PrintWriter out = new PrintWriter(System.out);
  static void flush(){out.flush();}
  static void myout(Object t){out.println(t);}
  static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
  static String next(){return ii.next();}
  static int nextInt(){return Integer.parseInt(next());}
  static long nextLong(){return Long.parseLong(next());}
  static ArrayList<String> nextStrArray(){return myHanSpSplit(next());}
  static ArrayList<String> myHanSpSplit(String str){return new ArrayList<String>(Arrays.asList(str.split(" ")));}
  static ArrayList<String> nextCharArray(){return mySingleSplit(next());}
  static ArrayList<String> mySingleSplit(String str){return new ArrayList<String>(Arrays.asList(str.split("")));}
  static ArrayList<Integer> nextIntArray(){
    ArrayList<Integer> ret = new ArrayList<Integer>();
    ArrayList<String> input = nextStrArray();
    for(int i = 0; i < input.size(); i++){
      ret.add(Integer.parseInt(input.get(i)));
    }
    return ret;
  }
  static ArrayList<Long> nextLongArray(){
    ArrayList<Long> ret = new ArrayList<Long>();
    ArrayList<String> input = nextStrArray();
    for(int i = 0; i < input.size(); i++){
      ret.add(Long.parseLong(input.get(i)));
    }
    return ret;
  }
  static String kaigyoToStr(String[] list){return String.join("\n",list);}
  static String kaigyoToStr(ArrayList<String> list){return String.join("\n",list);}
  static String hanSpToStr(String[] list){return String.join(" ",list);}
  static String hanSpToStr(ArrayList<String> list){return String.join(" ",list);}
  public static void main(String[] args){
    Runtime rt = Runtime.getRuntime();
    long mae = System.currentTimeMillis();
    solve();
    flush();
    long ato = System.currentTimeMillis();
    myerr("time : " + (ato - mae) + "ms");
    myerr("memory : " + ((rt.totalMemory() - rt.freeMemory()) / 1024) + "KB");
  }
  //↑見なくていいよ！ここまで------------------------------------------
  static void solve(){//ここがメイン関数代わり
	int N = nextInt();
	Node[] list = new Node[N + 1];
	for(int i = 0; i < N; i++){
		list[i + 1] = new Node();
		list[i + 1].next = nextIntArray();
	}
	int count = 0;
	HashSet<Integer> end = new HashSet<Integer>();
	while(true){
		HashSet<Integer> battled = new HashSet<Integer>();
		boolean isBattled = false;
		for(int i = 1; i <= N; i++){
			if(end.contains(i) || battled.contains(i)){
				continue;
			}
			int aite = list[i].next.get(list[i].lastIndex);
			if(!battled.contains(aite) && !end.contains(aite)){
				if(list[aite].next.get(list[aite].lastIndex) == i){
					list[i].lastIndex++;
					list[aite].lastIndex++;
					battled.add(i);
					battled.add(aite);
					if(list[i].lastIndex >= N - 1){
						end.add(i);
					}
					if(list[aite].lastIndex >= N - 1){
						end.add(aite);
					}
					isBattled = true;
				}
			}
		}
		if(!isBattled){
			if(end.size() == N){
				myout(count);
			}else{
				myout(-1);
			}
			return;
		}
		count++;
	}
  }
  //Method addition frame start
static class Node{
	ArrayList<Integer> next;
	int lastIndex = 0;
	Node(){}
}
  //Method addition frame end
}

Choices:
- Time Limit Exceeded
- No abnormally found
- Runtime Error
- Compile Error


Question:
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        Long output = 0;
        Hashtable<String,Long> ht = new Hashtable<String,Long>();
		// 整数の入力
		int N = sc.nextInt();
		for(int i = 1; i <= N; i++){
          char[] tmp = sc.next().toCharArray();
          Arrays.sort(tmp);
          String tmp2 = new String(tmp);
          if(ht.get(tmp2) == null){
            ht.put(tmp2,new Long("1"));
          }else{
            output += ht.get(tmp2);
            ht.put(tmp2,ht.get(tmp2) + 1);
          }
        }
		System.out.println(output);

		// 出力

	}
}

Choices:
- No abnormally found
- Internal error
- Compile Error
- Memory Limit Exceeded