Submission #1090431

# Submission time Handle Problem Language Result Execution time Memory
1090431 2024-09-18T10:58:45 Z vjudge1 Game (IOI13_game) C++17
37 / 100
13000 ms 36304 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int n,m;
vector<long long int>st[2001];
void init(int R,int C)
{
    n=R;
    m=C;
    for(int i=0;i<n;i++)
    {
        st[i].resize(4*m+1);
    }
}
void updatest(int i,int l,int r,int a,int b,long long int k)
{
    if(l==r)
    {
        st[a][i]=k;
        return;
    }
    int m=(l+r)/2;
    if(b<=m)updatest(i*2,l,m,a,b,k);
    else
    {
        updatest(i*2+1,m+1,r,a,b,k);
    }
    st[a][i]=gcd(st[a][i*2],st[a][i*2+1]);
}
long long int gsum(int i,int l,int r,int tl,int tr,int a)
{
    if(tl>r||tr<l||l>r)
    {
        return 0;
    }
    if(tl<=l&&r<=tr)
    {
        return st[a][i];
    }
    int m=(l+r)/2;
    return gcd(gsum(i*2,l,m,tl,tr,a),gsum(i*2+1,m+1,r,tl,tr,a));
}
long long int calculate(int r1,int r2,int c1,int c2)
{
    long long int sum=0;
    for(int i=r1;i<=c1;i++)
    {
        sum=gcd(sum,gsum(1,0,m-1,r2,c2,i));
    }
    return sum;
}
void update(int R,int C,long long int k)
{
      updatest(1,0,m-1,R,C,k);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 0 ms 604 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 552 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 0 ms 604 KB Output is correct
11 Correct 1 ms 604 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 590 ms 35764 KB Output is correct
5 Correct 446 ms 36304 KB Output is correct
6 Correct 436 ms 32752 KB Output is correct
7 Correct 456 ms 32616 KB Output is correct
8 Correct 386 ms 33424 KB Output is correct
9 Correct 470 ms 32596 KB Output is correct
10 Correct 439 ms 32132 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 604 KB Output is correct
10 Correct 1 ms 604 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Execution timed out 13094 ms 35056 KB Time limit exceeded
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 0 ms 604 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 604 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 604 KB Output is correct
12 Correct 562 ms 35760 KB Output is correct
13 Correct 387 ms 36280 KB Output is correct
14 Correct 451 ms 32748 KB Output is correct
15 Correct 429 ms 32648 KB Output is correct
16 Correct 346 ms 33364 KB Output is correct
17 Correct 440 ms 32596 KB Output is correct
18 Correct 401 ms 32076 KB Output is correct
19 Execution timed out 13077 ms 35180 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 600 KB Output is correct
3 Correct 1 ms 600 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 604 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 604 KB Output is correct
10 Correct 0 ms 604 KB Output is correct
11 Correct 0 ms 604 KB Output is correct
12 Correct 590 ms 35668 KB Output is correct
13 Correct 405 ms 36176 KB Output is correct
14 Correct 515 ms 32848 KB Output is correct
15 Correct 462 ms 32592 KB Output is correct
16 Correct 413 ms 33364 KB Output is correct
17 Correct 471 ms 32624 KB Output is correct
18 Correct 405 ms 32104 KB Output is correct
19 Execution timed out 13069 ms 35116 KB Time limit exceeded
20 Halted 0 ms 0 KB -