結果

問題 No.477 MVP
ユーザー yukiteruyukiteru
提出日時 2018-02-04 16:44:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 608 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 79,984 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 16:03:25
合計ジャッジ時間 1,243 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:30:21: 警告: 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: 警告: 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