結果
| 問題 |
No.477 MVP
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2017-01-27 22:31:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 383 bytes |
| コンパイル時間 | 1,351 ms |
| コンパイル使用メモリ | 166,480 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-23 16:16:31 |
| 合計ジャッジ時間 | 1,858 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K;
bool check(ll x) {
if(N - x <= 0) return true;
ll rem = N - x;
return rem < x * K;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> N >> K;
ll ng = 0, ok = N;
while(abs(ng - ok) > 1) {
ll mid = (ng + ok) / 2;
if(check(mid)) ok = mid;
else ng = mid;
}
cout << ok << endl;
}
femto