5 条题解

  • 10
    @ 2026-5-16 17:12:09
    可恶的老师出个题也出不明白。
    这题不是常规的思维,它是按总的来计算的
    也就是说这题不能一个一个来计算
    

    代码:

    #include <iostream>
    using namespace std;
    
    int main() {
        int a, b, c, d, e;
        cin >> a >> b >> c >> d >> e;
        
        // 核心:所有人 先 用自己原来的数分成3份,再一起加上
        int t1 = a / 3;
        int t2 = b / 3;
        int t3 = c / 3;
        int t4 = d / 3;
        int t5 = e / 3;
        
        a = t1 + t2 + t5;
        b = t2 + t1 + t3;
        c = t3 + t2 + t4;
        d = t4 + t3 + t5;
        e = t5 + t4 + t1;
    
        cout << a << " " << b << " " << c << " " << d << " " << e;
        return 0;
    }
    

    我得提醒一下,要是题解被曲解成答案的话我看也没有发代码的必要了,因为目前我已经看到5个代码长度和我一样是445比特的了

    • 9
      @ 2026-5-17 11:07:49

      谢谢奶糖(小鸽子)

      • 8
        @ 2026-5-19 19:29:30

        谢谢(小鸽子)

        • 4
          @ 2026-5-21 17:24:24

          谢谢,@(小鸽子)侬孜翌2026dly

        • -2
          @ 2026-5-23 10:09:56

          #include using namespace std;

          int main() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e;

          int t1 = a / 3;
          int t2 = b / 3;
          int t3 = c / 3;
          int t4 = d / 3;
          int t5 = e / 3;
          
          a = t1 + t2 + t5;
          b = t2 + t1 + t3;
          c = t3 + t2 + t4;
          d = t4 + t3 + t5;
          e = t5 + t4 + t1;
          
          cout << a << " " << b << " " << c << " " << d << " " << e;
          return 0;
          

          }

        • 1

        信息

        ID
        30036
        时间
        1000ms
        内存
        256MiB
        难度
        6
        标签
        递交数
        66
        已通过
        20
        上传者