ZlycerQan和Myj大佬的NOIP模拟赛
来源:互联网 发布:linux删除用户及目录 编辑:程序博客网 时间:2024/06/05 23:07
题目来自:ZlycerQan和Myj大佬
T1
#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>using namespace std;#define LL long longint a[10000010<<1],b[10000010<<1],c[10000010<<1];LL ans=0;inline void read(int &x){ x=0; int f=1; char c=getchar(); while(c>'9'||c<'0'){ if(c=='-') f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=x*10+c-'0'; c=getchar(); } x*=f;}int main(){ freopen("section.in","r",stdin); freopen("section.out","w",stdout); int x,n,d,m; read(n),read(d); for(int i=1;i<=n;++i){ read(x); if(x==d) m=0; else if(x<d) m=-1; else if(x>d) m=1; c[i]+=c[i-1]+m; if(c[i]==0&&(i&1)) ++ans; if(i&1) ans+=a[c[i]+n],++b[c[i]+n]; else if(!(i&1)) ans+=b[c[i]+n],++a[c[i]+n]; } printf("%I64d\n",ans); fclose(stdin);fclose(stdout); return 0;}
T2
#include<iostream>#include<cstring>#include<cstdio>#include<cstdlib>#include<algorithm>#include<ctime>#include<map>using namespace std;map<long long,bool> mp;int a[105],b[105],n,ans;long long sum;void DFS(int now,long long sum){ if(now==n+1){ if(!mp[sum]) ++ans,mp[sum]=1; return ; } if(clock()>5700){ printf("%I64d\n",ans); fclose(stdin),fclose(stdout); exit(0); } for(int j=a[now];j<=b[now];++j) DFS(now+1,sum+j*j);}int main(){ freopen("kinds.in","r",stdin); freopen("kinds.out","w",stdout); scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d %d",&a[i],&b[i]); DFS(1,0); printf("%I64d\n",ans); fclose(stdin); fclose(stdout); return 0;}
T3
#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>using namespace std;#define MAXN 2005double sumc,ans=0;int n,x,y,k,v[MAXN],c[MAXN];void read(int &x){ x=0; int f=1; char c=getchar(); while(c>'9'||c<'0'){ if(c=='-') f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=x*10+c-'0'; c=getchar(); } x*=f;}int main(){ freopen("yuuka.in","r",stdin); freopen("yuuka.out","w",stdout); read(n); for(int i=1;i<=n;++i) read(x),read(y),read(v[i]),read(c[i]),sumc+=c[i]; read(k); for(int i=1;i<=n;++i) ans+=(v[i]*sumc/(n*1.0)); printf("%.3lf\n",ans); fclose(stdin);fclose(stdout); return 0;}
阅读全文
0 0
- ZlycerQan和Myj大佬的NOIP模拟赛
- #NOIP模拟赛bzoj3449#大佬(期望好题)
- 20151004的NOIP模拟赛
- 20151005的NOIP模拟赛
- 20151006的NOIP模拟赛
- 20151007的NOIP模拟赛
- 20151017的NOIP模拟赛
- 20151024的NOIP模拟赛
- 20151031的NOIP模拟赛
- ZlycerQan的 八云蓝(ran )
- 【noip模拟赛】球的序列
- 2015.10.31的NOIP模拟赛
- 【数论】[NOIP模拟赛]无聊的计算
- 【贪心】[NOIP模拟赛]奇怪的队列
- [NOIP模拟赛]大整数的幂
- [NOIP模拟赛]保证的利润
- 计蒜客NOIP模拟赛 直线的交点
- noip模拟赛 双城记
- 三 无限轮播 无原点
- YOLO9000算法详解
- MyEclipse实现库表数据增删改查
- https的加密方式 介绍 + 常见的加密技术
- SAP物料标准成本估算表
- ZlycerQan和Myj大佬的NOIP模拟赛
- C#基本语法
- 编程中遇到的一些问题及解决方案
- 让ubuntu开机快一点:记开机出现Waiting for network configuration…
- LUNA再次夺冠,科大讯飞向世界宣告自己的实力不止于语音
- Android_无线自动轮播
- 斗地主之动态评估
- iOS 怎么在旧工程里采用cocoapods
- 开发模式