結果

問題 No.817 Coin donation
ユーザー ohreitetsuohreitetsu
提出日時 2019-04-23 21:07:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 423 bytes
コンパイル時間 621 ms
コンパイル使用メモリ 68,596 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-23 16:11:15
合計ジャッジ時間 4,570 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
typedef long long LL;
struct X{
	LL A;
	LL B;
};
int main(int argc, char* argv[])
{
	LL N,K,i;
	cin>>N>>K;
	vector<X> AB(N);
	LL A1,B1;
	for (i=0;i<N;i++){
		cin>>AB[i].A>>AB[i].B;
	}
	LL k=0;
	LL M=1;
	while (true){
		for (i=0;i<N;i++){
			if (M>=AB[i].A && M<=AB[i].B){
				k++;
			}
			if (k==K){
				cout<<M<<endl;
				return 0;
			}
		}
		M++;
	}
	return 0;
}
0