4 条题解

  • 0
    @ 2026-2-12 8:25:35

    • 0
      @ 2025-12-30 16:31:34
      #include<bits/stdc++.h>
      using namespace std;
      long long n,a,b,c;
      int main()
      {
          cin>>n;
          for (int i=1;i<=n;i++)
      {
          	cin>>a;
          	if (b!=a)c++;
          	b=a;
      }
          cout<<c;
      }
      
      • 0
        @ 2025-12-17 16:24:32

        #include<bits/stdc++.h> using namespace std; int ans; double s=2,n,y; int main() { cin>>n; while(y<n) { y=y+s; ans++; s=s*0.98; } cout<<ans; }

        • 0
          @ 2025-10-18 16:02:53
          #include <iostream>
          #include <cmath>
          #include <algorithm>
          
          using namespace std;
          
          int main() {
              int Y1, Y2, T1, T2, T;
              cin >> Y1 >> Y2 >> T1 >> T2 >> T;
              
              // 计算赋分
              double Y = Y1 + (double)(Y2 - Y1) * (T - T1) / (T2 - T1);
              
              // 四舍五入
              int result = round(Y);
              
              // 确保结果在Y1和Y2之间(虽然题目保证输入合法)
              result = max(Y1, min(Y2, result));
              
              cout << result << endl;
              
              return 0;
          }
          
          
          • 1

          信息

          ID
          338
          时间
          1000ms
          内存
          512MiB
          难度
          10
          标签
          递交数
          13
          已通过
          0
          上传者