Submission #963000

# Submission time Handle Problem Language Result Execution time Memory
963000 2024-04-14T10:41:46 Z n3rm1n Game (IOI13_game) C++17
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
#include "game.h"
using namespace std;

int r, c;
void init(int R, int C)
{
    r = R;
    c = C;
}

long long gcd2(long long X, long long Y) {
   
    long long tmp;
   
    while (X != Y && Y != 0) {
        tmp = X;
        X = Y;
        Y = tmp % Y;
    }
   
    return X;
}
struct point
{
    int x, y;
    long long val;
    point(){};
    point(int _x, int _y, long long _val)
    {
        x = _x;
        y = _y;
        val = _val;
    }
};
vector < point > g;
void update(int P, int Q, long long K)
{
    P ++;
    Q ++;



    g.push_back(point(P, Q, K));

}

long long calculate(int P, int Q, int U, int V)
{
    P ++;
    Q ++;
    U ++;
    V ++;
    long long ans = 0;
    for (int i = 0; i < g.size(); ++ i)
    {
        if(g[i].x >= P && g[i].x <= U && g[i].y >= Q && g[i].y <= V)
            ans = gcd2(ans, g[i].val);
    }
    return ans;
}

Compilation message

game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<point>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for (int i = 0; i < g.size(); ++ i)
      |                     ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -