結果
問題 | No.2088 数当てゲーム |
ユーザー | rogi52 |
提出日時 | 2022-09-30 22:47:22 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 403 bytes |
コンパイル時間 | 2,045 ms |
コンパイル使用メモリ | 198,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 00:31:45 |
合計ジャッジ時間 | 3,017 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); // x // Ax + B = x // (A - 1) x = -B // x = -B / (A-1) ll A,B; cin >> A >> B; if(A == 1LL) { assert(B == 0); cout << 1 << endl; } else { cout << -B / (A - 1) << endl; } }