这周写过好多东西,虽然还没有完全弄明白线段树,但是progress还是有的!

不过有时候真的很想哭,因为自己的梦想连别人看看韩剧、无所事事还要分量轻,实在不明白政治课的Teamwork意义何在,花两分钟百度文库找了个PPT和论文扔给我就交差,你也不先看看这些专业术语你看不看得懂!!这周五开始我不上QQ了,为的就是不要有人以为我在线就说明我很空闲然后扔一坨事情给我做!(好吧这个博客不是用来吐槽生活的,回正轨)

上周六回家瞄了一眼Codeforces,发现15分钟后有一场比赛,不过我等级不够只能参加Round #233 div 2。半小时内把A和B给做了。然后…然后…C还没搞定,Codeforces就跪了,而且是长跪不起。(最后的结果是整个服务器倒退到三周前的备份,于是我还重新注册了个账号,#233 div 2的题目貌似也不见了?!)

A题 浏览器翻页界面的模拟

program cf__A;
var n,p,k,h,r,now:integer;
begin
readln(n,p,k);
h:=p-k;
if h< then h:=;
r:=p+k;
if r>n then r:=n;
if h> then write('<<');
for now:=h to r do
begin
if now= then
if now=p then write('(',p,')') else write(now)
else if now=p then write(' (',p,')') else write(' ',now);
end;
if r<n then write(' >>');
end.

CF_233_A

B题 按要求塞球,不过找找规律就知道其实是二进制转十进制…

program cf__B;
var s:array[..] of integer;
n,i:longint;
str:string;
two,ans:int64;
function check:boolean;
var i:integer;
begin
for i:= to n do
if s[i]= then exit(false);
exit(true);
end; begin
readln(n);
readln(str);
for i:= to n do
if str[i]='R' then s[i]:= else s[i]:=;
two:=;ans:=;
for i:= to n do
begin
if s[i]= then ans:=ans+two;
two:=two*;
end;
writeln(ans);
end.

CF_233_B

这场比赛的编号是#233,冥冥中注定了当晚的悲剧…

还有昨天上课码的mrzx,昨晚精神特别好,而且题目简单易懂,所以一个半小时4题~~\(≧▽≦)/~

mr442 潜望镜 模拟即可 话说注意坐标和m、n的关系,我就因为这个搞反调了20min

