結果

問題 No.504 ゲーム大会(ランキング)
ユーザー kazapyon27kazapyon27
提出日時 2017-06-11 16:38:07
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 857 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 75,904 KB
実行使用メモリ 78,256 KB
最終ジャッジ日時 2023-10-24 21:06:37
合計ジャッジ時間 7,510 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,648 KB
testcase_01 AC 54 ms
53,616 KB
testcase_02 AC 54 ms
53,616 KB
testcase_03 AC 54 ms
53,624 KB
testcase_04 AC 54 ms
53,628 KB
testcase_05 AC 54 ms
53,628 KB
testcase_06 AC 54 ms
53,628 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.504 ゲーム大会(ランキング)*/
import java.io.*;
import java.util.*;
public class No504{
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			int player=Integer.parseInt(input.readLine());
			Integer score[] = new Integer [player];
			int K_score;
			int Rank=0;
			/*long t0=System.currentTimeMillis();*/
			for(int i=0;i<player;i++){
				score[i]=Integer.parseInt(input.readLine());
			}
			/*System.out.println((System.currentTimeMillis()-t0)/1000+"秒");*/
			K_score=score[0];
			for(int j=0;j<player;j++){
				Arrays.sort(score,0,j+1,Collections.reverseOrder());
				for(int k=Rank;k<player;k++){
					if(K_score==score[k]){
						Rank=k;
						break;						
					}
				}
				System.out.println(Rank+1);
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0