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( ...
随机推荐
- HTML自定义对象与属性(谷歌,火狐,IE9浏览器没问题)
1.自定义标签 <zqz>asdas</zqz> <style> zqz{ color:red; } </style> 页面变色 2.自定义标签的hov ...
- MVC5 网站开发之六 管理员 2、添加、删除、重置密码、修改密码、列表浏览
目录 奔跑吧,代码小哥! MVC5网站开发之一 总体概述 MVC5 网站开发之二 创建项目 MVC5 网站开发之三 数据存储层功能实现 MVC5 网站开发之四 业务逻辑层的架构和基本功能 MVC5 网 ...
- Cocoa深入学习:NSOperationQueue、NSRunLoop和线程安全 (转)
目前在 iOS 和 OS X 中有两套先进的同步 API 可供我们使用:NSOperation 和 GCD .其中 GCD 是基于 C 的底层的 API ,而 NSOperation 则是 GCD 实 ...
- CLR via C# 摘要二:IL速记
最简单的IL程序 .assembly test {} .method void Func() { .entrypoint ldstr "hello world" call void ...
- 关闭firefox的plugincheck
每次打开firefox都弹出这个SB页面: https://www.mozilla.org/en-US/plugincheck/ 关不掉, 很是烦人. 经过地番google,找到了答案: about: ...
- Python 基础之二用户交互input
Input是个内建函数: >>> input <built-in function input> >>> 具体用法:接收用户输入的内容,输入的字符串 ...
- java代码解压zip文件
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.Inp ...
- Mac 热键大全
屏幕捕捉快捷键动作............................保存到............-快捷键 全屏捕捉........................桌面(.PDF文件)..... ...
- Spring+ibatis动态管理数据源
Spring动态配置多数据源,即在大型应用中对数据进行切分,并且采用多个数据库实例进行管理,这样可以有效提高系统的水平伸缩性.而这样的方案就会不同于常见的单一数据实例的方案,这就要程序在运行时根据当时 ...
- 详细介绍Mysql各种存储引擎的特性以及如何选择存储引擎
最近业务上有要求,要实现类似oracle 的dblink linux版本 Server version: 5.6.28-0ubuntu0.14.04.1 (Ubuntu) 修改配置文件 /etc/ ...