第八次CCF考试记录

代码还不知道对不对,过两天出成绩。

成绩出来了,310分。

100+100+100+10+0;

考试13:27开始,17:30结束,提交第4题后不再答题,只是检查前四题的代码

第一次提交:
1 13:34
2 14:00左右
3 15:32
4 16:56
5

最后一次提交:
1 13:34
2 16:06
3 15:32
4 16:56
5

代码行数(不算空行,算无用的include,算注释掉的部分)
1 23
2 50
3 101
4 71
5
共 245 行

源代码:

1

 #include <iostream>
 #include<stdio.h>
 #include<string.h>
 #include<string>
 #include<stack>
 #include<vector>
 using namespace std;
 int main(int argc, char** argv) {
     int n;
     cin>>n;
     int * a=new int[n];
     ;i<n;i++){
         cin>>a[i];
     }
     ;
     ;i<n;i++){
         ];
         t=t>?t:-t;
         m=m<t?t:m;
     }
     cout<<m;
     ;
 }

2

 #include <iostream>
 #include<stdio.h>
 #include<string.h>
 #include<string>
 #include<stack>
 #include<vector>
 using namespace std;
 int main(int argc, char** argv) {
     ];
     ;i<;i++){
         a[i]=;
     }
     int n,t;
     cin>>n;
     ;i<n;i++){
         cin>>t;
         ;
         ;i<;i++){
             if(a[i]>=t){
                 ;j<t;j++){
                     cout<<i*+-a[i]+j+<<" ";
                 }
                 cout<<endl;
                 a[i]-=t;
                 flag=;
                 break;
             }
         }
         ){
             ;i<;i++){
                 ){
                     ;j<t;j++){
                         cout<<i*+-a[i]+j+<<" ";
                     }
                     a[i]-=t;
                     break;
                 }else{
                     ;j<a[i];j++){
                         cout<<i*+-a[i]+j+<<" ";
                     }
                     t-=a[i];
                     a[i]=;
                 }
             }
             cout<<endl;
         }
     }
     delete []a;
     ;
 }

3

 #include <iostream>
 #include<stdio.h>
 #include<string.h>
 #include<string>
 #include<stack>
 #include<vector>
 using namespace std;
 struct suicong{
     int hth;
     int att;
     suicong(int h,int a){
         hth=h;
         att=a;
     }
 };
 struct ying{
     int hth;
     int att;
     ying(){
         hth=;
         att=;
     }
 };
 int main(int argc, char** argv) {
     vector<suicong>* war=];
     //vector<suicong> war0;
     //vector<suicong> war1;
     //suicong* ying0=new suicong(30,0,1);
     //suicong* ying1=new suicong(30,0,1);
     ying ying[];
     //war[0].push_back(*ying0);
     //war[1].push_back(*ying1);
     int n;
     cin>>n;
     ;
     //int y[2];
     ;i<n;i++){
         string str;
         cin>>str;
         if(str=="summon"){
             int p,h,a;
             cin>>p>>a>>h;
             suicong* temp=new suicong(h,a);
             war[t].insert(war[t].begin()+p-,*temp);
         }
         if(str=="attack"){
             int d,a;
             cin>>a>>d;
             ){
                 ying[-t].hth-=war[t].at(a-).att;
                 war[t].at(a-).hth-=ying[-t].att;
                 ).hth<=){
                     war[t].erase(war[t].begin()+a-);
                 }
             }
             else{
                 //cout<<t<<" "<<war[t].size()<<" "<<war[1-t].size();
                 war[-t].at(d-).hth-=war[t].at(a-).att;
                 war[t].at(a-).hth-=war[-t].at(d-).att;
                 ).hth<=){
                     war[t].erase(war[t].begin()+a-);
                 }
                 -t].at(d-).hth<=){
                     war[-t].erase(war[-t].begin()+d-);
                 }
             }
         }
         if(str=="end"){
             t=-t;
         }
         /*cout<<0<<" "<<ying[0].hth<<" "<<war[0].size()<<" ";
         for(int i=0;i<war[0].size();i++){
             cout<<war[0].at(i).hth<<" ";
         }cout<<endl;
         cout<<1<<" "<<ying[1].hth<<" "<<war[1].size()<<" ";
         for(int i=0;i<war[1].size();i++){
             cout<<war[1].at(i).hth<<" ";
         }cout<<endl;*/
     }
     ].hth<=){
         cout<<-<<endl;
     }else
     ].hth<=){
         cout<<<<endl;
     }else{
         cout<<<<endl;
     }
     cout<<ying[].hth<<endl;
     cout<<war[].size()<<" ";
     ;i<war[].size();i++){
         cout<<war[].at(i).hth<<" ";
     }
     cout<<endl;
     cout<<ying[].hth<<endl;
     cout<<war[].size()<<" ";
     ;i<war[].size();i++){
         cout<<war[].at(i).hth<<" ";
     }
     cout<<endl;
     ;
 }

