#define inf 0x7fffffff#define ll long long#define int long long//#define double long double#define eps 1e-8//#define mod 1e9+7``using nam_caddi programmi">
赞
踩
#pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include <bits/stdc++.h> #define inf 0x7fffffff #define ll long long #define int long long //#define double long double #define eps 1e-8 //#define mod 1e9+7`` using namespace std; const int mod=1e9+7; const int M=2e3+5; const int N=2*1e5+5;//?????????? 4e8 double n,m; signed main() { // ios::sync_with_stdio(false); cin>>n>>m; m=n-m; printf("%.3lf",100.0*m/n); return 0; }
#pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include <bits/stdc++.h> #define inf 0x7fffffff #define ll long long //#define int long long //#define double long double #define eps 1e-8 //#define mod 1e9+7 using namespace std; const int mod=1e9+7; const int M=2e3+5; const int N=2*1e5+5;//?????????? 4e8 int x,y,z; int n; int ans=1<<30; signed main() { // ios::sync_with_stdio(false); cin>>n; while(n--) { scanf("%d%d%d",&x,&y,&z); if(z>x) ans=min(ans,y); } if(ans!=1<<30) printf("%d\n",ans); else puts("-1"); return 0; }
#pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include <bits/stdc++.h> #define inf 0x7fffffff #define ll long long #define int long long //#define double long double #define eps 1e-8 //#define mod 1e9+7 using namespace std; const int mod=1e9+7; const int M=2e3+5; const int N=2*1e5+5;//?????????? 4e8 int n,m; int prime[N],v[N]; int ans; map < int , bool > mp; signed main() { // ios::sync_with_stdio(false); cin>>n; m=sqrt(n); for(int i=1;i<=m;i++) { if(mp[i]) continue; int j=i; mp[i]=1; if(i==1) continue; while(j<=n) { j=i*j; if(j>n) break; ans++; mp[j]=1; } } cout<<n-ans; return 0; }
#pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include <bits/stdc++.h> #define inf 0x7fffffff #define ll long long #define int long long //#define double long double #define eps 1e-8 //#define mod 1e9+7 using namespace std; const int mod=1e9+7; const int M=2e3+5; const int N=2*1e5+5;//?????????? 4e8 int n; int c1,c2; int cnt1,cnt2; string s1,s2; int v1[15],v2[15]; int sum1,sum2; int use[15]; int power(int a,int b) { int sum=1; while(b) { if(b&1) sum=sum*a; a=a*a; b>>=1; } return sum; } signed main() { // ios::sync_with_stdio(false); cin>>n; cin>>s1>>s2; for(int i=0;i<4;i++) v1[s1[i]-'0']++,v2[s2[i]-'0']++; for(int i=1;i<=9;i++) use[i]=n-v1[i]-v2[i]; for(int i=1;i<=9;i++) { sum1+=i*power(10,v1[i]); sum2+=i*power(10,v2[i]); } for(int i=1;i<=9;i++) { int temp=sum1; if(!use[i]) continue; sum1-=i*power(10,v1[i]); sum1+=i*power(10,v1[i]+1); for(int j=1;j<=9;j++) { int t=sum2; if(!use[j]) continue; sum2-=j*power(10,v2[j]); sum2+=j*power(10,v2[j]+1); if(sum1>sum2) { if(i!=j) c1+=use[i]*use[j]; else c1+=max((int)0,use[i]*(use[j]-1)); } sum2=t; } sum1=temp; } printf("%.7lf\n",(double)((double)c1/((double)((9*n-8)*(9*n-9))))); return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。