結果

問題 No.477 MVP
ユーザー yukiteru
提出日時 2018-02-04 16:44:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 608 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 03:59:51
合計ジャッジ時間 1,226 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:30:21: warning: overflow in conversion from 'double' to 'long long int' changes value from '1.0e+19' to '9223372036854775807' [-Woverflow]
   30 |                 p = 10e18;
      |                     ^~~~~
main.cpp:33:21: warning: overflow in conversion from 'double' to 'long long int' changes value from '1.0e+19' to '9223372036854775807' [-Woverflow]
   33 |                 q = 10e18;
      |                     ^~~~~

ソースコード

diff #

#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>
#include<list>
#include<bitset>
#include<functional>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000

using namespace std;

int main(void) {
	long long int n, k;
	long long int p, q;

	cin >> n >> k;
	p = n / (k + 1) + 1;
	q = n - k + 2;
	if (p < 0) {
		p = 10e18;
	}
	if (q < 0) {
		q = 10e18;
	}
	cout << min(p,q) << endl;

	return 0;
}
0