C 暂时还不对

  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. #define MOD 1000000007
  8. typedef long long ll;
  9.  
  10. int jie[];
  11.  
  12. void jiecheng1(){
  13. ll jiech=;
  14. for(ll i=;i<=;i++){
  15. jiech*=i;
  16. jiech%=MOD;
  17. jie[i]=jiech;
  18. }
  19. }
  20.  
  21. ll jiecheng(ll aa){
  22. return jie[aa];
  23.  
  24. }
  25.  
  26. ll cal(int T,int Y){
  27. if(T%==||Y%==){
  28. return ;
  29. }
  30. ll n,m;
  31. n=T;
  32. m=(T-Y)/;
  33. return (jiecheng(n)%MOD)/( ((jiecheng(m)%MOD)*(jiecheng(n-m)%MOD))%MOD );
  34. }
  35.  
  36. int distan(int a,int b){
  37. if(a>b){
  38. return a-b;
  39. }else{
  40. return b-a;
  41. }
  42. }
  43.  
  44. int main()
  45. {
  46. int n,T,w;
  47. int xi,ci;
  48. ll result=;
  49. jiecheng1();
  50. while(~scanf("%d %d %d",&n,&T,&w)){
  51. result=;
  52. for(int i=;i<n;i++){
  53. scanf("%d %d",&xi,&ci);
  54. if(T==distan(xi,w)){
  55. result+=ci;
  56. }else if(T>(int)abs(xi-w)){
  57. result+=cal(T,distan(xi,w))*ci%MOD;
  58. }
  59. }
  60. result%=MOD;
  61. printf("%lld\n",result);
  62.  
  63. }
  64. return ;
  65. }

F 暂时不对

  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double a,b,c;
  9. int n;
  10. double x,x1,x2;
  11. while(cin>>n){
  12. while(n--){
  13. cin>>a>>b>>c;
  14. if(a==&&b==){
  15. if(c==)
  16. cout<<"NO"<<endl;
  17. else
  18. cout<<"YES"<<endl;
  19. continue;
  20. }
  21. if(a==){
  22. x=(c*-1.0)/b;
  23. if(x==(int)x)
  24. cout<<"YES"<<endl;
  25. else
  26. cout<<"NO"<<endl;
  27. continue;
  28. }
  29. x=(b*b-*a*c);
  30. if(x<){
  31. cout<<"YES"<<endl;
  32. continue;
  33. }
  34. x=sqrt(x);
  35. x1=(b*-+x)/2.0*a;
  36. x2=(b*--x)/2.0*a;
  37. if(x1==(int)x1||x2==(int)x2)
  38. cout<<"YES"<<endl;
  39. else
  40. cout<<"NO"<<endl;
  41. }
  42.  
  43. }
  44. return ;
  45. }

G

  1. package G;
  2.  
  3. import java.math.BigInteger;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7. public static void main(String[] args) {
  8. int n,m;
  9. int MOD=1000000007;
  10. Scanner sc=new Scanner(System.in);
  11. while(sc.hasNext()){
  12. BigInteger iii=new BigInteger("1");
  13. BigInteger eve=new BigInteger("0");
  14. BigInteger res=new BigInteger("0");
  15. n=sc.nextInt();
  16. m=sc.nextInt();
  17. for(int i=1;i<=n;i++){
  18. iii=iii.valueOf(i);
  19. eve=iii.pow(m).mod(BigInteger.valueOf(MOD));
  20. res=res.add(eve);
  21. res=res.mod(BigInteger.valueOf(MOD));
  22. }
  23. System.out.println(res.toString());
  24. }
  25.  
  26. }
  27. }

J

  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. struct Goods{
  7. int val,cnt;
  8. }a[];
  9.  
  10. int cmp(Goods x,Goods y){
  11. return x.val<y.val;
  12. }
  13.  
  14. int main()
  15. {
  16. int n, num, cnt;
  17. long long sum;
  18.  
  19. while(cin>>n){
  20. for(int i=;i<n;i++){
  21. cin>>a[i].val;
  22. }
  23. for(int i=;i<n;i++){
  24. cin>>a[i].cnt;
  25. }
  26. sort(a,a+n,cmp);
  27.  
  28. sum = num = ;
  29. while(a[num].val < ){
  30. num ++;
  31. }
  32. for(int i=num;i<n;i++){
  33. sum += a[i].val * a[i].cnt;
  34. }
  35. num--;
  36. cnt = ;
  37.  
  38. while(a[num].val + sum > && num >= ){
  39. if(cnt == ){
  40. cnt = a[num].cnt - ;
  41. } else {
  42. cnt--;
  43. }
  44. if(cnt == ){
  45. num--;
  46. }
  47. sum += a[num].val;
  48. }
  49.  
  50. if(cnt == ) num++;
  51. else a[num].cnt = cnt;
  52.  
  53. sum = ;
  54. for(int i=; num < n; i++){
  55. sum += a[num].val * i;
  56. a[num].cnt--;
  57. if(a[num].cnt == ) num++;
  58. }
  59.  
  60. cout<<sum<<endl;
  61. }
  62.  
  63. return ;
  64. }

