TLE
  • 板块灌水区
  • 楼主timestimes_2022
  • 当前回复7
  • 已保存回复7
  • 发布时间2024/10/4 14:18
  • 上次更新2024/10/4 14:41:08
查看原帖
TLE
1404097
timestimes_2022楼主2024/10/4 14:18

为什么T? 题目:

代码:

#include <bits/stdc++.h>
using namespace std;
int main()
{
    freopen("expressionB.in","r",stdin);
    freopen("expressionB.out","w",stdout);
    int ans = 0;
    string a;
    cin >> a;
    for(int i = 0;i < (int)a.length();i++)
    {
        for(int j = i;j < (int)a.length();j++)
        {
            if(a[i] < a[j])
            {
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}
2024/10/4 14:18
加载中...