本题要求编写程序,计算 2 个有理数的和、差、积、商。输入格式:输入在一行中按照 a1/b1 a2/b2 的格式给出两个分数形式的有理数,其中分子和分母全是整型范围内的整数,负号只可能出现在分子前,分母不为 0。输出格式:分别在 4 行中按照 有理数1 运算符 有理数2 = 结果 的格式顺序输出 2 个有理数的和、差、积、商。注意输出的每个有理数必须是该有理数的最简形式 k a/b,其中 k 是整
转载 2021-03-03 10:04:10
113阅读
2评论
One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re
转载 2020-06-05 18:10:00
86阅读
题目链接分析: 这道题很久以前(一年前???) 就做过了,但是直到现在我也并不觉得简单如果我们选择完成一项工作 那么最长休息时间就要看完成之后的状态f[i]=f[i+job[j].t]dp的原则是当前状态一定要由稳定状态转移来 那么明显要从后向前循环那如果当前没有任务...
转载 2017-09-01 11:36:00
48阅读
2评论
问题 E: P1034 题目描述 尼克每天上班之前都连接上英特网,接收他的上司发来的邮件,这些邮件包含了尼克主管的部门当天要完成的全部任务,每个任务由一个开始时刻与一个持续时间构成。 尼克的一个工作日为N分钟,从第一分钟开始到第N分钟结束。当尼克到达单位后他就开始干活。如果在同一时刻有多个任务需要完
转载 2017-05-19 14:22:00
55阅读
2评论
1034. Head of a Gang (30)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueOne way that the police finds the head of a
原创 2022-08-30 10:21:17
23阅读
1 class Solution: 2 def __init__(self): 3 self.V = list() 4 5 def bfs(self,grid,color,rows,coloums,r,c,ocolor): 6 cur = [r,c] 7 if cur[0]-1 >=0 and self.V[c
转载 2019-04-28 12:24:00
41阅读
题目链接分析: 这道题很久以前(一年前???) 就做过了,但是直到现在我也并不觉得简单如果我们选择完成一项工作 那么最长休息时间就要看完成之后的状态f[i]=f[i+job[j].t]dp的原则是当前状态一定要由稳定状态转移来 那么明显要从后向前循环那如果当前没有任务...
转载 2017-09-01 11:36:00
30阅读
2评论
1034. 有理数四则运算(20)时间限制200 ms内存限制65536 kB代码长度限制8000 B判
原创 2022-08-30 10:18:23
36阅读
#include<stdio.h> void print2(int n) { int i; for(i=1;i<=n;i++) printf("%d",i); for(i=n-1;i>=1;i--) printf("%d",i); printf("\n"); } int main() { int k,i
原创 2013-12-09 23:37:09
306阅读
/* 题意:有n个结点,有m条边A->B,判断是不是森林, 如果一结点有两个结点以上同时指向它,即它的入度>1, 或者有环 , 即没有根节点,则不是森林, 若是森林的话,则输出它的深度和宽度, 宽度是指结点数最多的那一层*/#include<iostream> // 求森林深度和宽度 #include<stdio.h>#include<cstring>#include <algorithm>using namespace std;#define maxn 120int g[maxn][maxn]; int in[maxn],heigh
转载 2011-07-04 18:39:00
27阅读
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25911思路:强连通缩点,在新图中找入度为0的点的个数即可。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 using na...
转载 2013-10-02 23:04:00
50阅读
2评论
One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call between A and B, we say that A and B is re
转载 2018-03-16 13:58:00
12阅读
原题链接在这里:https://leetcode.com/problems/coloring-a-border/ 题目: Given a 2-dimensional grid of integers, each value in the grid represents the color of th
转载 2019-12-19 13:12:00
139阅读
2评论
题目链接:http://www.patest.cn/contests/pat-a-practise/1034 题目: 1034. Head of a Gang (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Y
转载 2016-01-30 21:23:00
48阅读
2评论
Candy Sharing GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4448Accepted Submission(s): 2718...
转载 2015-12-08 18:49:00
29阅读
2评论
题意翻译给你n个数,去掉尽量少的数使得剩下数的gcd比原来的大。
原创 10月前
25阅读
DescriptionGiven a 2-dimensional grid of integers, each value in the grid re
原创 2022-08-11 17:33:39
23阅读
1 题目1034 Head of a Gang (30分)One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone
原创 2022-05-26 11:58:34
53阅读
1034. Head of a Gang (30)时间限制100 ms内存限制65536 kB代码长度限制of a
  • 1
  • 2
  • 3
  • 4
  • 5