SCNU 2015ACM新生赛初赛【1001~1011】个人解题思路
#include <stdio.h> int main()
{
int T, n, m, k, act[];
scanf("%d", &T);
while(T--) {
scanf("%d%d%d", &n, &m, &k);
for(int i=; i<=m; i++)
scanf("%d", act+i);
int t=, x, res=;
for(int i=; i<k; i++) {
scanf("%d", &x);
if(t!=act[x]) {
t=act[x];
++res;
}
}
printf("%d\n", res);
}
return ;
}
1001
#include <stdio.h> int main()
{
int T, n, m, k, tme[], t;
scanf("%d", &T);
while(T--) {
scanf("%d%d%d", &n, &m, &k);
for(int i=; i<=m; i++)
scanf("%d", tme+i);
for(int i=; i<n; i++)
for(int j=; j<=m; j++) {
scanf("%d", &t);
if(tme[j]>t)
tme[j]=t;
}
int res=;
for(int i=; i<k; i++)
scanf("%d", &t),
res+=tme[t];
printf("%d\n", res);
}
return ;
}
1002
#include <stdio.h> int main()
{
int T, m=<<;
char N[];
scanf("%d", &T);
while(T--) {
int x=;
scanf("%s", N);
for(int i=; i<; i++) {
x<<=;
if(N[i]=='')
x|=;
}
printf("%d\n", m-x);
}
return ;
}
1004
#include <stdio.h>
int main() {
int T, n, m;
scanf("%d", &T);
while(T--) {
scanf("%d%d", &n, &m);
printf("%.2lf\n", .*m*m/n+m-n-1E-);
}
return ;
}
1005
#include <stdio.h>
#include <iostream>
using namespace std; int main() {
int rd, A=;
long double B=;
cout.precision();
cout<<fixed;
while(~(rd=getchar())) {
if(rd=='\n') {
cout<<B<<endl;
A=; B=;
}
else if(rd=='+')
++A;
else if(rd=='*')
B*=A;
}
return ;
}
1008
#include <iostream>
template<int N> struct czj { czj<N-> oyk; czj() { std::cout << N << std::endl; } };
template<> struct czj<> { };
czj<> wwj;
int main() { }
1009
#include <stdio.h>
#include <math.h> int main() {
int T;
scanf("%d%*c", &T);
for(int cse=; cse<=T; cse++) {
int r, a, b, c, x, y, z;
double res=.;
printf("Case #%d: ", cse);
scanf("%*c%d,%d,%d%*c", &a, &b, &c);
while(r=getchar(), r!='\n') {
scanf("%*c%d,%d,%d%*c", &x, &y, &z);
a-=x; b-=y; c-=z;
res+=sqrt(a*a+b*b+c*c);
a=x; b=y; c=z;
}
printf("%.3f\n", res);
}
return ;
}
1011
SCNU 2015ACM新生赛初赛【1001~1011】个人解题思路的更多相关文章
- SCNU 2015ACM新生赛初赛【1007. ZLM的扑克牌】解题报告
题目链接详见SCNU 2015新生网络赛 1007. ZLM的扑克牌 . 其实我在想这题的时候,还想过要不要设置求最小的排列,并且对于回文数字的话,可以把扑克牌折起来( ...
- SCNU 2015ACM新生赛初赛【1006. 3D打印】解题报告
题目链接详见SCNU 2015新生网络赛 1006. 3D打印 .出题思路来自codevs 3288. 积木大赛,属于模拟题. 首先我们把“选择从第L部分到第R部分”理 ...
- SCNU 2015ACM新生赛决赛【F. Oyk闯机关】解题报告
题目大意:一个$N$$\times$$N$的阵列,每个格子有$X_{ij}$个调和之音,若每次只能选择走右边或下边,从左上角出发走到右下角,问最多能收集到多少个调和之音? ...
- SCNU ACM 2016新生赛初赛 解题报告
新生初赛题目.解题思路.参考代码一览 1001. 无聊的日常 Problem Description 两位小朋友小A和小B无聊时玩了个游戏,在限定时间内说出一排数字,那边说出的数大就赢,你的工作是帮他 ...
- SCNU ACM 2016新生赛决赛 解题报告
新生初赛题目.解题思路.参考代码一览 A. 拒绝虐狗 Problem Description CZJ 去排队打饭的时候看到前面有几对情侣秀恩爱,作为单身狗的 CZJ 表示很难受. 现在给出一个字符串代 ...
- 贪心 赛码 1001 Movie
题目传送门 /* 贪心:官方题解: 首先我们考虑如何选择最左边的一个区间 假设最左边的区间标号是i, 那选择的另外两个区间的左端点必定要大于Ri 若存在i之外的j, 满足Rj<Ri, 那么另外两 ...
- Codeforces 801 A.Vicious Keyboard & Jxnu Group Programming Ladder Tournament 2017江西师大新生赛 L1-2.叶神的字符串
A. Vicious Keyboard time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- [ACTF2020 新生赛]BackupFile && [ACTF2020 新生赛]Upload &&[GYCTF2020]Blacklist
[ACTF2020 新生赛]BackupFile 尝试找到源代码,加上题目是备份文件,猜测备份文件里面有网站的源代码,御剑扫描一下,就扫到index.php 访问index.php.bak 下载源代码 ...
- [BUUCTF]REVERSE——[ACTF新生赛2020]Oruga
[ACTF新生赛2020]Oruga 附件 步骤: 例行检查,64位程序,无壳 64位ida载入,检索字符串,根据提示来到关键函数 14行~18行就是让字符串的前5位是 actf{ ,sub_78A( ...
随机推荐
- 前端学HTTP之连接管理
前面的话 HTTP连接是HTTP报文传输的关键通道.要掌握HTTP就需要理解HTTP连接的来龙去脉以及如何使用这些连接 如果想查看一个网页,浏览器收到URL时,会执行下图所示的步骤.将服务器的IP地址 ...
- 一个难倒 3年 android开发经验 " 工程师 " 的 "bug"
一个关于 imageView 设置 scaleType 的问题. 就在刚才 晚上9 点多的时候,我的一个外包伙伴发一个工程代码我,叫我去看下这样一个"bug",说折腾了很久,图片选 ...
- 3.C#WinForm基础累加器
功能:实现累加计算. 知识点: bool int.TryParse(string s,out int result)(+1重载) 将数字的字符串形式转换为它的等效的32位有效的有符号整数,一个指示操作 ...
- 微信企业号开发(1)WebAPI在回调模式中的URL验证
微信回调模式的官方文档. 开发语言:C#(微信相关功能代码可以从官网下载) 首先,必须要明确几个参数,这几个参数在微信企业号中,每次调用都会使用到. 1.msg_signature:签名(已加密,加密 ...
- 前端开发:css基础知识之盒模型以及浮动布局。
前端开发:css基础知识之盒模型以及浮动布局 前言 楼主的蛮多朋友最近都在学习html5,他们都会问到同一个问题 浮动是什么东西? 为什么这个浮动没有效果? 这个问题楼主已经回答了n遍.今天则是把 ...
- 01windows窗体程序学习
静态用户名和密码的登录练习 private void button2_Click(object sender, EventArgs e) { textUser.Text = Convert.ToStr ...
- C# - 多线程 之 信号系统
基础概览 多线程之信号系统命名空间 using System.Threading; 线程同步类的继承层次关系图 终止状态和非终止状态 在终止状态下,被WaitOne()阻塞的线程会逐个得到释放.如果一 ...
- [python] xlrd
0.xlrd introduce Library for developers to extract data from Microsoft Excel (tm) spreadsheet files ...
- Firebug调试js代码
Firebug功能异常强大,不仅可以调试DOM,CSS,还可以调试JS代码,下面介绍一下调试JS. 1.认识console对象 console对象是Firebug内置的对象,该对象可以在代码中写入,可 ...
- Angular通过XHR加载模板而限制使用file://(解决方案)
编写angular项目时,遇到此困难: angular.js:12011 XMLHttpRequest cannot load file:///E:/angular/imooc/chapter2/bo ...