結果

問題 No.63 ポッキーゲーム
ユーザー umashika
提出日時 2016-02-25 23:46:37
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 198 ms / 5,000 ms
コード長 294 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 20,480 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 05:01:39
合計ジャッジ時間 1,587 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%d %d",&l,&k);
      |   ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main()
{
  int l;
  int k;
  int memory;
  int x;
  scanf("%d %d",&l,&k);

  x = k;

  if(l-2*x>0){
    while(l>0){//lが正の限りループ
      memory=k;
      l=l-2*x;
      k+=x;
    }
    printf("%d\n",memory-x);
  }
  else{
    printf("0\n");
  }
  return 0;
}

0