luyencode / comments

Server lưu trữ bình luận trên Luyện Code
https://luyencode.net
6 stars 3 forks source link

https://oj.luyencode.net/problem/EXPLORE #679

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Chi tiết bài tập - Luyện Code Online

https://luyencode.net/problem/EXPLORE

Conganhluan commented 2 years ago

Đề này mình chưa được hiểu lắm, nếu như Bessie đi từ 0 đến -7, sau đó đi ngược về 10 thì chỉ mất 24 phút thôi mà. Như vậy thì ví dụ đề cho phải có kết quả là 5 chứ

minhchi1509 commented 2 years ago

Phải thăm theo lần lượt khoảng cách của nó đến trại bạn à, nghĩa là 0 => 1 => -3 =>7

Anptit commented 2 years ago

gợi ý cho ai cần: bài này sort theo giá trị tuyệt đối rồi giải nhé

sseu18042004 commented 1 year ago

hint nhỏ: mọi người đọc kĩ đề là ưu tiên thứ tự khoách cách với TRẠI :)) khá là lừa nếu đọc lướt nên sort bằng stable_sort( , , cmp) ( hàm bool này return abs(a)<abs(b)) Nếu chưa ra có thể tham khảo

khá dễ hiểu

#include #define ll long long int #define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define el cout<<"\n" #define f0(i,n) for (int i=0;i>t>>n; ll a[n]; for (int i=0;i>a[i]; } stable_sort(a,a+n,cmp); if (abs(a[0])>t) {cout<<0; return 0;} ll res=abs(a[0]); int cnt=1; for(int i=1;i