結果
問題 | No.2194 兄弟の掛け引き |
ユーザー |
![]() |
提出日時 | 2023-02-26 16:55:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 41,284 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 07:04:45 |
合計ジャッジ時間 | 893 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
/* -*- coding: utf-8 -*-** 2194.cc: No.2194 兄弟の掛け引き - yukicoder*/#include<cstdio>#include<algorithm>using namespace std;/* constant *//* typedef *//* global variables *//* subroutines *//* main */int main() {int a, b, c;scanf("%d%d%d", &a, &b, &c);int n0 = -1, n1 = -1;if (c <= b && c % a == 0) n0 = c / a;if ((c + b) % a == 0) n1 = (c + b) / a;if (n0 < 0 && n1 < 0) puts("-1");else {if (n0 >= 0) printf("%d\n", n0);if (n1 >= 0) printf("%d\n", n1);}return 0;}