結果
問題 |
No.51 やる気の問題
|
ユーザー |
|
提出日時 | 2018-09-05 23:05:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 381 ms |
コンパイル使用メモリ | 31,616 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 17:24:26 |
合計ジャッジ時間 | 1,102 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&W); | ~~~~~^~~~~~~~~ main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&D); | ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h> #include <math.h> int main(){ int W,D; scanf("%d",&W); scanf("%d",&D); for (int i = D;i > 1;i--){ W -= floor(1.0*W/i/i); } printf("%d\n",W); }