結果

問題 No.63 ポッキーゲーム
ユーザー jolly_gliscor
提出日時 2018-02-23 00:50:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 267 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 457 ms
コンパイル使用メモリ 37,680 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 12:30:42
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |   scanf("%d",&a);
      |   ~~~~~^~~~~~~~~
main.cpp:21:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |   scanf("%d",&b);
      |   ~~~~~^~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>

void PockyGame(int x, int y)
{
  
  for(int i=0;;i++){    
    if ( x <= 2*y*(i+1) ){
      printf("%d\n",y*i);
      break;
    }
  }
}

int main(void)
{
  int a,b;
  scanf("%d",&a);
  scanf("%d",&b);
  PockyGame(a,b);
  return 0;
}
0