結果
問題 |
No.836 じょうよ
|
ユーザー |
|
提出日時 | 2019-09-01 12:41:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 563 bytes |
コンパイル時間 | 1,085 ms |
コンパイル使用メモリ | 73,804 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 21:21:46 |
合計ジャッジ時間 | 3,094 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 39 WA * 2 |
ソースコード
#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(left==right){ for(ll i=l;i<=r;i++){ cnt[i%n]++; } for(int i=0;i<n;i++){ cout << cnt[i] << endl; } return 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; } }