結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2016-12-22 00:55:21 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 300 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 14:12:36 |
合計ジャッジ時間 | 1,349 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%ld%ld%ld",&X,&Y,&L); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>int main(){long int X,Y,L,i=0,j=0,ans=0,flag=0;scanf("%ld%ld%ld",&X,&Y,&L);if(X<0){X=-X;i++;}if(Y<0){Y=-Y;j++;}if(X%L==0)ans=ans+X/L;elseans=ans+X/L+1;if(Y%L==0)ans=ans+Y/L;elseans=ans+Y/L+1;if(X!=0){if(j==0)ans++;}if(j!=0)ans+=2;printf("%ld\n",ans);return 0;}