結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2014-10-28 23:34:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 355 bytes |
| コンパイル時間 | 516 ms |
| コンパイル使用メモリ | 39,656 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 14:23:29 |
| 合計ジャッジ時間 | 1,220 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | WA * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
19 | printf("%d\n",ans);
| ~^ ~~~
| | |
| int long long int
| %lld
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%lld%lld",&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(){
long long d,w;
scanf("%lld%lld",&w,&d);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay);
long long ans=0;
while(d){
ans=w/d*d;
if(d==1)break;
w-=ans;
d--;
}
printf("%d\n",ans);
return 0;
}
184