CẶP SỐ CHẴN

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 1.0s
Memory limit: 512M
Input: stdin
Output: stdout

Problem type
Allowed languages
C++, Pascal, Python, Scratch


Comments

Please read the guidelines before commenting.



  • 0
    kha   commented on May 19, 2023, 11:42 a.m. edited

    ai có công thức tổ hợp ko=))))


    • -1
      tuattsx3   commented on May 30, 2023, 7:43 p.m.

      n = int(input()) sc = n//2 sl = n-sc if n%2!=0: sl-=1 tsl = sl(sl+1)//2 x = n-1 if x%2==0: sh = (x-2)//2+1 tsc = sh(x+2)//2 else: sh = (x-1)//2+1 tsc = sh*(x+1)//2 print(tsc+tsl)


  • -1
    TEST   commented on May 17, 2023, 11:37 p.m.

    :)) ai có công thức tổ hợp ko chứ dùng for 2 vòng ếu dc


    • -2
      tuattsx3   commented on May 30, 2023, 7:44 p.m.

      n = int(input()) sc = n//2 sl = n-sc if n%2!=0: sl-=1 tsl = sl(sl+1)//2 x = n-1 if x%2==0: sh = (x-2)//2+1 tsc = sh(x+2)//2 else: sh = (x-1)//2+1 tsc = sh*(x+1)//2 print(tsc+tsl)


  • 0
    Hnhnamtb   commented on May 16, 2023, 8:06 p.m.

    Nếu những bạn học sinh vào có kinh nghiệm thì bài này chắc đối với họ sẽ dễ hơn so với những người mới thi được 1,2 năm.


  • 0
    Abcntt00   commented on May 8, 2023, 7:28 a.m.

    k hiểu gì cả, ai giúp tuii với ạa :<<


  • 0
    khanhlinhle   commented on April 26, 2023, 5:42 p.m.

    :)) dùng công thức tổ hợp thôi mấy man


  • -5
    nguyendung2k10   commented on April 6, 2023, 10:28 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -11
    nguyendung2k10   commented on April 6, 2023, 10:28 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -1
    nguyendung2k10   commented on April 6, 2023, 10:27 a.m.

    chi tui cach lam di


  • -3
    duybao6B   commented on April 5, 2023, 4:44 p.m. edited

    bai nay de qua


  • 0
    RinmeiZumi   commented on March 14, 2023, 12:43 p.m.

    bai nay de nha :))


    • 0
      Ducnomax   commented on May 18, 2023, 8:43 p.m.

      phun test ko


  • -7
    nguyen_ngoc_minh5b   commented on July 9, 2022, 9:56 p.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 3
    vancongnam   commented on July 5, 2022, 10:20 p.m. edit 6

    Bài này dùng công thức nha mọi người. Spoiler cho bài CẶP SỐ CHẴN

    Subtask 1: n <= 10^3

    Để A x B là số chẵn khi A hoặc B là số chẵn

    Công thức tính số lượng số chẵn nhỏ hơn hoặc bằng n: floor(n / 2) (làm tròn xuống của n / 2)

    Công thức tính số lượng cặp số chẵn:

    answer = Số lượng cặp số có 1 trong 2 số là số chẵn - Số lượng cặp số có cả 2 đều là số chẵn

    Subtask 2: n <= 10^9

    => Có thể dùng Python hoặc long long nếu sử dụng ngôn ngữ C++


    • -6
      Hungvt   commented on July 8, 2022, 10:08 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -4
    Phong   commented on July 5, 2022, 4:57 p.m.

    bài quá khó


  • -2
    quangminhvt   commented on July 1, 2022, 3:28 p.m.

    AB la so nguyen duong luon ha moi nguoi? 🙄🙄🙄


  • -3
    SK_A_118   commented on July 1, 2022, 9:14 a.m.

    khá khó đấy


  • -4
    quangminhvt   commented on June 30, 2022, 2:49 p.m.

    Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó Khó


  • -5
    ntdungtb01   commented on June 29, 2022, 9:30 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.