結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
tk55513
|
| 提出日時 | 2023-02-17 19:10:17 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 124 ms / 1,000 ms |
| コード長 | 613 bytes |
| コンパイル時間 | 2,583 ms |
| コンパイル使用メモリ | 73,952 KB |
| 実行使用メモリ | 41,336 KB |
| 最終ジャッジ日時 | 2024-07-19 10:56:09 |
| 合計ジャッジ時間 | 4,465 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String... args){
Scanner sc=new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int b0=c;
int b1=c+b;
boolean isAns=false;
if(b0%a==0&&c-b<=0){
System.out.println(b0/a);
isAns|=true;
}
if(b1%a==0){
System.out.println(b1/a);
isAns|=true;
}
if(!isAns){
System.out.println(-1);
}
}
}
tk55513