program mr442;
const dy:array[..] of integer=(,,,-);
dx:array[..] of integer=(-,,,);
var m,n,i,j,t:integer;
a:array[..,..] of char;
procedure solve(x,y,direct:integer);
begin
repeat
if a[x,y]='*' then
begin
x:=x+dx[direct];
y:=y+dy[direct];
end;
if a[x,y]='/' then
begin
if direct= then direct:= else
if direct= then direct:= else
if direct= then direct:= else
if direct= then direct:=;
x:=x+dx[direct];y:=y+dy[direct];
end;
if a[x,y]='\' then
begin
if direct= then direct:= else
if direct= then direct:= else
if direct= then direct:= else
if direct= then direct:=;
x:=x+dx[direct];y:=y+dy[direct];
end;
until not (a[x,y] in ['/','*','\']);
if x= then writeln(y);
if x=n+ then writeln(m+y);
if y= then writeln(*m+x);
if y=m+ then writeln(*m+n+x);
end; begin
assign(input,'mr442.in4');reset(input);
assign(output,'mr442.ou4');rewrite(output);
readln(n,m);
t:=n;n:=m;m:=t;
for i:= to n do
begin
for j:= to m do
read(a[i,j]);
readln;
end;
for i:= to m do solve(,i,);
for i:= to m do solve(n,i,);
for i:= to n do solve(i,,);
for i:= to n do solve(i,m,);
close(input);close(output);
end.

潜望镜

mr443 Anna取数 看上去难道是博弈论?我勒个擦最后是打表…

program mr443;
var f:array[..] of boolean;
n,i,t,min,max:longint; procedure solve(x:longint);
var t:integer;
begin
min:=;max:=;
while x> do
begin
t:=x mod ;
if t>max then max:=t;
if (t<min) and (t<>) then min:=t;
x:=x div ;
end;
end; procedure process;
var i:longint;
begin
for i:= to do f[i]:=true;
for i:= to do
begin
solve(i);
f[i]:=not (f[i-max] and f[i-min]);
end;
end; begin
assign(input,'mr443.in4');reset(input);
assign(output,'mr443.ou4');rewrite(output);
fillchar(f,sizeof(f),false);
process;
readln(n);
for i:= to n do
begin
readln(t);
if f[t]=true then writeln('YES') else writeln('NO');
end;
close(input);close(output);
end.

Anna取数

mr444 筷子 有点逗的题目,我都想到排序了怎么会没想到动归呢!话说看到什么差的平方和最小脑子偏到逆序对去了- =

program mr444;
var n,k,i,j:integer;
f:array[..,..] of integer;
ll:array[..] of integer;
function min(x,y:integer):integer;
begin
if x<y then exit(x) else exit(y);
end; procedure qsort(l,r:integer);
var mid,i,j,temp:integer;
begin
mid:=ll[(l+r) div ];
i:=l;j:=r;
repeat
while ll[i]<mid do inc(i);
while ll[j]>mid do dec(j);
if i<=j then
begin
temp:=ll[i];ll[i]:=ll[j];ll[j]:=temp;
inc(i);dec(j);
end;
until i>j;
if i<r then qsort(i,r);
if j>l then qsort(l,j);
end; begin
assign(input,'mr444.in0');reset(input);
assign(output,'mr444.ou0');rewrite(output);
readln(n,k);
if n<*(k+) then
begin
writeln('-1');
close(input);close(output);
halt;
end;
for i:= to n do
read(ll[i]);
qsort(,n);
k:=k+;
for i:= to n do
for j:= to min(i div ,k) do
begin
f[i,j]:=f[i-,j-]+sqr(ll[i]-ll[i-]);
if (j*<=i-) and (f[i,j]>f[i-,j]) then
f[i,j]:=f[i-,j];
end;
writeln(f[n,k]);
close(input);close(output);
end.

筷子

mr445 饲料槽 这个倒是被我一眼看出动归了,手推了一下还是一维的!话说后来翻了翻貌似在usaco精选里也有这个?我是按区间右端排序的,上课讲的是从后往前推的,其实没太大差别。

program mr445;
var f:array[..] of longint;
ql,qr:array[..] of longint;
b,n,i,t:longint;
procedure qsort(l,r:integer);
var mid,i,j,temp:longint;
begin
i:=l;j:=r;mid:=qr[(i+j) div ];
repeat
while qr[i]<mid do inc(i);
while qr[j]>mid do dec(j);
if i<=j then
begin
temp:=qr[i];qr[i]:=qr[j];qr[j]:=temp;
temp:=ql[i];ql[i]:=ql[j];ql[j]:=temp;
inc(i);dec(j);
end;
until i>j;
if i<r then qsort(i,r);
if j>l then qsort(l,j);
end; begin
assign(input,'mr445.in5');reset(input);
assign(output,'mr445.ou5');rewrite(output);
fillchar(f,sizeof(f),$);
f[]:=;
readln(b);
n:=;
for i:= to b do
begin
readln(ql[i],qr[i]);
if qr[i]>n then n:=qr[i];
end;
qsort(,b);
t:=;
for i:= to n do
begin
f[i]:=f[i-];
while qr[t]=i do
begin
if f[ql[t]-]+i-ql[t]+>f[i] then
f[i]:=f[ql[t]-]+i-ql[t]+;
inc(t);
end;
end;
writeln(f[n]);
close(input);close(output);
end.

饲料槽

[Weekly] 2014.03.01-2014.03.08的更多相关文章

  1. JavaScript基础系列目录(2014.06.01~2014.06.08)

    下列文章,转载请亲注明链接出处,谢谢! 链接地址: http://www.cnblogs.com/ttcc/tag/JavaScript%20%E5%9F%BA%E7%A1%80%E7%9F%A5%E ...

  2. Cheatsheet: 2018 03.01 ~ 2018 03.31

    Docker A Developer's Guide to Docker: A Gentle Introduction The Advantages of Using Kubernetes and D ...

  3. [MVC学习日记]2014/12/01 初步认识MVC模型。

    2014/12/011.初步认识MVC模型.MVC模式是一种表现模式.它将web应用程序分成三个部分,模型(Model).视图(View).控制器(Controller).Model:是实现业务逻辑层 ...

  4. Wed Nov 01 13:03:16 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended.

    报错:Wed Nov 01 13:03:16 CST 2017 WARN: Establishing SSL connection without server's identity verifica ...

  5. 023 01 Android 零基础入门 01 Java基础语法 03 Java运算符 03 算术运算符之——自增自减运算符

    023 01 Android 零基础入门 01 Java基础语法 03 Java运算符 03 算术运算符之--自增自减运算符 本文知识点:Java算术运算符中的自增自减运算符 自增自减运算符 之前我们 ...

  6. Cheatsheet: 2014 03.01 ~ 03.31

    .NET Should I be concerned about PDB files? async and await -Simplified-Internals Web Performance tr ...

  7. SAP-MM:收货转储时提示 M7053“只能在公司代码 **** 的期间 2014/04 和 2014/03 中记账”

    错误信息   消息号M7053   解决方法 Step 1.使用MMPV进入"关闭账期"界面. Step 2.输入"公司代码"."期间".& ...

  8. Java知识系统回顾整理01基础03变量08表达式

    一.以 ; 结尾的一段代码,即为一个表达式 表达式是由变量.操作符以及方法调用所构成的结构.如下所示: int i = 5; System.out.println(5); 都是表达式 public c ...

  9. Cheatsheet: 2015 03.01 ~ 03.31

    Web The Architecture of Algolia's Distributed Search Network No promises: asynchronous JavaScript wi ...

  10. 《Genesis-3D开源游戏引擎-FQA常见问题解答》2014年01月10号版本

    1.Genesis-3D开源游戏引擎主要面向哪些用户人群?有限制吗? 1.我们的引擎没有限制,只要您想了解和使用我们的引擎,就可以加入Genesis-3D的大家庭.2.我们的主要用户群是各个相关的企业 ...

随机推荐

  1. yield return的作用

    测试1: using UnityEngine; using System.Collections; public class test1 : MonoBehaviour { // Use this f ...

  2. viewpager实现酷炫侧滑demo

    晚上叫外卖,打开饿了么,发现推了一个版本,更新以后,点开了个鸡腿,哇,交互炫炸了. 不过还是有槽点.我是无意中才发现可以左右滑动的.这...你不告诉我,我怎么知道左右可以滑. https://gith ...

  3. SVN使用教程总结

    SVN简介: 为什么要使用SVN? 程序员在编写程序的过程中,每个程序员都会生成很多不同的版本,这就需要程序员有效的管理代码,在需要的时候可以迅速,准确取出相应的版本. Subversion是什么? ...

  4. LINK : fatal error LNK1104: 无法打开文件“LIBCD.lib”

    出现这类问题一般是由于所运行的项目是VC6(或者vs2003)创建的,而后又用VS2005或者更高版本工具打开项目导致的,原因都是因为LIBCD.lib文件被更改了.要解决问题的话,只要在链接设置那里 ...

  5. 关于css的一些知识点整理

    一.标签的类型:   行内:span.a.b.i.strong.em.   1.共处一行   2.不支持设置宽高 display:block; 转换成块 块:h1-h6 p div  ul ol 1. ...

  6. asp.net 之 数据库导入treeview

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  7. JAVA基础知识之JDBC——使用ResultSetMetaData分析结果集

    通过ResultSetMetaData可以对ResultSet进行分析,获取ResultSet里包含了哪些数据列,以及每个列的数据类型. ResultSet中包含了一个getMetaData()方法, ...

  8. 理解GRUB2工作原理及配置选项与方法

    GRUB2是借鉴GRUB改写到更加安全强大到多系统引导程序,现在大部分较新的Linux发行版都是使用GRUB2作为引导程序的.GRUB2采用了模块化设计,使得GRUB2核心更加精炼,使用更加灵活,同时 ...

  9. oracle在windows下启动时报错ora-28056

    windows下的的oracle ,实例启动时是会向windows操作系统的事件查看器--应用程序 部分写入启动信息的,并且这个写入行为无法用oracle 的参数或者其他手段去禁止. 若是事件查看器- ...

  10. 使用jquery中height()方法获取各种高度大全

    alert($(window).height()); //浏览器当前窗口可视区域高度 alert($(document).height()); //浏览器当前窗口文档的高度 alert($(docum ...