結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2020-07-15 12:57:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 5,000 ms |
コード長 | 240 bytes |
コンパイル時間 | 1,867 ms |
コンパイル使用メモリ | 191,396 KB |
最終ジャッジ日時 | 2025-01-11 21:08:27 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
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(Y<0)ans+=2;else if(X!=0)ans++;printf("%d\n",ans);}