結果
問題 | No.509 塗りつぶしツール |
ユーザー |
|
提出日時 | 2017-05-04 21:18:47 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 3,470 ms |
コンパイル使用メモリ | 74,472 KB |
実行使用メモリ | 41,600 KB |
最終ジャッジ日時 | 2024-09-14 07:16:05 |
合計ジャッジ時間 | 8,370 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 16 |
ソースコード
import java.util.Scanner; public class Nuritsubushi { public static void main(String[] args) { Scanner s = new Scanner(System.in); StringBuilder n = new StringBuilder(s.next()); s.close(); int a = 0,b = 0,c = 0; while(n.length() != 0){ char ch = n.charAt(0); n.deleteCharAt(0); if(ch == '8'){ c++; }else if(ch == '0' || ch == '4' || ch == '6' || ch == '9'){ b++; }else{ a++; } } a = a*2 + b*3 + c*4 + 1; System.out.println(a); } }