結果

問題 No.51 やる気の問題
ユーザー goodbaton
提出日時 2014-11-17 23:02:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 27,520 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 16:49:06
合計ジャッジ時間 886 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%lld%lld",&w,&d);
      |   ~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:980,
                 from /usr/include/c++/13/cstdio:42,
                 from main.cpp:1:
In function ‘int printf(const char*, ...)’,
    inlined from ‘int main()’ at main.cpp:13:9:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:86:23: warning: ‘sigoto’ may be used uninitialized [-Wmaybe-uninitialized]
   86 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp: In function ‘int main()’:
main.cpp:4:17: note: ‘sigoto’ was declared here
    4 |   long long d,w,sigoto;
      |                 ^~~~~~

ソースコード

diff #

#include<cstdio>

int main(){
  long long d,w,sigoto;

  scanf("%lld%lld",&w,&d);

  for(int i=0;i<d;i++){
    sigoto=w/((d-i)*(d-i));
    w-=sigoto;
  }

  printf("%lld\n",sigoto);
  return 0;
}
0