#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0int n;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
if(n<=99) cout<<n;
else if(n<=199) cout<<n-20;
else cout<<n-70;
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
B3970
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0int n,k;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n>>k;
cout<<(n/1000%10%k)*1000+(n/100%10%k)*100+(n/10%10%k)*10+(n/1%10%k);
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
B3984
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int a,b;
cin>>a>>b;
cout<<((b-a)%2==0?(b-a)/2:(b-a)/2+1);
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
B4026
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a+b<c+d) cout<<"Yes";
else cout<<"No";
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
B4052
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int t,a,b,c,d;
cin>>t>>a>>b>>c>>d;
if(t==0) cout<<a+b;
else cout<<max(a-c,1ll*0)+max(b-d,1ll*0);
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
Orange
B3627
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int n;
cin>>n;
cout<<(int)cbrt(n);
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P2695
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0const int maxn=1e5+5;
int n,m,a[maxn],b[maxn],p=1,f,sum;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=m;i++) cin>>b[i];
sort(a+1,a+n+1);
sort(b+1,b+m+1);
for(int i=1;i<=m;i++){
if(b[i]>=a[p]) sum+=b[i],p++;
if(p==n+1){f=1;break;}
}
if(f==1) cout<<sum;
else cout<<"you died!";
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P3669
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0int n;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
vector<pair<int,int>>a(n);
for(int i=0;i<n;i++) cin>>a[i].second>>a[i].first;
sort(a.begin(),a.end());
int l=0,r=n-1,ans=0;
while(l<r){
if(a[l].second==0){l++;continue;}
if(a[r].second==0){r--;continue;}
int p=min(a[l].second,a[r].second);
ans=max(ans,a[l].first+a[r].first);
a[l].second-=p; a[r].second-=p;
}
cout<<ans;
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P4613
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0const int maxn=105;
int n,x[maxn],y[maxn],f=1;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++) cin>>x[i];
for(int i=1;i<=n;i++) cin>>y[i];
sort(x+1,x+n+1);
sort(y+1,y+n+1);
for(int i=1;i<=n;i++) if(x[i]>y[i]) f=0;
if(f==1) cout<<"DA\n";
else cout<<"NE\n";
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P7584
Yellow
B4379
P1551
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define You_are_a_brick return#define tied_to_me_that 0const int maxn=5005;
int n,m,p,fa[maxn];
int find(int x){
if(x==fa[x]) return x;
else return fa[x]=find(fa[x]);
}
signed main(){
cin>>n>>m>>p;
for(int i=1;i<=n;i++) fa[i]=i;
for(int i=1;i<=m;i++){
int a,b;
cin>>a>>b;
if(find(a)!=find(b)) fa[find(a)]=find(b);
}
for(int i=1;i<=p;i++){
int a,b;
cin>>a>>b;
if(find(a)!=find(b)) cout<<"No\n";
else cout<<"Yes\n";
}
You_are_a_brick tied_to_me_that;
}
//You are a brick tied to me that dragging me down.
P3916
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define You_are_a_brick return#define tied_to_me_that 0const int maxn=1e5+5;
int n,m,ans[maxn];
vector<int>G[maxn];
void dfs(int now,int x){
if(ans[x]) You_are_a_brick;
ans[x]=now;
for(auto op:G[x]) dfs(now,op);
}
signed main(){
cin>>n>>m;
for(int i=1;i<=m;i++){
int u,v;
cin>>u>>v;
G[v].push_back(u);
}
for(int i=n;i>=1;i--) dfs(i,i);
for(int i=1;i<=n;i++) cout<<ans[i]<<' ';
You_are_a_brick tied_to_me_that;
//You are a brick tied to me that dragging me down.
}
P12211
P12891
P10518
P16264
Green
P2041
C++
#include<bits/stdc++.h>using namespace std;
#define int long longsigned main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int n;
cin>>n;
if(n==1) cout<<"1\n1 1";
else if(n==2) cout<<"4\n1 1\n2 1\n2 2\n1 2";
else cout<<"-1";
return 0;
}
P7589
P9963
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0double n,p,l,r;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n>>p>>l>>r;
printf("%.7f",(r-l+1.0)*p*1.0);
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P10532
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int n;
cin>>n;
cout<<n*n;
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P15746
Blue
P1472
P1896
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0int n,k,cnt,s[1<<12],num[1<<12],f[12][144][1<<12];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n>>k;
for(int i=0;i<(1<<n);i++)
if(!(i&i>>1)){
s[cnt++]=i;
for(int j=0;j<n;j++)num[i]+=(i>>j&1);
}
f[0][0][0]=1;
for(int i=1;i<=n+1;i++)
for(int j=0;j<=k;j++)
for(int a=0;a<cnt;a++)
for(int b=0;b<cnt;b++){
int c=num[s[a]];
if((j>=c)&&!(s[b]&s[a])&&!(s[b]&(s[a]<<1))&&!(s[b]&(s[a]>>1))) f[i][j][a]+=f[i-1][j-c][b];
}
cout<<f[n+1][k][0];
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P2258
P3147
P4053
Purple
P2123
P3539
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0const int maxn=90;
int f[maxn+2],q;
void init(){
f[1]=1,f[2]=1;
for(int i=3;i<=maxn+1;i++) f[i]=f[i-1]+f[i-2];
}
int calc(int n){
int cnt=0;
while(n>0){
int p=lower_bound(f,f+maxn+2,n)-f;
if(f[p]==n){cnt++;break;}
n=min(n-f[p-1],f[p]-n);
cnt++;
}
Moonlight cnt;
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
init();
cin>>q;
while(q--){
int k;
cin>>k;
cout<<calc(k)<<'\n';
}
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/
P3773
C++
#include<bits/stdc++.h>using namespace std;
#define int long long#define Moonlight return#define whispers 0const int maxn=250000,mod=1000000007;
int n,f[maxn],ans=0,a;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++){
cin>>a;
for(int j=a&(a-1);j;j=(j-1)&a) f[j]=(f[j]+f[a]+1)%mod;
ans=(ans+f[a])%mod;
}
cout<<ans;
Moonlight whispers/*月光私语*/;
}
/*I frequently reminisce about the past,please,go back to the beginning望舒影里,碧落随星际,依记那年春光里,郁香予我情谊。本愿终生厮守,奈何苍天难求,郁香花开遍野,却见你的芳容。夏夜已逝,彼时蓝星。终有一日,星尘淬剑,长夜铮然开曙色;便倾我心,烛照山河,独向苍茫颂春秋。*/