标签:ios ted bst sync sub codeforce 数学 gcd 题解
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long x,y,t;
cin>>t;
while(t--)
{
cin>>x>>y;
cout<<x<<" "<<x*2<<"\n";
}
}
#include <bits/stdc++.h>
using namespace std;
int bk[300],bk1[300],mk[300],p,sum;
long long ans;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long n,t1=0,t2=0;
cin>>n;
string a;
cin>>a;
for(int i=0;i<a.size();i++)
bk[a[i]-‘a‘]++;
for(int i=0;i<26;i++)
if(bk[i]>=2)
sum++,mk[p++]=i,bk1[i]++;
for(int i=0;i<a.size();i++)
if(a[i]==a[0])
t1++;
else
break;
for(int i=a.size()-1;i>=0;i--)
if(a[i]==a[a.size()-1])
t2++;
else
break;
if(a[0]==a[a.size()-1])
{
ans=(t1+1)*(t2+1);
ans%=998244353;
cout<<ans;
}
else
cout<<t1+t2+1;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
int ang;
cin>>ang;
int g=__gcd(ang,180);
int k=ang/g;
int n=180/g;
if(k+1==n)
k*=2,n*=2;
cout<<n<<"\n";
}
}
Educational Codeforces Round 57 (Rated for Div. 2) 前三个题补题
标签:ios ted bst sync sub codeforce 数学 gcd 题解
原文地址:https://www.cnblogs.com/baccano-acmer/p/10199099.html