답안 #743331

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
743331 2023-05-17T09:53:50 Z kxd Nicelines (RMI20_nicelines) C++17
컴파일 오류
0 ms 0 KB
#include "nice_lines.h"

#include <bits/stdc++.h>
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define p_q priority_queue
#define m_p make_pair
#define pii pair<int,int>
#define endl '\n'
#define INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define forn(i, n) for (int i = 0; i < n; i++)
#define forn1(i, n) for (int i = 1; i <= n; i++)
#define all(x) x.begin(),x.end()
#define ft first
#define sd second

using namespace std;

void solve(int subtask_id, int N) {
    if(subtask_id != 1){
	    the_lines_are({1},{0});
	    return;
	}
	ld s = -1e12;
	ld e =  1e12;
	forn(i,100){
		ld mid = (s+e)/2;
		ld mid2 = (s+e)/2+0.000001;
		if(query(0,mid) > query(0,mid2)) s = mid;
		else e = mid2;
	}
	ld s2 = s;
	s = 1e12;
	e = -1e12;
	forn(i,100){
		ld mid = (s+e)/2;
		ld mid2 = (s+e)/2+0.000001;
		if(query(1,mid) > query(1,mid2)) s = mid;
		else s = mid2;
	}
	int a = (int)round(s-s2);
	int b = (int)round(s2);
	the_lines_are({a}, {b});
}

Compilation message

nicelines.cpp: In function 'void solve(long long int, long long int)':
nicelines.cpp:46:17: warning: narrowing conversion of 'a' from 'long long int' to 'int' [-Wnarrowing]
   46 |  the_lines_are({a}, {b});
      |                 ^
nicelines.cpp:46:17: warning: narrowing conversion of 'a' from 'long long int' to 'int' [-Wnarrowing]
nicelines.cpp:46:22: warning: narrowing conversion of 'b' from 'long long int' to 'int' [-Wnarrowing]
   46 |  the_lines_are({a}, {b});
      |                      ^
nicelines.cpp:46:22: warning: narrowing conversion of 'b' from 'long long int' to 'int' [-Wnarrowing]
/usr/bin/ld: /tmp/ccAVtm5W.o: in function `main':
grader.cpp:(.text.startup+0x68): undefined reference to `solve(int, int)'
collect2: error: ld returned 1 exit status