4

  此代码是错误的

 #include <iostream>
 #include<stdio.h>
 #include<string.h>
 #include<string>
 #include<stack>
 #include<vector>
 #include<queue>
 using namespace std;
 struct road{
     int to;
     int len;
     road(int t,int l){
         to=t;len=l;
     }
 };
 struct city{
     //int num;
     ;
     ;
     vector<road> v;
     void addroad(int t,int len){
         road* r=new road(t,len);
         v.push_back(*r);
     }
 };
 int get(city* cs,int i,int j){
     ;k<cs[i].v.size();k++){
         if(cs[i].v.at(k).to==j)return cs[i].v.at(k).len;
     }
     ;
 }
 int main(int argc, char** argv) {
     int n,m;
     cin>>n>>m;
     city* cs=];
     ;i<m;i++){
         int a,b,c;
         cin>>a>>b>>c;
         cs[a].addroad(b,c);
         cs[b].addroad(a,c);
     }
     cs[].tlen=;
     queue<int> q;
     q.push();
     while(!q.empty()){
         int t=q.front();
         q.pop();
         ;i<cs[t].v.size();i++){
             if(cs[cs[t].v.at(i).to].tlen>cs[t].tlen+cs[t].v.at(i).len){
                 cs[cs[t].v.at(i).to].tlen=cs[t].tlen+cs[t].v.at(i).len;
                 cs[cs[t].v.at(i).to].pre=t;
                 q.push(cs[t].v.at(i).to);
             }
             if(cs[cs[t].v.at(i).to].tlen==cs[t].tlen+cs[t].v.at(i).len){
                 if(get(cs,cs[cs[t].v.at(i).to].pre,cs[t].v.at(i).to)>cs[t].v.at(i).len){
                     cs[cs[t].v.at(i).to].tlen=cs[t].tlen+cs[t].v.at(i).len;
                     cs[cs[t].v.at(i).to].pre=t;
                     q.push(cs[t].v.at(i).to);
                 }
             }
         }
     }
 /*    for(int i=0;i<n+1;i++){
         cout<<i<<" "<<cs[i].pre<<" "<<get(cs,i,cs[i].pre)<<endl;
     }*/
     ;
     ;i<n+;i++){
         ll+=get(cs,i,cs[i].pre);
     }
     cout<<ll;
     ;
 }

2016.9.11 晚8:40

END

