結果
| 問題 |
No.825 賢いお買い物
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-30 16:27:24 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 660 bytes |
| コンパイル時間 | 3,472 ms |
| コンパイル使用メモリ | 75,292 KB |
| 実行使用メモリ | 43,596 KB |
| 最終ジャッジ日時 | 2024-11-21 12:42:07 |
| 合計ジャッジ時間 | 7,208 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 1 |
ソースコード
package con_level_1half;
import java.util.Scanner;
public class Con825 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt() , b = s.nextInt() , c = s.nextInt();
s.close();
if(c >= a + b){
System.out.println("Impossible");
}else{
int d = a + b - c;
if(d < 10){
if(d <= a){
System.out.println(d);
}else{
System.out.println(a + (d - a) * 10);
}
}else{
if(a > d){
System.out.println((d + 1) % 10);
}else{
if(a > 10){
System.out.println(a % 10 + (d - a + 1) * 10);
}else{
System.out.println(a + (d - a) * 10);
}
}
}
}
}
}