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/HHCN #450

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

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

https://luyencode.net/problem/HHCN

tuankietcoderr commented 3 years ago

bài này ít ra phải cho 1 giải thích case mẫu để mn hiểu hơn chứ

Justinianus2001 commented 3 years ago

Time limit quá khắc khe, thành ra bóp nghẹt tư duy sáng tạo.

Dam-Tieu-Mac commented 3 years ago

mình làm thế này, không biết sai chỗ nào mà không thể nộp bài được :)))

Xem code AC

```cpp #include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long S1, S2, S3, c, d, r; cin >> S1 >> S2 >> S3; c = sqrt((S2 * S3) / S1); d = S2/ c; r = S1 / d; cout << ((d + r + c)*4) ; return 0; } ```

ApokPhuoc commented 2 years ago

@Dam-Tieu-Mac Lừa hay đấy :))

canhnam357 commented 2 years ago

nộp 4 lần thì AC lần lượt là 25/30 , 27/30 , 29/30 , 30/30 =))

Minkuan7824 commented 2 years ago

kh giải thích test 2 lại đi giải thích test 1 =))

Dam-Tieu-Mac commented 2 years ago

ko đọc kĩ đề, chin nhỗi :>>> @ApokPhuoc

barbatos1 commented 2 years ago

Giới hạn là 5ms mà bài mình 3ms cũng time limit là sao nhỉ

son857764 commented 2 years ago

python3 làm kiểu gì với 5 ms?

gnaigsolo commented 2 years ago

Đồng dư thức và sử dụng công thức đã chứng minh O(1)

shiinehata commented 2 years ago

Time limit bài này bruh quá =)))) Cùng 1 code nộp vài lần mới AC.

hoangdang20 commented 2 years ago

nộp lại cùng 1 bài nhưng mỗi lần lại ra số case đúng khác nhau =)) test nhân phẩm hả tr

nhathoa25 commented 2 years ago

0ms cũng ra Time limit :))

nhathoa25 commented 2 years ago

em xin chịu thua :((

Akine2606 commented 1 year ago

30/30 test dưới 5ms mà sao TLE nhỉ? 👀

TrinhDuongHoan commented 1 year ago

time limit bài này ảo vải :))))

Khangdanghoccode commented 1 year ago

Bài này mình sai chỗ nào mà bị time exceeded vậy mọi người

include

include

int main() { int s1, s2, s3; int total; scanf("%d %d %d", &s1, &s2, &s3);

int a = sqrt(s2)sqrt(s3)/s1; int b= s2/a; int h=s1/b; printf("%d", 4(a+b+h));

return 0; }

vminhh commented 1 year ago

toàn time limit exceeded

102210292githug commented 1 year ago

Đây là lời giải của mình đã AC. Nếu bạn đã cố gắng mà chưa làm được thì có thể tham khảo lời giải của mình.

#include <iostream>
#include <cmath>

#define MOD 1000000007

void solve() {
    long double s1, s2, s3;
    std::cin >> s1 >> s2 >> s3;

    s2 = s1 * s2 / s3;
    s2 = std::sqrt(s2);
    s1 /= s2;
    s3 /= s1;

    long long result = static_cast<long long>((s1 + s2 + s3) * 4LL) % MOD;

    std::cout << result << std::endl;
}

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int t = 1;
    // std::cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}