結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2022-08-15 17:17:15 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 661 bytes |
| コンパイル時間 | 2,946 ms |
| コンパイル使用メモリ | 244,784 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-02 06:27:06 |
| 合計ジャッジ時間 | 4,251 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_pair.h:61,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:64,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/specfun.h:45,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/cmath:1935,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:41,
from main.cpp:1:
In function 'constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = long long int]',
inlined from 'int main()' at main.cpp:16:9:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/move.h:204:11: warning: 'X' is used uninitialized [-Wuninitialized]
204 | _Tp __tmp = _GLIBCXX_MOVE(__a);
| ^~~~~
main.cpp: In function 'int main()':
main.cpp:15:8: note: 'X' declared here
15 | ll X,Y,L;
| ^
In function 'constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = long long int]',
inlined from 'int main()' at main.cpp:16:9:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/move.h:205:11: warning: 'Y' is used uninitialized [-Wuninitialized]
205 | __a = _GLIBCXX_MOVE(__b);
| ^
main.cpp: In function 'int main()':
main.cpp:15:10: note: 'Y' declared here
15 | ll X,Y,L;
| ^
ソースコード
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i,a,b) for (int i = a; i < b; i++)
#define irep(i,a,b) for (int i = a; i > b; i--)
#define print(n) cout << n << endl
#define rup(a,b) (a+b-1)/b
using namespace std;
int main(){
cout << fixed << setprecision(15);
ll X,Y,L;
swap(X,Y);
cin >> X >> Y >> L;
swap(X,Y);
ll count = 0;
if(!(Y == (ll)0)){
if (X>= 0) count += 1;
else count += 2;
}else{
if (X>=0) count += 0;
else count += 2;
}
count += rup(abs(X),L);
count += rup(abs(Y),L);
print(count);
//system("pause");
return 0;
}
momoyuu