結果

問題 No.836 じょうよ
ユーザー michonz4
提出日時 2020-01-06 22:00:26
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 361 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 00:06:45
合計ジャッジ時間 6,112 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main() {
  long long l, r;
  int n;
  scanf("%lld %lld %d", &l, &r, &n);

  long long front=l+(n%l), back=r-r%n-1, center=(back-front+1)/n;
  if (n==1) center++;

  long long arr[100]={};
  for (int i=0; i<n; i++) {
    arr[i]+=center;
    if (i<=r%n) arr[i]++;
    if (i>=l) arr[i]++;
    printf(" %lld\n", arr[i]);
  }
  
  return 0;
}
0