# 2020hdu多校8

hdu6857

#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;

void init()
{

}
void solve()
{
ll a,b,c,d,e,f;
cin>>a>>b>>c>>d>>e>>f;
if((c-a)*(f-b)-(d-b)*(e-a)>0)
{
cout<<"Counterclockwise"<<endl;
}
else
{
cout<<"Clockwise"<<endl;
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int _=1;
cin>>_;
while(_--)
{
init();
solve();
}
return 0;
}



hdu6860

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
vector <pair<ll,ll> >vv;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int T;
cin>>T;
while(T--)
{
int flag=0;
vv.clear();
ll n,k;
cin>>n>>k;
for(int i=1;i<=n;i++)
{
if(i==1)
{
int x,y;
cin>>x>>y;
vv.push_back({x,y});
continue;
}
ll x,y;
cin>>x>>y;
ll l=vv[vv.size()-1].first;
ll r=vv[vv.size()-1].second;
l=max(l-k,x);
r=min(r+k,y);
if(l>r)
{
flag=1;
}
vv.push_back({l,r});
}
for(int i=vv.size()-2;i>=0;i--)
{
ll l=vv[i+1].first;
ll r=vv[i+1].second;
ll L=vv[i].first;
ll R=vv[i].second;
L=max(l-k,L);
R=min(R,r+k);
vv[i].first=L;
vv[i].second=R;
}
if(flag)
{
cout<<"NO"<<"\n";
continue;
}
cout<<"YES"<<"\n";
for(int i=0;i<vv.size();i++)
{
cout<<vv[i].first<<" ";
}
cout<<"\n";
}
return 0;
}


hdu6862

#include <iostream>

using namespace std;
string dp[505];
void init()
{
dp[1]="";
dp[2]="321653";
for(int i=3;i<505;i++)
{
dp[i]="1";
for(int j=1;j<=i-2;j++)
{
dp[i]+="26";
}
dp[i]+="2";
for(int j=1;j<=i-2;j++)
{
dp[i]+="31";
}
dp[i]+="3";
for(int j=1;j<=i-2;j++)
{
dp[i]+="42";
}
dp[i]+="4";
for(int j=1;j<=i-2;j++)
{
dp[i]+="53";
}
dp[i]+="5";
for(int j=1;j<=i-2;j++)
{
dp[i]+="64";
}
dp[i]+="6";
for(int j=1;j<=i-3;j++)
{
dp[i]+="15";
}
dp[i]+="12";
dp[i]+=dp[i-2];
}
}

int main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
init();
int T;
cin>>T;
while(T--)
{
int n;
cin>>n;
cout<<dp[n]<<"\n";
}
return 0;
}


hdu6863

#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const int INF=1e9+5;
const int maxn=5e6+5;
const int mod=7000061;
const int base=131;
ll B[maxn];
int aa[26];
string s;
int n;
int cnt[mod+5];
int index=0;
bool init(int len)
{
index++;
ll p=0;
for(int i=0;i<len;i++)
{
p=(p*base%mod+(s[i]-'a'+1))%mod;
}
cnt[p]=index;
for(int i=1;i<len;i++)
{
ll q=(p+mod-1ll*(s[i-1]-'a'+1)*B[len-1]%mod)%mod;
q=(q*base%mod+(s[i-1]-'a'+1))%mod;
p=q;
cnt[p]=index;
}
for(int i=1;i<n/len;i++)
{
ll q=0;
for(int j=i*len;j<(i+1)*len;j++)
{
q=(q*base%mod+(s[j]-'a'+1))%mod;
}
if(cnt[q]!=index)
return false;
}
return true;
}
void solve()
{
int flag=0;
cin>>n>>s;
int min_=INF;
for(int i=0;i<n;i++)
{
aa[s[i]-97]++;
}
for(int i=0;i<26;i++)
{
if(aa[i]!=0)
if(aa[i]<min_)
min_=aa[i];
}
for(int i=1;i<=min(min_,(int)sqrt(n));i++)
{
if(n%i!=0)
continue;
if(i==n)
continue;
if(init(i))
{
flag=1;
break;
}
int f=n/i;
if(f==n)
continue;
if(n%f!=0)
continue;
if(init(f))
{
flag=1;
break;
}
}
if(flag)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
B[0]=1;
for(int i=1;i<maxn;i++)
{
B[i]=B[i-1]*base%mod;
}
int _=1;
cin>>_;
while(_--)
{
memset(aa,0,sizeof(aa));
solve();
}
return 0;
}



07-24 95
09-01 794
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客