问题标题: 酷町堂:3827

0
0
已解决
吕牧原
吕牧原
高级守护
高级守护
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
double a[100000001];
int main()
{
    int n;
    cin>>n;
    double t;
    for(int i=1;i<=n;i++)
    {
        cin>>t;
        a[(int)t]++;
    }
    for(double i=1;i<=100000001;i++)
    {
        for(int j=1;j<=a[(int)i];j++)
        {

            cout<<i<<endl;
        }
    }
    return 0;
}

Runtime Error?!!!

越界?!!!

 


0
已采纳
董子墨
董子墨
中级天翼
中级天翼

吕牧原 

酷町堂一维不能超过25000000(两千五百万),二维不能超过5000000*5000000(五百万乘五百万)

董子墨在2019-09-09 19:57:51追加了内容

酷町堂一维数组不能超过25000000(两千五百万),二维数组不能超过5000000*5000000(五百万乘五百万)

董子墨在2019-09-09 20:35:48追加了内容

学了sort和结构体了吗?别用桶,用sort。

0
吕牧原
吕牧原
高级守护
高级守护

我只用sort

bool cmp(string a,string b)
{
    if(a[a.size()-1]!=b[b.size()-1])
        return a[a.size()-1]>b[b.size()-1];
    else if(a.size()!=b.size())
        return a.size()<b.size();
    return a<b;
}

 

我要回答