結果

問題 No.9000 Hello World! (テスト用)
ユーザー PravinPravin
提出日時 2021-05-24 15:57:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 3,547 bytes
コンパイル時間 5,616 ms
コンパイル使用メモリ 79,388 KB
実行使用メモリ 37,324 KB
最終ジャッジ日時 2024-10-13 00:17:31
合計ジャッジ時間 6,239 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//This code is written by प्रविण शंखपाळ 

//package wizard;

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

class Ginny_Weasley {

	static long freq(ArrayList<Long> x, int n) {

		Collections.sort(x);

		long max_count = 1, res = x.get(0);
		int curr_count = 1;

		for (int i = 1; i < n; i++) {
			if (x.get(i) == x.get(i - 1))
				curr_count++;
			else {
				if (curr_count > max_count) {
					max_count = curr_count;
					res = x.get(i - 1);
				}
				curr_count = 1;
			}
		}

		if (curr_count > max_count) {
			max_count = curr_count;
			res = x.get(n - 1);
		}

		long count = 0;

		for (int i = 0; i < n; i++) {

			if (x.get(i) == res) {
				count++;
			}

		}
		return n - count;
	}

	public static void main(String[] args) {

		try {

			FastReader fr = new FastReader();
			PrintWriter pt = new PrintWriter(System.out);

			int t = 1;

			while (t > 0) {

				String str = fr.next();

				pt.println("Hello World!");

				pt.println();

				t--;

			}

			pt.close();

		} catch (

		Exception e) {
			return;
		}
	}

	static class Tuple<Tuple> {

		int a;
		int b;
		int c;

		Tuple(int a, int b, int c) {
			this.a = a;
			this.b = b;
			this.c = c;
		}

	}

	static void merge(long arr[], int l, int m, int r) {

		int n1 = m - l + 1;
		int n2 = r - m;

		long L[] = new long[n1];
		long R[] = new long[n2];

		for (int i = 0; i < n1; ++i)
			L[i] = arr[l + i];
		for (int j = 0; j < n2; ++j)
			R[j] = arr[m + 1 + j];

		int i = 0, j = 0;

		int k = l;
		while (i < n1 && j < n2) {
			if (L[i] <= R[j]) {
				arr[k] = L[i];
				i++;
			} else {
				arr[k] = R[j];
				j++;
			}
			k++;
		}

		while (i < n1) {
			arr[k] = L[i];
			i++;
			k++;
		}

		while (j < n2) {
			arr[k] = R[j];
			j++;
			k++;
		}
	}

	static void sort(long arr[], int l, int r) {
		if (l < r) {

			int m = l + (r - l) / 2;

			sort(arr, l, m);
			sort(arr, m + 1, r);

			merge(arr, l, m, r);
		}
	}

	static class Pair implements Comparable<Pair> {
		int a, b;

		Pair(int a, int b) {
			this.a = a;
			this.b = b;
		}

		public int compareTo(Pair o) {
			// TODO Auto-generated method stub
			if (this.a != o.a)
				return Long.compare(this.a, o.a);
			else
				return Long.compare(this.b, o.b);
			// return 0;
		}

		public boolean equals(Object o) {
			if (o instanceof Pair) {
				Pair p = (Pair) o;
				return p.a == a && p.b == b;
			}
			return false;
		}

	}

	static int binarySearch(int arr[], int first, int last, long key) {
		int mid = (first + last) / 2;
		while (first <= last) {
			if (arr[mid] < key) {
				first = mid + 1;
			} else if (arr[mid] == key) {
				return mid;
			} else {
				last = mid - 1;
			}
			mid = (first + last) / 2;
		}
//		return -1;
		return mid;
//		return mid if want to find key greater than or less than arr[mid] if exact value is not given
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			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 nextInt() {
			return Integer.parseInt(next());
		}

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

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

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