結果
問題 | No.48 ロボットの操縦 |
ユーザー | momoyuu |
提出日時 | 2022-08-15 17:17:15 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.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 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,816 KB |
testcase_02 | AC | 2 ms
6,816 KB |
testcase_03 | AC | 2 ms
6,816 KB |
testcase_04 | AC | 2 ms
6,820 KB |
testcase_05 | AC | 2 ms
6,816 KB |
testcase_06 | AC | 2 ms
6,816 KB |
testcase_07 | AC | 1 ms
6,816 KB |
testcase_08 | AC | 2 ms
6,820 KB |
testcase_09 | AC | 1 ms
6,816 KB |
testcase_10 | AC | 1 ms
6,820 KB |
testcase_11 | AC | 2 ms
6,820 KB |
testcase_12 | AC | 2 ms
6,816 KB |
testcase_13 | AC | 2 ms
6,816 KB |
testcase_14 | AC | 2 ms
6,816 KB |
testcase_15 | AC | 1 ms
6,816 KB |
testcase_16 | AC | 2 ms
6,816 KB |
testcase_17 | AC | 2 ms
6,820 KB |
testcase_18 | AC | 2 ms
6,816 KB |
testcase_19 | AC | 2 ms
6,816 KB |
testcase_20 | AC | 2 ms
6,816 KB |
testcase_21 | AC | 2 ms
6,816 KB |
testcase_22 | AC | 1 ms
6,820 KB |
testcase_23 | AC | 2 ms
6,820 KB |
testcase_24 | AC | 2 ms
6,820 KB |
コンパイルメッセージ
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; }