이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
//#define endl "\n"
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn=1e5+50;
const ll mod=1e9+7 ;
const ll base=1e18;
/// i believe myself
/// goal 2/7
#include "vision.h"
ll n, m;
ll get(ll x,ll y)
{
return (x*m)+y;
}
void construct_network(int H, int W, int K) {
n=H;
m=W;
ll l=0,h=n-1;
while (l<=h)
{
ll mid=(l+h)/2;
vector<ll> vt;
for (int i=0;i<=mid;i++)
{
for (int j=0;j<m;j++)
{
vt.pb(get(i,j));
}
}
ll valnw=add_or(vt);
if (valnw==1) h=mid-1;
else l=mid+1;
}
ll st=l;
l=0,h=m-1;
while (l<=h)
{
ll mid=(l+h)/2;
vector<ll> vt;
for (int i=0;i<=st;i++)
{
for (int j=0;j<=mid;j++)
{
vt.pb(get(i,j));
}
}
ll valnw=add_or(vt);
if (valnw==1) h=mid-1;
else l=mid+1;
}
ll st1=l;
vector<ll> vt;
for (int i=0;i<n;i++)
{
for (int j=0;j<m;j++)
{
ll h=abs(i-st)+abs(j-st1);
if (h==K) vt.pb(get(i,j));
}
}
add_or(vt);
}
컴파일 시 표준 에러 (stderr) 메시지
vision.cpp:14:15: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
14 | const ll base=1e18;
| ^~~~
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |