首页 > TAG信息列表 > Zoj
zoj 1518This Sentence is False
题目链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827365017 题目考察:并查集+dfs 难度评价:中等 解题报告: 题目在poj中也可以找到poj1291 当然,我感觉这道题和poj的食物链也有点相似,可以说是食物链的plus版,还不错 与i对立的情况必定是包含在除了i的情况中,所以没Zoj 1171 Sorting the Photos
题目描述 Imagine you have a pile of 1 <= N <= 10^5 photos. Some of them are faced upwards and the others faced downwards. Your goal is to sort them so all the photos are faced the same direction. The only operation you are allowed to do is to take any a【16年浙江省赛 B ZOJ 3937】More Health Points 题解
题目链接 \(Describe\) 给定一棵以节点\(1\)为根的树,节点间单向边连接,每个节点有权值\(B_i\),找到其中一串子链(也可以为空),该子链最靠近\(1\)的节点为该子链的根节点,计算每个节点的深度(根节点深度为\(1\))与权值的乘积,并求和,即\(ans= \sum\limits_{i=1}^ndeep_i*B_i\)(其中\(n\)ZOJ 1945 Stacking Tower
One of the most common children's toys is a stacking tower, which consists of a series of rings of dierent sizes and a tapered rod which can hold the rings. The rings and rod are designed so that when the rings are placed in descending order by sizeZOJ - 1610 Count the Colors(线段树区间颜色更新)
题目链接 思路: 先建树,lazy延迟数组,ans记录每个数字颜色出现次数,-1表示无色,-2表示多色,>=0表示有颜色。 Bulid函数只是将左右节点固定了, PushUp更新父节点函数:当两个子节点颜色不同,则更新为-2,若相同则更新为子节点颜色, PushDown更新子节点的lazy数组,子节点的lazy和tree.w值都更ZOJ-3735 Alice‘s Print Service(期望dp)
LINK 给出一个 R ∗ R R*R R∗R的矩阵 a a a 其中ZOJ-Fire Net
题目链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827364501 【题目大意】 n行n列的地图,地图中黑色格子代表墙壁(输入样例中的‘X’),可以挡住子弹。地图中的白色格子代表空地(输入样例中的’.’),可放置碉堡。碉堡可以发射子弹,被子弹射中的碉堡将会被摧毁。现java ,学习网站
LeetCode https://leetcode.com/ 浙江大学 Online Judge https://zoj.pintia.cn/contests【ZOJ】1457 &【UVA】524Prime Ring Problem素环问题
【ZOJ】1457 &【UVA】524Prime Ring Problem素环问题 原题 Time Limit: 10000 ms Memory Limit: 32768 KB Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two aZOJ 3725 概率dp
太差劲了 1 #include<iostream> 2 #include<algorithm> 3 #include<cstring> 4 #include<cmath> 5 using namespace std; 6 7 double dp[10010][150], p[150][150]; 8 9 void init(int n) 10 { 11 for(int i = 0 ; i < 10010 ; i++){Zoj 4063(构造题 思维题)
const int MAX_N = 1e3 + 50; int N, K; int mat[MAX_N][MAX_N]; void work(int len) { if (2 * len > MAX_N)//1024即可 return; for (int i = 1; i <= len; i++) { for (int j = 1; j <= len; j++) { mat[i + len][j] = mat[i][j] + len;//构造左同大小矩阵 maZOJ刷题导航
转载自作者:V瓜子仁链接:https://blog.csdn.net/weixin_38852848/article/details/90763716来源:CSDN (自己备份链接)https://wenku.baidu.com/view/65cdb31982c4bb4cf7ec4afe04a1b0717fd5b3df.htmlZOJ 1217 Eight(单向BFS+map)
Eight 题目传送门~ Time Limit: 10000 msMemory Limit: 32768 KB Scenario The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 oHDU--3788--ZOJ问题--字符串细节处理
对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC。 是否AC的规则如下: 1. zoj能AC; 2. 若字符串形式为xzojx,则也能AC,其中x可以是N个'o' 或者为空; 3. 若azbjc 能AC,则azbojac也能AC,其中a,b,c为N个'o'或者为空; Input 输入包含多组测试用例,每行有一个只包含'z','o','ZOJ 1364 Machine Schedule
题意 机器调度问题 有两个机器A,B A有n种工作模式0...n-1 B有m种工作模式0...m-1 然后又k个任务要做 每个任务可以用A机器的模式i或b机器的模式j来完成 机器开始都处于模式0 每次换模式时都要重启 问完成所有任务机器至少重启多少次 Sol:最基础的二分图最大匹配问题 对于每个任务ACM入门-ZOJ 1383 Binary Numbers 二进制数
题目来自ZOJ 1383 链接 题目 Given a positive integer n, print out the positions of all 1’s in its binary representation. The position of the least significant bit is 0. Example The positions of 1’s in the binary representation of 13 are 0, 2, 3. TaskZOJ-3869,Ace of Aces(简单题)
Problem Description: There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This year, the TSAB decided to elect an outstanding member from its elite troops. The elecZOJ 1291 MPI Maelstrom 简单最短路入门
输出格式有坑 #include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <queue> #include <cmath> //#include <malloc.h> using namespace std; int map[105][105],ans[105],flag[105];char st[15]; inZOJ 1003
题目描述可百度. 思路:找两个数n,m(n>m)在1~100间的因子,从100往下找.如果n%i==0,就找n/i和m在1到i-1之间的因子,直到m变成了1或者i变成了0.这样,每次找的因子不会重复(因为如果出现了一个因子,就找n/i 在1到i-1的,i不出现了).且通过能否回到1就能看n和m能否在1~100间乘出来ZOJ 2688 The Review Plan II
https://zoj.pintia.cn/problem-sets/91827364500/problems/91827369470 题意: n天n个计划,一天完成一个计划,第i个计划不能在第i天和第i+1天完成,第n个计划不能在第n天和第1天完成,求安排计划的方案数。 有禁区的排列问题 在n*n有禁区棋盘上放n个棋子,每行每列只能放1个,第i行的禁QS Network ZOJ - 1586 板子题
#include<iostream> #include<algorithm> using namespace std; const int N=1e6+10; struct edge{ int a,b; double w; }e[N]; int p[N]; int a[N]; int n; bool cmp(edge a,edge b) { return a.w<b.w; } int find(int x) { if(p[x]!=x)Day8 - G - Bound Found ZOJ - 1964
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, not meters!"). Each signal seems to come in twoZOJ - 3203 Light Bulb(三分)
题意:灯离地面的高度为$H$,人的身高为$h$,灯离墙的距离为$D$,人站在不同位置,影子的长度不一样,求出影子的最长长度。 思路:设人离灯的距离为$x$,当人走到距离灯长度为$L$时,人在墙上的影子消失,此时人再往前走,影子的长度必然会减小,此时的$L$就为三分的左边界,右边界为$R=D$,由形似三角形可以ZOJ 1002 Fire Net(dfs)
嗯... 题目链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827364501 这道题是想出来则是一道很简单的dfs: 将一个4*4的地图给每一个点排序,如下图: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 设一个点为第k个点,那么它的坐标为(k/n,k%n),根据ZOJ 2314 (无源汇有上下边界的可行流)
(点击此处查看原题) 题意分析 给出n个结点,m条管道,每条管道存在最小流量和最大流量,而且每个结点的流入量等于流出流出量,问这n个结点和m条管道能否形成流量循环 解题思路 经典的无源汇有上下边界的可行流问题,因为每条边存在最低流量low和最大流量up,所以每条边都至少有low流量,我们为每