8 solutions

  • 0
    @ 2026-11-5 19:16:22
    #include <bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        int N;
        cin >> N;
        int r = N % 5;   //看在两个水站中间的哪个位置
        if (r <= 2) {
            cout << N - r << endl;      // 往下退到上一个水站
        } else {
            cout << N + (5 - r) << endl;// 往上补到下一个水站
        }
        return 0;
    }
    

    Information

    ID
    2322
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    224
    Accepted
    96
    Uploaded By