이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include<bits/stdc++.h>
#define el '\n'
#define fi first
#define sc second
#define pii pair<int, int>
#define all(v) v.begin(), v.end()
using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
const int mod=1e9+7;
const int N=1e5+11;
ll m, n;
ll gcd(ll x, ll y)
{
__gcd(x, y);
}
struct node1
{
ll l, r, ss;
node1 *left, *right;
node1(ll _l, ll _r)
{
l = _l;
r = _r;
ss = 0;
left = right = NULL;
}
void down()
{
if (l != r && left == NULL)
{
ll mid=(l+r)>>1;
left = new node1(l, mid);
right = new node1(mid+1, r);
}
}
void update(ll i, ll v)
{
if (r < i || i < l) return;
down();
if (l == r)
{
ss = v;
return;
}
left->update(i, v);
right->update(i, v);
ss = gcd(left->ss, right->ss);
}
ll get(ll a, ll b)
{
if (r < a || b < l) return 0;
down();
if (a <= l && r <= b) return ss;
return gcd(left->get(a, b), right->get(a, b));
}
};
struct node2
{
ll l, r, ss;
node2 *left, *right;
node1 *node;
node2(ll _l, ll _r)
{
l = _l;
r = _r;
ss = 0;
left = right = NULL;
node = new node1(0, 1e9);
}
void down()
{
if (l!=r && left == NULL)
{
ll mid=(l+r)>>1;
left = new node2(l, mid);
right = new node2(mid+1, r);
}
}
void update(ll x, ll y, ll val)
{
if (r<x || x<l) return;
down();
node->update(y, val);
if (l==r) return;
left->update(x, y, val);
right->update(x, y, val);
}
ll get(ll x, ll y, ll u, ll v)
{
if (r<x || u<l) return 0LL;
down();
if (x<=l && r<=u) return node->get(y, v);
return gcd(left->get(x, y, u, v), right->get(x, y, u, v));
}
}*root;
void init(int R, int C)
{
m = R;
n = C;
root = new node2(0, 1e9);
}
void update(int P, int Q, long long K)
{
root->update(P, Q, K);
}
long long calculate(int P, int Q, int U, int V)
{
return root->get(P, Q, U, V);
}
컴파일 시 표준 에러 (stderr) 메시지
game.cpp: In function 'll gcd(ll, ll)':
game.cpp:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |