zoj_3657,12年长春站c题,模拟】的更多相关文章

#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main() { int n; int a[6]; while(scanf("%d",&n)!=EOF) { for(int i=0;i<n;i++) scanf("%d",&a[i]); if(n&l…
NBUT 1105  多连块拼图 Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:  Practice  Appoint description:  System Crawler  (Aug 12, 2016 9:32:14 AM) Description 多连块是指由多个等大正方形边与边连接而成的平面连通图形. -- 维基百科 给一个大多连块和小多连块,你的任务是判断大多连块是否可以由两个这样的小多连块拼成.小多连块…
题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there. Cainiao attended Asia Regional Contest Fuzhou Site on N…
题意:按字母顺序排列成n型,简单的模拟题. 当字母排到z时从a开始重新排起. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: a.cpp * Create Date: 2013-09-08 12:31:36 * Descripton: simulate */ #include <cstdio> #define rep(i, n) for (int i…
RT,这太谔谔了,我不承认这是模拟赛 但是虽然是搬了三道题,题目本身也还能看,就这么着吧 (怎么机房里就我一道原题都没做过啊 T1 CF24D Broken Robot 比较简单地列出式子之后,我们发现可以自底向上每行做高斯消元求从每个格子出发的期望步数,复杂度$O(n^4)$(边界是最底下一行都是零) 然后我们发现高斯消元的时候每一行对应的方程就那几个地方有数,于是脚动高斯消元一下就可以$O(n^2)$了 #pragma GCC optimize(2) #include<cstdio> #i…
一. 选择题(32分) 1. python不支持的数据类型有:AA. charB. intC. floatD. list 2. Ex = ‘foo’y = 2print(x + y)A. fooB. foofooC. foo2D. 2E. An exception is thrown 3. 关于字符串下列说法错误的是 BA. 字符应该视为长度为1的字符串B. 字符串以\0标志字符串的结束C. 既可以用单引号,也可以用双引号创建字符串D. 在三引号字符串中可以包含换行回车等特殊字符4. 以下不能创…
题意:给定初始数量的冰激凌,然后n个操作,如果是“+”,那么数量就会增加,如果是“-”,如果现有的数量大于等于要减的数量,那么就减掉,如果小于, 那么孩子就会离家.问你最后剩下多少冰激凌,和出走的孩子数量. 析:多水的一个题,就是一个模拟,如果是+,就加上,如果是‘-’,就判断一下,如果不够,就记录下来. 代码如下: #include <iostream> #include <cmath> #include <cstdlib> #include <set>…
题意:给定 n 个间谍,m个区间,一个 s,一个f,然后从 s开始传纸条,然后传到 f,然后在每个 t 时间在区间内的不能传,问你最少的时间传过去. 析:这个题,就模拟一下就好,贪心策略,能传就传,找好方向,一直传就行,传到 f 就结束. 代码如下: #include <bits/stdc++.h> using namespace std; struct node{ int l, r, t; bool operator < (const node &p) const{ retur…
果然我还是最菜的==不接受反驳 (先考了day2喵喵喵) Day2 T1:奶酪 期望得分:100分 实际得分:100分 考察:并查集 思路:这题其实之前做过了==.思路还是比较清晰的,读入时预处理出可以“通天下地”的奶酪,之后n²枚举所有的奶酪关系,可以互达的就连到一个并查集中.互达怎么判断?即使是空间也没关系,将两个奶酪的球心距离与二倍半径比较即可.之前的题解 Code //15:31 #include<cstdio> #include<algorithm> #include&l…
果然我还是最菜的==不接受反驳== Day1 T1:神奇的幻方 思路:直接模拟即可,由于当前放法只与上一放法有关系,用两个变量记录一下即可.10分钟内切掉== 预计得分:100分 实际得分:100分 #include<cstdio> #include<algorithm> using namespace std; int n,lx,ly; ][],a[][]; int main() { freopen("magic.in","r",stdin…
D.City Day 题意:就是给定n,x,y,以及这n天的下雨量ai,要求这一天的下雨量是这一天前x天到后y天的下雨量中最小的.输出最早的(下标最小的)d.保证答案一定存在 思路:直接遍历寻找就好了,做好标记 代码: 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<cmath> 6 using namespa…
文章目录 题面(过于冗长,主要是对通信题的一些解释) 题解 1.通信题什么意思 2.此题题解 CODE 实现 题面(过于冗长,主要是对通信题的一些解释) 题解 1.通信题什么意思 并不是两个程序同时跑. 而是你写两个不能单独运行的子程序,然后由评测方调用,检查是否通过数据点. 通信题一般会给你很多函数,有些是你可以不用手写定义就使用的函数(一般在"有效文件名.h"里定义了,你得在代码里加上它的头文件,用""而不是<>),这是第一类,有些是你需要定义其内容…
这题没名字 Problem:I Time Limit:2000ms Memory Limit:65535K Description Now give you an interger m and a sequence: s[1], s[2], ...... , s[N] in not decreasing order. The length of the sequence is n. Your task is to find out how many pair of a and b satisfy…
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/problem/A Description Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x tha…
BZOJ没有题面,差评 洛谷的题目链接 题解 其实这题很久之前就写了,也想写个题解但是太懒了,咕到了今天 在typora写完题解不想copy过来再改格式了,于是直接贴截图qwq #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define il inline #define int long long namespace io { #define in(a) a=read() #define out(a…
题意: 按照这个公式模拟 10120skew = 1×(25 −1)+0×(24 −1)+1×(23 −1)+2×(22 −1)+0×(21 −1) = 31+0+7+6+0 = 44. #include<iostream> #include <stdio.h> #include <memory.h> #include<queue> #include<math.h> using namespace std; int main() { freope…
题意:给定 n 个地方,然后再给 m 个任务,每个任务必须在规定的地方完成,并且必须按顺序完成,问你最少时间. 析:没什么可说的,就是模拟,记录当前的位置,然后去找和下一个位置相差多长时间,然后更新当前位置即可. 代码如下: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; typedef long long LL; int main(){ int n, m, x; while(cin >>…
视频地址: https://www.bilibili.com/video/av39709290/?p=12 博客地址: https://jspang.com/post/flutterDemo.html#toc-b97 要实现的效果; 这里主要是用我们的流式布局 顺序排,一般到头了 会顺序往下排列. 还会学到 媒体查询.手势操作 先写main.dart 创建warp_demo.dart 这个组件肯定是动态的. 那些加号都是数组生成的,所以这里声明一个数组.数组里面添加按钮,添加按钮我们需要单独写一…
ZOJ 3490 没有题解. 一句话,要么贴代码,要么自己打. #include<cstdio> #include<iostream> #include<vector> #include<set> #include<map> #include<math.h> #include<queue> #include<stdlib.h> #include<cstring> #include<algori…
链接: https://www.nowcoder.com/acm/contest/52/M 题意: 给定n个队伍的到场时间, 有3个报道位, 每个队伍报道需要b时间, 求所有报道完成的时间. 分析: 一开始写了一个模拟时间轴的, 虽然过了,但是在时间很大的时候行不通. #include<bits/stdc++.h> using namespace std; int main() { ], u[]; int n, b, time, ok, T; scanf("%d", &am…
题意:给定一个文章,问你有多少种读法,计算方法有两种,如果在$中,如果有多个空格就算n+1,如果是一个就算2的次方,如果在{}中, 那么就是把每个空格数乘起来. 析:直接模拟,每次计算一行,注意上一行最后有空格,下面第一个也是,要全部算上. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <c…
题意:给定一行字符串,让你统计在括号外最长的单词和在括号内的单词数. 析:直接模拟,注意一下在左右括号的时候有没有单词.碰到下划线或者括号表示单词结束了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include…
题意:有n个队参加CCPC,然后有两种优惠方式,一种是一天买再次,一种是买两天,现在让你判断能不能找到一种方式,使得优惠不剩余. 析:直接模拟,如果本次是奇数,那么就得用第二种,作一个标记,再去计算下一个. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #inclu…
1.合同解释应该遵循几个主要原则: 1)主导语言原则 2)适用法律原则 3)整体解释原则 4)公平诚信原则2.合同收尾包括的工作: 1)产品核实 2)可交付成果验收 3)财务结算 4)退还保证金或担保函 5)总结合同实施情况,进行采购审计,从独立.公正的第三方角度来总结采购工作的经验教训 6)更新合同记录,收集资料,整理合同档案,更新组织过程资产3.常见的谈判策略 1)最后期限 2)自己的权利有限,有决策权的人又不在场 3)拖延 4)撤退 5)出人意料 6)公平合理 7)既成事实 8)好人坏人4…
quailty and ccpc hdoj-6666 题目很简单,按照题目的意思模拟就行了,排序. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> using namespace std; struct node{ string name; int num; int time; node(){} node(stri…
水的不行不行的一道题 也是自己做的第一道题  纪念下 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 int main() 5 { 6 int n, sum, k, count; 7 int z[2002]; 8 memset( z , 0 , sizeof(z)); 9 while( scanf( "%d" , &n) != EOF&&n>=1…
A Vasya studies music.He has learned lots of interesting stuff. For example, he knows that there are 12 notes: C, C#, D, D#, E, F, F#, G, G#, A, B, H. He also knows that the notes are repeated cyclically: after H goes C again, and before C stands H. …
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5122 解题报告:定义一种排序算法,每一轮可以随机找一个数,把这个数与后面的比这个数小的交换,一直往后判断,直到后面没有比这个数小的,这样称为一轮,现在给定一个长度为n的序列,要你求,至少要经过多少轮,可以使这个序列成为有序的. 由于只能跟后面的数进行比较,所以我只要统计后面的数有比这个数小的数的个数就可以了.从后往前扫一遍,每次更新当前最小的. #include<cstdio> #include&…
链接:http://codeforces.com/contest/404/problem/B B. Marathon time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera takes part in the Berland Marathon. The marathon race starts at the stadium…
#include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #define N 200010 void input(char s[]) { }; while(gets(str), strcmp(str, "START"));/****/ while(gets(str), strcmp(str, "END"))/****/ { ] ==…