百炼OJ - 1004 - 财务管理】的更多相关文章

题目链接:http://bailian.openjudge.cn/practice/1004/ 思路 求和取平均... #include <stdio.h> int main() { float sum=0,a; for(int i=0;i<12;i++) { scanf("%f",&a); sum += a; } printf("$%.2f\n",sum/12); return 0; }…
题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:14162 解决:3887 题目描述: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 1…
#include <stdio.h> #include <stdlib.h> #include <limits.h> #define N 1000000 int a1[N+1], a2[N+1]; int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main(void) { int n1, n2, i1, i2, k, id, res; while (scanf(&quo…
题目1004:Median 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:17536 解决:4860 题目描述:                        Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median…
题目大意: 给你一菱形的数字阵,问从最上面走到最下面所能获得的最大值是多少? #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<queue> #include<vector> #include<map> using namespace std; typedef lo…
http://bailian.openjudge.cn/practice/2767/ #include<iostream> #include <cmath> #include <math.h> #include <vector> #include <algorithm> #include <map> #include <string> //#include <string.h> #include <uno…
http://bailian.openjudge.cn/ss2017/A/ #include<iostream> #include <cmath> #include <math.h> #include <vector> #include <algorithm> struct Student { int num; int chinese; int math; int english; int getAllGrade() { return chine…
题目链接:http://bailian.openjudge.cn/practice/1007 #include<stdio.h> #include<algorithm> using namespace std; typedef struct number{ char s[51]; int num; }; int n,len; number myn[101]; bool cmp( number a, number b ) { return a.num < b.num; } in…
题目链接:http://bailian.openjudge.cn/practice/1005/ 思路 一个半圆面积每年增长50,已知一个点坐标,求第几年点在半圆内. #include <stdio.h> #include <math.h> #define pai 3.1415926 int main() { int n; double x,y; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%…
题目链接 思路 求一个数列的前n项和(1/2, 1/3, ...., 1/n)大于所给数所需的项数. #include<stdio.h> int main() { float a; while( scanf("%f",&a) ) { if( a == 0.0 ) break; int n=2; float sum =0; while( sum < a ) { sum += 1.0/n; n++; } printf("%d card(s)\n"…
题目链接 思路 开个一千万的数组计数,最后遍历即可. #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int num=0; int mymap[10000000] = {0}; int change(char a[201]) { int j=0, result=0; for(int i=0;i<strlen(a);i++) { if(a[i] == '-')…
题目链接 哇一遍AC的感觉也太爽了吧:) #include <stdio.h> #include <string.h> int times=0; char *myCalc(char source[1000], char s[1000], int times) { if( times == 0 ) return s; int last=0,a=strlen(source),b=strlen(s); char res[1000]={0}; for(int i=0;i<(a+b-1…
Description 为了找寻沉睡的亚特兰提斯大陆,wm来到了大西洋上进行探险,找了半个月仍一无所获.然而在一次突袭而来的暴风雨后,wm的船莫名地驶入了一片未知的区域,发现了一个地图上未标记的岛屿,这让他感到相当惊讶,强烈的好奇心驱使他上岸看看究竟. 船在岛屿靠岸后岛上的国王举行庆典热情地款待了他,整个岛一片喜庆.国王自称是亚特兰提斯人,而这个岛屿曾经是亚特兰提斯大陆的最高地.现在岛屿上还有N个城市,由于岛上的资源相当有限且岛上没人知道怎么合理利用资源故一直以来在城市之间都没有铺设道路,现在国…
与1141题相同. 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:843 解决:502 题目描述: Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and s…
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:939 解决:489 题目描述: Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his f…
1004: This is Halloween: Saving Money Time Limit: 1 Sec      Memory Limit: 128 MB Submit: 11      Solved: 2 Description The Mayor of Halloween Town was always concerned about saving money. When the Pumpkin King, Jack Skelington decided to try his han…
搭建 OJ 需要的知识(重要性排序): Java SE(Basic Knowledge, String, FileWriter, JavaCompiler, URLClassLoader, SecurityManager, synchronized) Java Virutal Machine(Classpath,Policy) Servlet(HttpServlet) JSP(Session, JSP, EL, JSTL, Custom Tags) Tomcat(Classpath) Java…
前言 做过杭电.浙大或是北大等ACM题库的人一定对“刷题”不陌生,以杭电OJ为例:首先打开首页(http://acm.hdu.edu.cn/),然后登陆,接着找到“Online Exercise”下的“Problem Archive”,然后从众多题目中选择一个进行读题.构思.编程.然后提交.最后查看题解状态,如果AC了表示这一题被攻克了,否则就要重做了~一般情况下,“刷题”要求精神高度集中且经验丰富,否则很难成功AC,有时候甚至做一题要浪费半天的时间!(有时网速卡了,比抢火车票还要急!) 楼主在…
1004: [HNOI2008]Cards Description 小春现在很清闲,面对书桌上的N张牌,他决定给每张染色,目前小春只有3种颜色:红色,蓝色,绿色.他询问Sun有 多少种染色方案,Sun很快就给出了答案.进一步,小春要求染出Sr张红色,Sb张蓝色,Sg张绝色.他又询问有多少种方 案,Sun想了一下,又给出了正确答案. 最后小春发明了M种不同的洗牌法,这里他又问Sun有多少种不同的染色方案. 两种染色方法相同当且仅当其中一种可以通过任意的洗牌法(即可以使用多种洗牌法,而每种方法可以使…
Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Victor adores the sets theory. Let us remind you that a set is a group of…
import bs4 import requests import urllib2 import time import base64 session=requests.Session() response=session.get('http://oj.blue-whale.me:23331/captcha.php') soup=bs4.BeautifulSoup(response.text) s=soup.find('img') #get the img tag #print s #we ge…
1.一般用C语言节约空间,要用C++库函数或STL时才用C++; cout.cin和printf.scanf最好不要混用. 2.有时候int型不够用,可以用long long或__int64型(两个下划线__). 值类型表示值介于 -2^63 ( -9,223,372,036,854,775,808) 到2^63-1(+9,223,372,036,854,775,807 )之间的整数. printf("%I64d",a); printf("%lld",a); 3.O…
我这校区新的微机老师斗志昂扬,准备让我们这学校萎靡的信息技术竞赛重振雄风.然后有一次我半开玩笑地说建一个自己的OJ吧,老师也就鼓励我去做了. 开什么玩笑……!我可是马上要参加NOIP的人! 于是老师说,慢慢来吧. 嗯,正好我也有兴趣,那就慢慢来吧.先策划一下. 然后我就被吓到了. (注:以下内容纯属纸上谈兵,若坑了请善待><) 零.服务器何在 话说老师办公室里有N台学校淘汰下来的机子,用来做服务器再合适不过了,随便捉一台来装上Linux(学会Linux真是有必要),放在老师办公室24小时挂着,…
1004. Counting Leaves (30)   A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contains one test case. Each case starts with a line containing 0 < N < 100,…
Problem Link: https://oj.leetcode.com/problems/validate-binary-search-tree/ We inorder-traverse the tree, and for each node we check if current_node.val > prev_node.val. The code is as follows. # Definition for a binary tree node # class TreeNode: #…
Problem Link: https://oj.leetcode.com/problems/recover-binary-search-tree/ We know that the inorder traversal of a binary search tree should be a sorted array. Therefore, we can compare each node with its previous node in the inorder to find the two…
Problem Link: https://oj.leetcode.com/problems/same-tree/ The following recursive version is accepted but the iterative one is not accepted... # Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self.left =…
Problem Link: https://oj.leetcode.com/problems/symmetric-tree/ To solve the problem, we can traverse the tree level by level. For each level, we construct an array of values of the length 2^depth, and check if this array is symmetric. The tree is sym…
Problem Link: https://oj.leetcode.com/problems/binary-tree-level-order-traversal/ Traverse the tree level by level using BFS method. # Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # se…
Problem Link: https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Just BFS from the root and for each level insert a list of values into the result. # Definition for a binary tree node # class TreeNode: # def __init__(self, x):…