hiho week 20 register

Ended

Participants:214

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-17 14:47:08

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
using namespace std;
int Sum(const int* Array,const int& Start,const int& End)
{
    int result = 0;
    for (int i = Start - 1; i < End; ++i)
        result += Array[i];
    return result;
}
void Update(int* Array, const int& Start, const int& End,const int& Newp)
{
    for (int i = Start - 1; i < End; ++i)
        Array[i] = Newp;
}
int main()
{
    int N = 0;
    cin >> N;
    int* Array = new int[N];
    for (int i = 0; i < N&&cin >> Array[i]; ++i);
    int Q = 0;
    cin >> Q;
    for (int i = 0; i < Q; ++i)
    {
        int Case = 0;
        cin >> Case;
        int Li = 0;
        int Ri = 0;
        if (Case == 0)
        {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX