Sequence operationTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4603 Accepted Submission(s): 1338Problem Descriptionlxhgww got a sequence contains n characters which are all '0's or
MatrixTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1008 Accepted Submission(s): 560Problem DescriptionYifenfei very like play a number game in the n*n Matrix. A positive integer number is
Problem DescriptionOne day, ZHJ came across a warrior novel named Kunlun in library. Soon, ZHJ fall into it.He tells everybody how deeply he loves Kunlun no matter whom he meets.He found it attractive so he decided to read the novel in the next N
這個題有一點要考慮到,就是某人從a站坐到b站,他在b站就下車了,他在車上乘坐的區間為a到b-1。#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int MAXN=1000005;struct node{ int l,r; int sum; int lazy; int mid() { return (l+r)
以前在我們學校的OJ上做過一道類似的題目,一開始想類比操作過程的但是實現不了,建立哈夫曼樹又不會,後來跟同學學習了優先隊列,所以就無節操的水過了啊、、、、下面是代碼#include<iostream>#include<algorithm>#include<queue>using namespace std;int main(){ long long n,i,t,tt,ans; priority_queue<long long
Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 6849 Accepted Submission(s): 1566Problem DescriptionA lot of battleships of evil are arranged in a line before
這是POJ討論上的題目解釋,寫的很好摘過來的,感謝提供者、、、對於每一個月來說,是盈利如果則盈利S,如果虧空則虧d。每五個月進行一次統計,共統計八次(1-5月一次,2-6月一次.......)統計的結果是這八次都是虧空。問題:判斷全年是否能盈利,如果能則求出最大的盈利。如果不能盈利則輸出Deficit簡單的貪心,分類討論就行了啊、、、、#include <stdio.h>int main(){ int i, in, out, count, t; while(~scanf(
第一道額~~#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int MAXN=100005;struct node{ int l,r; int lsum,rsum,msum; int mid() { return (l+r)>>1; }};node tree[MAXN*4];inline
~~#include <iostream>#include <cstring>#include <cstdio>#define lson pos<<1#define rson pos<<1|1using namespace std;const int MAXN=100005;struct node{ int l,r; int msum; int lsum,rsum; int mid() {
A new Graph GameTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1010 Accepted Submission(s): 454Problem DescriptionAn undirected graph is a graph in which the nodes are connected by