Day 3 CF731div3 vp 今天药忘吃喽~ 2024-03-27 13:56 14阅读 0赞 **这场我不好说,我感觉我是逆天,div3的C题都卡了很久,想太复杂了,一直wa2,结果没发现这么简单,越打越低能了属于是:** ![2af077fd2c7a6f7e1123533c756a4dc7.png][] **然后赛后一下子把D和E给1A了,乐** **群友说,比赛的时候卡题的话,如果40分钟连代码都写不了,那就果断跳题** **平时训练的话,一道题先想20分钟,如果20分钟过去写不来代码就去看题解** **不能光速看题解,否则训练效果=0** [Dashboard - Codeforces Round \#731 (Div. 3) - Codeforces][Dashboard - Codeforces Round _731 _Div. 3_ - Codeforces] A. Shortest Path with Obstacle [Problem - A - Codeforces][] 小分类讨论 题意: 给出三个点 A,B,F问你从A到B且不经过F的最短路是多少 讨论A,B,F的相对位置即可,特判同一行和同一列的情况 Code: #include <bits/stdc++.h> #define int long long #define y1 Y1 const int mxn=2e3+10; const int mxe=1e5+10; const int mod=1e9+7; const int Mnf=1e18; const int Inf=-1e18; using namespace std; int x1,y1,x2,y2,x3,y3; void solve(){ cin>>x1>>y1>>x2>>y2>>x3>>y3; if(x1!=x2&&y1!=y2){ cout<<abs(x2-x1)+abs(y2-y1)<<'\n'; }else if(x1!=x2&&y1==y2){ if(y1==y3&&x3>=min(x1,x2)&&x3<=max(x1,x2)) cout<<abs(x2-x1)+2<<'\n'; else cout<<abs(x2-x1)+abs(y2-y1)<<'\n'; }else if(x1==x2&&y1!=y2){ if(x3==x1&&y3>=min(y1,y2)&&y3<=max(y1,y2)) cout<<abs(y2-y1)+2<<'\n'; else cout<<abs(x2-x1)+abs(y2-y1)<<'\n'; }else{ cout<<0<<'\n'; } } signed main(){ ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int __=1;cin>>__; while(__--)solve();return 0; } B. Alphabetical Strings and C. Pair Programming [(61条消息) 【双指针合并序列】CF731div3 B C\_lamentropetion的博客-CSDN博客][61_ _CF731div3 B C_lamentropetion_-CSDN] D. Co-growing Sequence [(61条消息) 【bitmask】CF731div3 D\_lamentropetion的博客-CSDN博客][61_ _bitmask_CF731div3 D_lamentropetion_-CSDN] E. Air Conditioners [(61条消息) 【前后缀DP】CF731div3 E\_lamentropetion的博客-CSDN博客][61_ _DP_CF731div3 E_lamentropetion_-CSDN] F. Array Stabilization (GCD version) [(61条消息) 【GCD可交性】CF731div3 F\_lamentropetion的博客-CSDN博客][61_ _GCD_CF731div3 F_lamentropetion_-CSDN] [2af077fd2c7a6f7e1123533c756a4dc7.png]: https://image.dandelioncloud.cn/pgy_files/images/2024/03/27/df9654d89320405799ef26d8301c3dfe.png [Dashboard - Codeforces Round _731 _Div. 3_ - Codeforces]: https://codeforces.com/contest/1547 [Problem - A - Codeforces]: https://codeforces.com/contest/1547/problem/A [61_ _CF731div3 B C_lamentropetion_-CSDN]: https://blog.csdn.net/weixin_62528401/article/details/128895386 [61_ _bitmask_CF731div3 D_lamentropetion_-CSDN]: https://blog.csdn.net/weixin_62528401/article/details/128908156 [61_ _DP_CF731div3 E_lamentropetion_-CSDN]: https://blog.csdn.net/weixin_62528401/article/details/128908410 [61_ _GCD_CF731div3 F_lamentropetion_-CSDN]: https://blog.csdn.net/weixin_62528401/article/details/128908677
还没有评论,来说两句吧...