結果

問題 No.836 じょうよ
ユーザー mmn15277198mmn15277198
提出日時 2020-07-06 21:09:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 617 bytes
コンパイル時間 805 ms
コンパイル使用メモリ 87,868 KB
実行使用メモリ 4,548 KB
最終ジャッジ日時 2023-10-24 23:23:42
合計ジャッジ時間 4,806 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
4,516 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 10 ms
4,348 KB
testcase_12 AC 15 ms
4,348 KB
testcase_13 AC 10 ms
4,348 KB
testcase_14 AC 3 ms
4,348 KB
testcase_15 AC 13 ms
4,348 KB
testcase_16 AC 96 ms
4,548 KB
testcase_17 AC 87 ms
4,348 KB
testcase_18 AC 9 ms
4,348 KB
testcase_19 AC 19 ms
4,348 KB
testcase_20 AC 56 ms
4,348 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <math.h>
#include <map>
using namespace std;

int main(){
	long long l,r;
	int n;
	cin >> l >> r >> n;
	vector<int> a;
	vector<long long> b(n,0);
	for(long long i=l;i<=r;i++){
		if(i==l){
			a.push_back(i%n);
			continue;
		}
		if(a[0]!=i%n){
			a.push_back(i%n);
		}else{
			break;
		}
	}
	
	for(int i=0;i<n;i++){
		b[a[i]]+=(r-l+1)/n;
	}
	
	long long mo=(r-l+1)%n;
	for(int i=0;i<mo;i++){
		b[a[i]]++;
	}
	
	sort(a.begin(),a.end());
	for(int i=0;i<a.size();i++){
		cout << b[a[i]] << endl;
	}

	return 0;
}
0