详解OJ(Online Judge)中PHP代码的提交方法及要点 Introduction of How to submit PHP code to Online Judge Systems Introduction of How to commit submission in PHP to Online Judge Systems 在目前常用的在线oj中,codeforces.spoj.uva.zoj 等的题目可使用PHP实现基本算法,zoj是目前对PHP支持较好的中文OJ. PHP是一门比…
Problem A: WERTYU Description A common typing error is to place yourhands on the keyboard one row to the right of the correct position. Then ``Q'' is typed as ``W'' and ``J'' is typed as ``K'' and so on. Your task is to decode a message typed inthis…
Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. Sample Input 1 1 2 2 3 3 Sample Output 2 4 6 我的代码: #include <stdio.h> int main() { int A,…
Problem Descripton Two planets named Haha and Xixi in the universe and they were created with the universe beginning. There is 73 days in Xixi a year and 137 days in Haha a year. Now you know the days N after Big Bang, you need to answer whether it i…
2017-08-31 16:48:00 writer:pprp 这个题比较容易,我用的是快速幂 写了一次就过了 题目如下: A Math Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0 Problem Description You are given a po…
1012: A MST Problem 时间限制: 1 Sec 内存限制: 32 MB 提交: 7 解决: 4 题目描述 It is just a mining spanning tree ( 最小生成树 ) problem, what makes you a little difficult is that you are in a 3D space. 输入 The first line of the input contains the number of test cases in t…
20160523 百度之星初赛第一场 1001 All X Problem Description F(x, m)F(x,m) 代表一个全是由数字xx组成的mm位数字.请计算,以下式子是否成立: F(x,m) mod k ≡ c Input 第一行一个整数TT,表示TT组数据. 每组测试数据占一行,包含四个数字x,m,k,c 1≤x≤9 1≤m≤10^10 0≤c<k≤10,000 Output 对于每组数据,输出两行: 第一行输出:"Case #i:".ii代表第ii组测试数…
[图论01]最短路 Start Time : 2018-01-02 12:45:00 End Time : 2018-01-23 12:45:00 Contest Status : Running Current System Time : 2018-01-12 14:39:34 Solved Problem ID Title Ratio(Accepted / Submitted) 1001 最短路 51.85%(70/135) 1002 King 46.67%(35/75) …
Solved Pro.ID Title Ratio(Accepted / Submitted) 1001 Another Chess Problem 8.33%(1/12) 1002 Beauty Of Unimodal Sequence 19.07%(74/388) 1003 Coefficient 6.76%(5/74) 1004 Double Tree 0.00%(0/20) 1005 Everything Is Generated In Equal Probabili…
Sum Problem Time Limit: 1000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 338086 Accepted Submission(s): 85117 Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this pro…
这一段时间一直都在刷OJ,这里建一个博客合集,用以记录和分享算法学习的进程. github传送门:https://github.com/haoyuanliu/Online_Judge/tree/master/HangDianOJ Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series…
1098: The 3n + 1 problem 时间限制: 1 Sec 内存限制: 64 MB 提交: 368 解决: 148 题目描述 Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process…
2732: 3798-Abs Problem 时间限制: 1 Sec 内存限制: 128 MB Special Judge 提交: 167 解决: 60 题目描述 Alice and Bob is playing a game, and this time the game is all about the absolute value! Alice has N different positive integers, and each number is not greater than…
这一套题做错了几次,按理说直接用等差数列求和公式就行了,主要是要考虑一些运算符的结核性问题: 四则运算符(+.-.*./)和求余运算符(%)结合性都是从左到右. 于是,我自己写了一个版本,主要是考虑(n+1)*n始终为偶数,这样就不用担心除以2时的取整问题: #include <stdio.h> int main(void) { int n; __int64 sum = ; while (scanf("%d", &n) != EOF) { sum = ((n + )…
Description Graphical editors such as Photoshop allow us to alter bit-mapped images in the same way that text editors allow us to modify documents. Images are represented as an M x N array of pixels, where each pixel has a given color. Your task is t…
/* 注意可以是负整数,而且在过程中会超过int,所以要用longlong */ #include <cstdio> int main() { long long n; while (scanf("%lld",&n)!=EOF) (n<1)?printf("%d\n\n",(n+1)*(2-n)/2):printf("%d\n\n",n*(n+1)/2); return 0; }…
最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line Output For each case, output SUM(n) in one…