結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
goodbaton
|
| 提出日時 | 2014-11-17 23:01:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 212 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 27,648 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 16:48:58 |
| 合計ジャッジ時間 | 1,185 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 6 |
コンパイルメッセージ
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("%d%d",&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:11: note: ‘sigoto’ was declared here
4 | int d,w,sigoto;
| ^~~~~~
ソースコード
#include<cstdio>
int main(){
int d,w,sigoto;
scanf("%d%d",&w,&d);
for(int i=0;i<d;i++){
sigoto=(int)(w/(double)((d-i)*(d-i)));
w-=sigoto;
}
printf("%d\n",sigoto);
return 0;
}
goodbaton