답안 #397073

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
397073 2021-05-01T09:37:48 Z Nicholas_Patrick Sure Bet (CEOI17_sure) C++17
20 / 100
326 ms 98860 KB
#include <cstdio>
#include <queue>
#include <cmath>
#include <set>
using namespace std;

struct point{
	long long x, y;
	point(long long x=0, long long y=0):x(x), y(y){}
	bool operator<(point rhs)const{
		if(x!=rhs.x)return x<rhs.x;
		return y<rhs.y;
	}
};
int main(){
	int n;
	scanf("%d", &n);
	if(n>10)return 0;
	set<point> candy;
	candy.emplace();
	vector<point> p(n);
	long long ans=0;
	for(auto& i: p){
		double x, y;
		scanf("%lf%lf", &x, &y), x-=1, y-=1;
		i=point(round(x*10000), round(y*10000));
		auto candycopy=candy;
		for(auto j: candycopy){
			ans=max(ans, min(j.x-10000, j.y+i.y));
			candy.emplace(j.x-10000, j.y+i.y);
		}
		candycopy=candy;
		for(auto j: candycopy){
			ans=max(ans, min(j.x+i.x, j.y-10000));
			candy.emplace(j.x+i.x, j.y-10000);
		}
	}
	printf("%.4lf\n", ans/10000.0);
}

Compilation message

sure.cpp: In function 'int main()':
sure.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   17 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
sure.cpp:25:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   25 |   scanf("%lf%lf", &x, &y), x-=1, y-=1;
      |   ~~~~~^~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 325 ms 98336 KB Output is correct
4 Correct 324 ms 98860 KB Output is correct
5 Correct 314 ms 98740 KB Output is correct
6 Correct 326 ms 98244 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 325 ms 98336 KB Output is correct
4 Correct 324 ms 98860 KB Output is correct
5 Correct 314 ms 98740 KB Output is correct
6 Correct 326 ms 98244 KB Output is correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 325 ms 98336 KB Output is correct
4 Correct 324 ms 98860 KB Output is correct
5 Correct 314 ms 98740 KB Output is correct
6 Correct 326 ms 98244 KB Output is correct
7 Incorrect 1 ms 204 KB Output isn't correct
8 Halted 0 ms 0 KB -