結果

問題 No.836 じょうよ
ユーザー ttttan2ttttan2
提出日時 2019-06-14 21:58:59
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 982 bytes
コンパイル時間 1,711 ms
コンパイル使用メモリ 145,244 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-09 00:29:30
合計ジャッジ時間 4,027 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 15 ms
4,376 KB
testcase_13 AC 10 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 12 ms
4,380 KB
testcase_16 AC 93 ms
4,380 KB
testcase_17 AC 85 ms
4,380 KB
testcase_18 AC 9 ms
4,380 KB
testcase_19 AC 19 ms
4,376 KB
testcase_20 AC 52 ms
4,376 KB
testcase_21 AC 5 ms
4,380 KB
testcase_22 AC 45 ms
4,376 KB
testcase_23 AC 100 ms
4,380 KB
testcase_24 AC 9 ms
4,376 KB
testcase_25 AC 35 ms
4,376 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 4 ms
4,376 KB
testcase_28 AC 10 ms
4,380 KB
testcase_29 AC 5 ms
4,384 KB
testcase_30 AC 4 ms
4,380 KB
testcase_31 AC 12 ms
4,380 KB
testcase_32 AC 12 ms
4,376 KB
testcase_33 AC 4 ms
4,376 KB
testcase_34 AC 10 ms
4,376 KB
testcase_35 AC 11 ms
4,376 KB
testcase_36 AC 58 ms
4,376 KB
testcase_37 AC 54 ms
4,380 KB
testcase_38 AC 79 ms
4,376 KB
testcase_39 AC 65 ms
4,376 KB
testcase_40 AC 125 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:42:25: warning: ‘u’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     fill(cnt,cnt+n,v/n-u/n);
                        ~^~

ソースコード

diff #

#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
int main(){
    ll l,r,n;cin>>l>>r>>n;
    ll u,v;
    for(ll i=l;i>=0;i--){
        if(i%n==0){
            u=i;
            break;
        }
    }
    for(ll i=r;;i++){
        if(i%n==0){
            v=i;
            break;
        }
    }
    ll cnt[n];
    fill(cnt,cnt+n,v/n-u/n);
    rep(i,0,l%n)cnt[i]--;
    if(r%n!=0)rrep(i,n-1,r%n+1)cnt[i]--;
    if(r%n==0)cnt[0]++;
    rep(i,0,n)cout<<cnt[i]<<endl;
}
0