Design Tutorial: Learn from Life】的更多相关文章

B. Design Tutorial: Learn from Life time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from life. You can choose some experience in real life, formalize it…
A. Design Tutorial: Learn from Math time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from math. You can generate some random math statement or modify som…
Design Tutorial: Learn from Life time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from life. You can choose some experience in real life, formalize it an…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and…
Problem description One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that. For example, there is a statement called the "Goldbach's conj…
题意:有一个电梯,每一个人都想乘电梯到达自己想要到达的楼层!从a层到b层的时间是|a-b|, 乘客上下电梯的时间忽略不计!问最少需要多少的时间....     这是一道神题啊,自己的思路不知不觉的就按照注解的思路走了,想着用优先队列模拟一下,可能还是没有模拟好吧,一直哇!但是同学的优先队列模拟过了! 没想到是greedy算法简单的几行就解决了! #include<iostream> #include<cmath> #include<cstdio> #include<…
题意:将一个数拆成两个合数的和, 输出这两个数!(这道题做的真是TMD水啊)开始的时候不知道composite numbers是啥意思,看了3遍才看懂.... 看懂之后又想用素数筛选法来做,后来决定单个判断一个数是否为素数的方法来写,结果写错了两次,快疯掉了简直.... #include<iostream> #include<cmath> #include<cstdio> #include<algorithm> #include<cmath> #…
题 题意:给你一个大于等于12的数,要你用两个合数表示出来.//合数指自然数中除了能被1和本身整除外,还能被其他的数整除(不包括0)的数. 分析:我们知道偶数除了2都是合数,给你一个偶数,你减去一个偶数得到的就是偶数啦,因为n>=12,所以减去4的话,得到的是>=8的偶数,肯定也是合数,当然你也可以减去6.8,大于8就不行了. 然后给你奇数呢?你减去一个奇数就得到偶数啦,减去一个是合数的奇数,最小的就是9,奇数时:n>=13,n-9>=4 #include<stdio.h&g…
Codeforces Round #270 B:http://codeforces.com/contest/472/problem/B 题意:n个人在1楼,想要做电梯上楼,只有1个电梯,每次只能运k个人,每移动一层需要1秒.问最小的是时间把所有人送到想去的楼层. 题解:贪心,每次选择楼层数最大k个人,用优先队列维护一下即可. #include<iostream> #include<cstdio> #include<cstring> #include<algorit…
题目链接:http://www.codeforces.com/problemset/problem/472/A题意:给你一个数n,将n表示为两个合数(即非素数)的和.C++代码: #include <iostream> using namespace std; bool isprime(int x) { ; i * i <= x; i ++) ) return false; return true; } int main() { int n; cin >> n; ;i <…