Testing Round #16 (Unrated)

B. Square?

 
题目链接:https://codeforces.ml/contest/1351/problem/B

    #include #define rush() int T;cin>>T;while(T--)#define go(a) while(cin>>a)#define ms(a,b) memset(a,b,sizeof a)#define E 1e-8using namespace std;typedef __int64 ll;const int idata=5e4+5;ll n,m,t,_;int i,j,k;int cnt,num,ans;int minn,maxx;stackstk;priority_queue,less >q;mapmp;ll a[idata];int main(){cin.tie(0);iostream::sync_with_stdio(false);rush(){int a,b,c,d;bool judge=0;cin>>a>>b>>c>>d;if(a>b) swap(a,b);if(c

 

C. Skier

 
题目链接:https://codeforces.ml/contest/1351/problem/C

 关于这个题,显然用数组是不科学的,内存太大,所以用map,当时也考虑了用pair,但是官方的提示

A path segment means an edge of length 1 meter between points.

并不知道 要怎么实现,所以最后只通过了样例

//我的代码
#include 
#define rush() int T;cin>>T;while(T--)
#define go(a) while(cin>>a)
#define ms(a,b) memset(a,b,sizeof a)
#define E 1e-8
using namespace std;
typedef __int64 ll;
const int idata=1e6+5;ll n,m,t,_;
int i,j,k;
int cnt,num,ans;
int minn,maxx;
stackstk;
priority_queue,less >q;
map,int>mp;
string s;int main()
{cin.tie(0);iostream::sync_with_stdio(false);rush(){cin>>s;mp.clear();//cout<

 

以下是 某位大佬的通过代码:

#include 
#define rush() int T;cin>>T;while(T--)
#define go(a) while(cin>>a)
#define ms(a,b) memset(a,b,sizeof a)
#define E 1e-8
using namespace std;
typedef __int64 ll;
const int idata=1e6+5;ll n,m,t,_;
int i,j,k;
int cnt,num,ans;
int minn,maxx;
map,int>mp,judge;
string s;int main()
{cin.tie(0);iostream::sync_with_stdio(false);rush(){cin>>s;mp.clear();judge.clear();int x=0,y=0;ll sum=0;mp[make_pair(x,y)]=1;int cnt=1,pre,now;for(i=0;i

 


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章