結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-11-23 17:48:58 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,256 bytes |
| 記録 | |
| コンパイル時間 | 389 ms |
| コンパイル使用メモリ | 84,068 KB |
| 実行使用メモリ | 9,860 KB |
| 最終ジャッジ日時 | 2026-11-23 17:49:01 |
| 合計ジャッジ時間 | 2,753 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 20 |
ソースコード
#include <iostream>
using namespace std;
int mod(int x, int y)
{
if (x-y>0)
{
return x-y;
}
else
{
return y-x;
}
}
int main()
{
int x,y,l;
cin >> x;
cin >> y;
cin >> l;
int ans = 0;
if(y>0)
{
if(x>0)
{
ans++;
ans = ans + (x/l + x%l) + (y/l + y%l);
}
else if(x == 0)
{
ans= ans + (y/l + y%l);
}
else if(x < 0)
{
ans++;
ans = ans - (x/l + x%l) + (y/l + y%l);
}
}
else if(y < 0)
{
if(x>0)
{
ans++;
ans++;
ans = ans + (x/l + x%l) - (y/l + y%l);
}
else if(x == 0)
{
ans++;
ans++;
ans= ans - (y/l + y%l);
}
else if(x < 0)
{
ans++;
ans++;
ans = ans - (x/l + x%l) - (y/l + y%l);
}
}
else if( y==0)
{
if(x>0)
{
ans++;
ans = ans + (x/l + x%l) ;
}
else if(x < 0)
{
ans++;
ans = ans - (x/l + x%l);
}
}
cout << ans << endl;
}
vjudge1