K

  1. #include <iostream>
  2. #include <cstring>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. long long f[];
  8.  
  9. struct node{
  10. int a,d,c;
  11. double f;
  12. };
  13. node sc[];
  14.  
  15. int cmp(node x,node y){
  16. return x.f>y.f;
  17. }
  18. int main()
  19. {
  20. int n,T;
  21. while(cin>>n>>T){
  22. for(int i=;i<n;i++)
  23. cin>>sc[i].a;
  24. for(int i=;i<n;i++)
  25. cin>>sc[i].d;
  26. for(int i=;i<n;i++){
  27. cin>>sc[i].c;
  28. sc[i].f=(sc[i].d*1.0)/sc[i].c;
  29. }
  30. sort(sc,sc+n,cmp);
  31. memset(f,,sizeof(f));
  32. long long maxx=;
  33. for(int i=;i<n;i++){
  34. for(int j=T;j>=sc[i].c;j--){
  35. f[j]=max(f[j],f[j-sc[i].c]+max(sc[i].a-sc[i].d*j,));
  36. maxx=max(maxx,f[j]);
  37. }
  38. }
  39. cout<<maxx<<endl;
  40. }
  41. return ;
  42. }

山东省第八届ACM大学生程序设计竞赛的更多相关文章

  1. Alice and Bob(2013年山东省第四届ACM大学生程序设计竞赛)

    Alice and Bob Time Limit: 1000ms   Memory limit: 65536K 题目描述 Alice and Bob like playing games very m ...

  2. 2013年山东省第四届ACM大学生程序设计竞赛-最后一道大水题:Contest Print Server

    点击打开链接 2226: Contest Print Server Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 53  Solved: 18 [Su ...

  3. 山东省第四届ACM大学生程序设计竞赛解题报告(部分)

    2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/ 一.第J题坑爹大水题,模拟一下就行了 J:Contes ...

  4. [2012山东省第三届ACM大学生程序设计竞赛]——n a^o7 !

    n a^o7 ! 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2413 Time Lim ...

  5. angry_birds_again_and_again(2014年山东省第五届ACM大学生程序设计竞赛A题)

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2877 题目描述 The problems ca ...

  6. sdut Mountain Subsequences 2013年山东省第四届ACM大学生程序设计竞赛

    Mountain Subsequences 题目描述 Coco is a beautiful ACMer girl living in a very beautiful mountain. There ...

  7. [2012山东省第三届ACM大学生程序设计竞赛]——Mine Number

    Mine Number 题目:http://acm.sdut.edu.cn/sdutoj/problem.php? action=showproblem&problemid=2410 Time ...

  8. 2013年山东省第四届ACM大学生程序设计竞赛J题:Contest Print Server

    题目描述     In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code ...

  9. 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 ...

随机推荐

  1. springboot + websocket + spring-messaging实现服务器向浏览器广播式

    目录结构 pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// ...

  2. BLEU (Bilingual Evaluation Understudy)

    什么是BLEU? BLEU (Bilingual Evaluation Understudy) is an algorithm for evaluating the quality of text w ...

  3. Go语言栈定义及相关方法实现

    // stack 栈 package Algorithm import ( "errors" "reflect" ) // 栈定义 type Stack str ...

  4. 【问题与解决】showModalDialog is not defined 的解决方案

    背景: showModalDialog 是比较老的方法了,有些浏览器不再支持弹出模态窗口了. 比如说谷歌浏览就不再支持了,有文章说明如下: Chrome’s Lack of Support for s ...

  5. 基于netty实现的长连接,心跳机制及重连机制

    技术:maven3.0.5 + netty4.1.33 + jdk1.8   概述 Netty是由JBOSS提供的一个java开源框架.Netty提供异步的.事件驱动的网络应用程序框架和工具,用以快速 ...

  6. 【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 ...

  7. “5W1H”带你来学习JavaScript

    上次的设计模式讲课,从中学习到了非常多.不仅是技术上,更重要的是怎样来学习.我们学习的技术.科技的更新速度超过我们的想象,对于我们这个有生命年限的个体,怎样可以在有生之年可以让自己立足于科技的不败浪潮 ...

  8. 创建一个Django项目的基本步骤

    创建一个Django 的常规步骤 1.寻找一个磁盘目录,比如 e: 2.django-admin startproject ops 3.cd ops 4.python manage.py starta ...

  9. CentOS 7下升级Python版本到3.x系列

    由于python官方已宣布2.x系列即将停止支持,为了向前看,我们升级系统的python版本为3.x系列服务器系统为当前最新的CentOS 7.4 1.安装前查看当前系统下的python版本号 # p ...

  10. 使用nginx搭建rtmp服务器

    一.软件需求 1.nginx源码包  下载地址:http://nginx.org/.笔者下载的是1.10.3. 2.pcre源码包.这是一个正则表达式库.nginx会用到这个开源库来做正则匹配.很多软 ...