結果
問題 | No.2213 Neq Move |
ユーザー |
|
提出日時 | 2023-02-11 10:18:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 714 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 32,768 KB |
最終ジャッジ日時 | 2025-02-10 14:12:48 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In lambda function: main.cpp:13:23: error: ‘tie’ was not declared in this scope 13 | if(D < B) tie(A, B, C, D) = make_tuple(B, A, D, C); | ^~~ main.cpp:3:1: note: ‘std::tie’ is defined in header ‘<tuple>’; did you forget to ‘#include <tuple>’? 2 | #include<algorithm> +++ |+#include <tuple> 3 | using namespace std; main.cpp:13:41: error: ‘make_tuple’ was not declared in this scope 13 | if(D < B) tie(A, B, C, D) = make_tuple(B, A, D, C); | ^~~~~~~~~~ main.cpp:13:41: note: ‘std::make_tuple’ is defined in header ‘<tuple>’; did you forget to ‘#include <tuple>’? main.cpp:16:23: error: ‘tie’ was not declared in this scope 16 | if(B < A) tie(A, B, C, D) = make_tuple(B, A, D, C); | ^~~ main.cpp:16:23: note: ‘std::tie’ is defined in header ‘<tuple>’; did you forget to ‘#include <tuple>’? main.cpp:16:41: error: ‘make_tuple’ was not declared in this scope 16 | if(B < A) tie(A, B, C, D) = make_tuple(B, A, D, C); | ^~~~~~~~~~ main.cpp:16:41: note: ‘std::make_tuple’ is defined in header ‘<tuple>’; did you forget to ‘#include <tuple>’? main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &total_testcases); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d %d %d %d", &A, &B, &C, &D); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<cstdio>#include<algorithm>using namespace std;int main(){int total_testcases;scanf("%d", &total_testcases);for (int testcase_i = 1; testcase_i <= total_testcases; ++testcase_i){int A, B, C, D;scanf("%d %d %d %d", &A, &B, &C, &D);auto solve = [&](){if(C < A && D < B) return C + D + 2;if(D < B) tie(A, B, C, D) = make_tuple(B, A, D, C);if(C < A) return D < C ? C + D + 2 + int(B == 1) : C + 1 + D - B;if((A < B) ^ (D < C)) return C - A + D - B;if(B < A) tie(A, B, C, D) = make_tuple(B, A, D, C);return C - A + D + 1;};printf("%d\n", solve());}return 0;}