結果

問題 No.504 ゲーム大会(ランキング)
ユーザー tentententen
提出日時 2022-09-13 10:36:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 234 ms / 2,000 ms
コード長 1,288 bytes
コンパイル時間 2,387 ms
コンパイル使用メモリ 74,492 KB
実行使用メモリ 57,748 KB
最終ジャッジ日時 2023-08-20 12:04:56
合計ジャッジ時間 5,631 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,192 KB
testcase_01 AC 41 ms
49,404 KB
testcase_02 AC 42 ms
49,472 KB
testcase_03 AC 42 ms
49,228 KB
testcase_04 AC 41 ms
49,408 KB
testcase_05 AC 40 ms
49,208 KB
testcase_06 AC 41 ms
49,800 KB
testcase_07 AC 229 ms
57,364 KB
testcase_08 AC 225 ms
57,144 KB
testcase_09 AC 223 ms
55,840 KB
testcase_10 AC 224 ms
57,604 KB
testcase_11 AC 234 ms
57,416 KB
testcase_12 AC 212 ms
57,748 KB
testcase_13 AC 201 ms
57,116 KB
testcase_14 AC 223 ms
57,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        int rank = 1;
        sb.append("1\n");
        int score = sc.nextInt();
        for (int i = 1; i < n; i++) {
            int x = sc.nextInt();
            if (x > score) {
                rank++;
            }
            sb.append(rank).append("\n");
        }
        System.out.print(sb);
    }
}
    
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0