답안 #560126

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
560126 2022-05-11T05:33:50 Z fcmalkcin Vision Program (IOI19_vision) C++17
0 / 100
2 ms 2296 KB
#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);
}

Compilation message

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;
      |               ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 304 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2296 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -