山东省第八届ACM大学生程序设计竞赛
C 暂时还不对
- #include <iostream>
- #include <cstdio>
- #include <cmath>
- using namespace std;
- #define MOD 1000000007
- typedef long long ll;
- int jie[];
- void jiecheng1(){
- ll jiech=;
- for(ll i=;i<=;i++){
- jiech*=i;
- jiech%=MOD;
- jie[i]=jiech;
- }
- }
- ll jiecheng(ll aa){
- return jie[aa];
- }
- ll cal(int T,int Y){
- if(T%==||Y%==){
- return ;
- }
- ll n,m;
- n=T;
- m=(T-Y)/;
- return (jiecheng(n)%MOD)/( ((jiecheng(m)%MOD)*(jiecheng(n-m)%MOD))%MOD );
- }
- int distan(int a,int b){
- if(a>b){
- return a-b;
- }else{
- return b-a;
- }
- }
- int main()
- {
- int n,T,w;
- int xi,ci;
- ll result=;
- jiecheng1();
- while(~scanf("%d %d %d",&n,&T,&w)){
- result=;
- for(int i=;i<n;i++){
- scanf("%d %d",&xi,&ci);
- if(T==distan(xi,w)){
- result+=ci;
- }else if(T>(int)abs(xi-w)){
- result+=cal(T,distan(xi,w))*ci%MOD;
- }
- }
- result%=MOD;
- printf("%lld\n",result);
- }
- return ;
- }
F 暂时不对
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- double a,b,c;
- int n;
- double x,x1,x2;
- while(cin>>n){
- while(n--){
- cin>>a>>b>>c;
- if(a==&&b==){
- if(c==)
- cout<<"NO"<<endl;
- else
- cout<<"YES"<<endl;
- continue;
- }
- if(a==){
- x=(c*-1.0)/b;
- if(x==(int)x)
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- continue;
- }
- x=(b*b-*a*c);
- if(x<){
- cout<<"YES"<<endl;
- continue;
- }
- x=sqrt(x);
- x1=(b*-+x)/2.0*a;
- x2=(b*--x)/2.0*a;
- if(x1==(int)x1||x2==(int)x2)
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- }
- }
- return ;
- }
G
- package G;
- import java.math.BigInteger;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- int n,m;
- int MOD=1000000007;
- Scanner sc=new Scanner(System.in);
- while(sc.hasNext()){
- BigInteger iii=new BigInteger("1");
- BigInteger eve=new BigInteger("0");
- BigInteger res=new BigInteger("0");
- n=sc.nextInt();
- m=sc.nextInt();
- for(int i=1;i<=n;i++){
- iii=iii.valueOf(i);
- eve=iii.pow(m).mod(BigInteger.valueOf(MOD));
- res=res.add(eve);
- res=res.mod(BigInteger.valueOf(MOD));
- }
- System.out.println(res.toString());
- }
- }
- }
J
- #include <iostream>
- #include <algorithm>
- using namespace std;
- struct Goods{
- int val,cnt;
- }a[];
- int cmp(Goods x,Goods y){
- return x.val<y.val;
- }
- int main()
- {
- int n, num, cnt;
- long long sum;
- while(cin>>n){
- for(int i=;i<n;i++){
- cin>>a[i].val;
- }
- for(int i=;i<n;i++){
- cin>>a[i].cnt;
- }
- sort(a,a+n,cmp);
- sum = num = ;
- while(a[num].val < ){
- num ++;
- }
- for(int i=num;i<n;i++){
- sum += a[i].val * a[i].cnt;
- }
- num--;
- cnt = ;
- while(a[num].val + sum > && num >= ){
- if(cnt == ){
- cnt = a[num].cnt - ;
- } else {
- cnt--;
- }
- if(cnt == ){
- num--;
- }
- sum += a[num].val;
- }
- if(cnt == ) num++;
- else a[num].cnt = cnt;
- sum = ;
- for(int i=; num < n; i++){
- sum += a[num].val * i;
- a[num].cnt--;
- if(a[num].cnt == ) num++;
- }
- cout<<sum<<endl;
- }
- return ;
- }
K
- #include <iostream>
- #include <cstring>
- #include <algorithm>
- using namespace std;
- long long f[];
- struct node{
- int a,d,c;
- double f;
- };
- node sc[];
- int cmp(node x,node y){
- return x.f>y.f;
- }
- int main()
- {
- int n,T;
- while(cin>>n>>T){
- for(int i=;i<n;i++)
- cin>>sc[i].a;
- for(int i=;i<n;i++)
- cin>>sc[i].d;
- for(int i=;i<n;i++){
- cin>>sc[i].c;
- sc[i].f=(sc[i].d*1.0)/sc[i].c;
- }
- sort(sc,sc+n,cmp);
- memset(f,,sizeof(f));
- long long maxx=;
- for(int i=;i<n;i++){
- for(int j=T;j>=sc[i].c;j--){
- f[j]=max(f[j],f[j-sc[i].c]+max(sc[i].a-sc[i].d*j,));
- maxx=max(maxx,f[j]);
- }
- }
- cout<<maxx<<endl;
- }
- return ;
- }
山东省第八届ACM大学生程序设计竞赛的更多相关文章
- Alice and Bob(2013年山东省第四届ACM大学生程序设计竞赛)
Alice and Bob Time Limit: 1000ms Memory limit: 65536K 题目描述 Alice and Bob like playing games very m ...
- 2013年山东省第四届ACM大学生程序设计竞赛-最后一道大水题:Contest Print Server
点击打开链接 2226: Contest Print Server Time Limit: 1 Sec Memory Limit: 128 MB Submit: 53 Solved: 18 [Su ...
- 山东省第四届ACM大学生程序设计竞赛解题报告(部分)
2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contes ...
- [2012山东省第三届ACM大学生程序设计竞赛]——n a^o7 !
n a^o7 ! 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2413 Time Lim ...
- angry_birds_again_and_again(2014年山东省第五届ACM大学生程序设计竞赛A题)
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877 题目描述 The problems ca ...
- sdut Mountain Subsequences 2013年山东省第四届ACM大学生程序设计竞赛
Mountain Subsequences 题目描述 Coco is a beautiful ACMer girl living in a very beautiful mountain. There ...
- [2012山东省第三届ACM大学生程序设计竞赛]——Mine Number
Mine Number 题目:http://acm.sdut.edu.cn/sdutoj/problem.php? action=showproblem&problemid=2410 Time ...
- 2013年山东省第四届ACM大学生程序设计竞赛J题:Contest Print Server
题目描述 In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code ...
- 2012年"浪潮杯"山东省第三届ACM大学生程序设计竞赛--n a^o7 ! 分类: 比赛 2015-06-09 17:16 14人阅读 评论(0) 收藏
n a^o7 ! Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 All brave and intelligent fighte ...
随机推荐
- springboot + websocket + spring-messaging实现服务器向浏览器广播式
目录结构 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// ...
- BLEU (Bilingual Evaluation Understudy)
什么是BLEU? BLEU (Bilingual Evaluation Understudy) is an algorithm for evaluating the quality of text w ...
- Go语言栈定义及相关方法实现
// stack 栈 package Algorithm import ( "errors" "reflect" ) // 栈定义 type Stack str ...
- 【问题与解决】showModalDialog is not defined 的解决方案
背景: showModalDialog 是比较老的方法了,有些浏览器不再支持弹出模态窗口了. 比如说谷歌浏览就不再支持了,有文章说明如下: Chrome’s Lack of Support for s ...
- 基于netty实现的长连接,心跳机制及重连机制
技术:maven3.0.5 + netty4.1.33 + jdk1.8 概述 Netty是由JBOSS提供的一个java开源框架.Netty提供异步的.事件驱动的网络应用程序框架和工具,用以快速 ...
- 【Tensorflow】Tensorflow r1.0, Ubuntu, gpu, conda安装说明
Install Anaconda and python 1. cuda-8.0 download cuda_8.0.61_375.26_linux.run ./cuda_8.0.61_375.26_l ...
- “5W1H”带你来学习JavaScript
上次的设计模式讲课,从中学习到了非常多.不仅是技术上,更重要的是怎样来学习.我们学习的技术.科技的更新速度超过我们的想象,对于我们这个有生命年限的个体,怎样可以在有生之年可以让自己立足于科技的不败浪潮 ...
- 创建一个Django项目的基本步骤
创建一个Django 的常规步骤 1.寻找一个磁盘目录,比如 e: 2.django-admin startproject ops 3.cd ops 4.python manage.py starta ...
- CentOS 7下升级Python版本到3.x系列
由于python官方已宣布2.x系列即将停止支持,为了向前看,我们升级系统的python版本为3.x系列服务器系统为当前最新的CentOS 7.4 1.安装前查看当前系统下的python版本号 # p ...
- 使用nginx搭建rtmp服务器
一.软件需求 1.nginx源码包 下载地址:http://nginx.org/.笔者下载的是1.10.3. 2.pcre源码包.这是一个正则表达式库.nginx会用到这个开源库来做正则匹配.很多软 ...