結果
問題 |
No.51 やる気の問題
|
ユーザー |
![]() |
提出日時 | 2014-10-28 23:27:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 325 bytes |
コンパイル時間 | 439 ms |
コンパイル使用メモリ | 39,364 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 14:17:41 |
合計ジャッジ時間 | 1,579 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d%d",&w,&d);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <algorithm> using namespace std; //namaega 184 int main(){ int d,w; scanf("%d%d",&w,&d);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); int ans=0; while(d){ w=w-w/d; if(d==1)ans=w; d--; } printf("%d\n",ans); return 0; }