CCF考试的更多相关文章

  1. CCF考试真题题解

    CCF考试认证:题解参考博客http://blog.csdn.net/u014578266/article/details/45221841 问题描述 试题编号: - 试题名称: 图像旋转 时间限制: ...

  2. CCF考试认证模拟练习——数字排序

    #include<iostream>#include<algorithm>using namespace std;struct node //定义结构体{ int num;// ...

  3. CCF考前注意几点

    1.数组最好保持初始化习惯,且检查数组初始化在循环内还是循环外,若在循环内需要对数组进行处理,则数组初始化必须放在for循环内. 2.for循环保持好习惯,用括号括起来,以免粗心. 3.if条件判断要 ...

  4. Daily Scrum 12.14

    今日完成任务: 优化了问题页面显示问题的算法:两名开发人员有CCF考试,今天没有完成任务,任务顺延到明天. 明日任务: 黎柱金 解决资源显示全部为同一个PDF的BUG 晏旭瑞 资源搜索问题 孙思权 做 ...

  5. 201312月CCF-2,ISBN号码分析

    明天要考CCF啦,偶还是很紧张的.最近看了数据结构,今天才开始上机练习,对,我就是这么懒..废话不多说,我写这篇文章主要是分析CCF编程的小窍门,因为在网上没找到,所以我决定自力更生丰衣足食.!!!! ...

  6. CCF2014123集合竞价(C语言版)

    问题描述 某股票交易所请你编写一个程序,根据开盘前客户提交的订单来确定某特定股票的开盘价和开盘成交量. 该程序的输入由很多行构成,每一行为一条记录,记录可能有以下几种: 1. buy p s 表示一个 ...

  7. CCF计算机职业资格认证考试题解

    CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF计算机职业资格认证考试题解 CCF计算机软件能力认证(简称CCF CSP认证)是CCF计算机职业资格认证系 ...

  8. CCF CSP认证考试在线评测系统

    关于 CCF CSP 认证考试在线评测系统 CCF CSP 认证考试简介 CCF 是中国计算机学会的简称.CCF 计算机软件能力认证(简称 CCF CSP 认证考试)是 CCF 于 2014 年推出, ...

  9. CCF认证考试——折点计数

    描述:简单题 #include<iostream> using namespace std; int main() { ], n, count = ; cin >> n; ; ...

随机推荐

  1. Asp.net 面向接口可扩展框架之“Mvc扩展框架及DI”

    标题“Mvc扩展框架及DI”有点绕口,我也想不出好的命名,因为这个内容很杂,涉及多个模块,但在日常开发又密不可分 首先说Mvc扩展框架,该Mvc扩展就是把以前的那个Mvc分区扩展框架迁移过来,并优化整 ...

  2. 服务器Config文件不能查看的问题

      由于某种需求,需要从IIS发布的服务中下载扩展名为config的文件,但是发布文件后,在浏览器无法查看文件.根据反馈的的错误提示,大致说config属于配置文件,处于安全考虑,不能随便浏览. 如果 ...

  3. ASP.NET5,MVC 6,Beta 7与VS 2015 RTM的兼容问题

    温馨提示:本文杂而乱,最终不知所云. Visual Studio 2015 RTM已经于2015年7月20号正式发布,我也在第一时间下载安装了起来. 虽然在5月份就开始使用RC版本,但是还是很期待正式 ...

  4. Oracle取消用户连续登录失败次数限制

    当用户连续登录失败次数过多时,Oracle会锁定该用户,“FAILED_LOGIN_ATTEMPTS”用于设置最大次数,超过该值则锁定该帐号. 要取消用户连续登录失败次数的限制可以按照以下方法操作: ...

  5. Web 前端开发精华文章集锦(jQuery、HTML5、CSS3)【系列十七】

    <Web 前端开发精华文章推荐>2013年第五期(总第十七期)和大家见面了.梦想天空博客关注 前端开发 技术,分享各种增强网站用户体验的 jQuery 插件,展示前沿的 HTML5 和 C ...

  6. jQuery手机端触摸卡片切换效果

    效果:http://hovertree.com/code/run/jquery/a1gr3gm9.html 可以用手机查看效果. 代码如下: <!doctype html> <htm ...

  7. Html5绘制饼图统计图

    这里要介绍的是一个jQuery插件:jquery.easysector.js Html5提供了强大的绘图API,让我们能够使用javascript轻松绘制各种图形.本文将主要讲解使用HTML5绘制饼图 ...

  8. asp.net mvc 简易通用自定义Pager实现分页

    asp.net mvc 自定义Pager实现分页 Intro 一个WEB应用程序中经常会用到数据分页,本文将实现一个简单通用的分页组件,包含一个 PagerModel (用来保存页码信息),一个 Ht ...

  9. arcgis api for flex之专题图制作(饼状图,柱状图等)

    最近公司给我一个任务,就是利用arcgis api for flex实现在地图上点(业务数据)直接显示饼状图以及柱状图的专题图制作,而不是通过点击点显示气泡窗口的形式来实现,这个公司已经实现了. 经过 ...

  10. Objective-C 数据集合

    1.NSSet 1.是一个无序的,管理多个对象的集合类,最大特点 是集合中不允许出现重复对象,和数学上的集合含义是一 样的 2.除了无序.不许重复之外,其它功能和NSArray是一样的 2.NSArr ...