10 solutions

  • 1
    @ 2025-8-28 20:43:20

    #include #include #include

    using namespace std;

    int main() { int n; cin >> n; vector sum_t(24, 0); // 存储每个UTC小时t对应的工人总数,用long long防止溢出

    for (int i = 0; i < n; ++i) {
        int w, x;
        cin >> w >> x;
        // 当地起始小时h需在9-17之间,计算对应的UTC时间t并累加工人数量
        for (int h = 9; h <= 17; ++h) {
            int t = (h - x + 24) % 24;  // +24确保结果为非负数,再取模24得到0-23的UTC时间
            sum_t[t] += w;
        }
    }
    
    // 找到最大的工人数量
    cout << *max_element(sum_t.begin(), sum_t.end()) << endl;
    
    return 0;
    

    }

    • 0
      @ 2026-6-26 21:53:18
      #include #include #include
      
      using namespace std;
      
      int main() { int n; cin >> n; vector sum_t(24, 0); // 存储每个UTC小时t对应的工人总数,用long long防止溢出
      
      for (int i = 0; i < n; ++i) {
          int w, x;
          cin >> w >> x;
          // 当地起始小时h需在9-17之间,计算对应的UTC时间t并累加工人数量
          for (int h = 9; h <= 17; ++h) {
              int t = (h - x + 24) % 24;  // +24确保结果为非负数,再取模24得到0-23的UTC时间
              sum_t[t] += w;
          }
      }
      
      // 找到最大的工人数量
      cout << *max_element(sum_t.begin(), sum_t.end()) << endl;
      
      return 0;
      
      • -1
        @ 2025-7-3 11:42:32
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
           
            return 0;
            
        }
        
        • -2
          @ 2025-7-4 11:23:42

          666

          • -2
            @ 2025-7-4 11:23:29

            #include #include #include

            using namespace std;

            int main() { int n; cin >> n; vector sum_t(24, 0); // 存储每个UTC小时t对应的工人总数,用long long防止溢出

            for (int i = 0; i < n; ++i) {
                int w, x;
                cin >> w >> x;
                // 当地起始小时h需在9-17之间,计算对应的UTC时间t并累加工人数量
                for (int h = 9; h <= 17; ++h) {
                    int t = (h - x + 24) % 24;  // +24确保结果为非负数,再取模24得到0-23的UTC时间
                    sum_t[t] += w;
                }
            }
            
            // 找到最大的工人数量
            cout << *max_element(sum_t.begin(), sum_t.end()) << endl;
            
            return 0;
            

            }

            • -2
              @ 2025-7-4 11:23:02

              #include #include #include

              using namespace std;

              int main() { int n; cin >> n; vector sum_t(24, 0); // 存储每个UTC小时t对应的工人总数,用long long防止溢出

              for (int i = 0; i < n; ++i) {
                  int w, x;
                  cin >> w >> x;
                  // 当地起始小时h需在9-17之间,计算对应的UTC时间t并累加工人数量
                  for (int h = 9; h <= 17; ++h) {
                      int t = (h - x + 24) % 24;  // +24确保结果为非负数,再取模24得到0-23的UTC时间
                      sum_t[t] += w;
                  }
              }
              
              // 找到最大的工人数量
              cout << *max_element(sum_t.begin(), sum_t.end()) << endl;
              
              return 0;
              

              }

              • -2
                @ 2025-7-4 9:46:41

                cin>>a;

                • -2
                  @ 2025-7-4 9:45:37

                  有点意思

                  • -2
                    @ 2025-7-4 9:40:55

                    ??????????????????????????????????????????????????????????????????????????????????????

                    • -2
                      @ 2025-7-3 11:42:22

                      • 1

                      Information

                      ID
                      2611
                      Time
                      1000ms
                      Memory
                      256MiB
                      Difficulty
                      8
                      Tags
                      (None)
                      # Submissions
                      50
                      Accepted
                      8
                      Uploaded By