結果

問題 No.2775 Nuisance Balls
ユーザー kusagame12
提出日時 2024-06-12 17:07:00
言語 Java
(openjdk 23)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 1,214 bytes
コンパイル時間 2,569 ms
コンパイル使用メモリ 77,396 KB
実行使用メモリ 54,716 KB
最終ジャッジ日時 2024-06-12 17:07:10
合計ジャッジ時間 7,603 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

        int n = sc.nextInt();

        StringBuilder sb = new StringBuilder();

        while(n > 0) {
            String str = "";
            int cnt = 0;
            if(n / 720 >= 1){
                str = "C";
                cnt = n / 720;
                n = n - (cnt * 720);
            }else if(n / 360 >= 1){
                str = "M";
                cnt = n / 360;
                n = n - (cnt * 360);
            }else if(n / 180 >= 1){
                str = "S";
                cnt = n / 180;
                n = n - (cnt * 180);
            }else if(n / 30 >= 1){
                str = "R";
                cnt = n / 30;
                n = n - (cnt * 30);
            }else if(n / 6 >= 1){
                str = "o";
                cnt = n / 6;
                n = n - (cnt * 6);
            }else{
                str = ".";
                cnt = n;
                n = 0;
            }
            for (int i=0; i<cnt; i++) {
                sb.append(str);
            }
        }
        
        System.out.println(sb);
    }	

}
0