結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
uliba3
|
| 提出日時 | 2020-07-15 12:52:04 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 238 bytes |
| コンパイル時間 | 4,766 ms |
| コンパイル使用メモリ | 190,368 KB |
| 最終ジャッジ日時 | 2025-01-11 21:07:56 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | int X,Y,L,ans=0;scanf("%d %d %d",&X,&Y,&L);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main()
{
int X,Y,L,ans=0;scanf("%d %d %d",&X,&Y,&L);
ans+=abs(X)/L;if(X%L>0)ans++;
ans+=abs(Y)/L;if(Y%L>0)ans++;
if(X<0)ans+=2;else if(Y!=0)ans++;
printf("%d\n",ans);
}
uliba3