結果

問題 No.836 じょうよ
コンテスト
ユーザー KKT89
提出日時 2019-09-01 12:39:54
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 432 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 569 ms
コンパイル使用メモリ 90,328 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-05-22 01:59:09
合計ジャッジ時間 3,384 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 10 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long int ll;

ll cnt[100010];

int main(){
	ll l,r,n; cin >> l >> r >> n;
	ll left=l/n; ll right=r/n;
	ll c=0;
	if(right-left>1)c+=(right-left-1);
	for(ll i=l;;i++){
		if(i%n==0)break;
		cnt[i%n]++;
	}
	for(ll i=r;;i--){
		if(i!=r&&i%n==n-1)break;
		cnt[i%n]++;
	}
	for(int i=0;i<n;i++){
		cout << cnt[i]+c << endl;
	}
}
0