#33662: TLE怎麼辦


yp11151165@yphs.tp.edu.tw (805-39 陳奕嘉)

學校 : 臺北市私立延平高級中學
編號 : 197062
來源 : [150.117.201.71]
最後登入時間 :
2024-03-10 15:53:28
i706. B.永遠ㄉ神(yyds) -- 2022成功高中校內賽 | From: [150.117.201.71] | 發表日期 : 2023-01-19 17:11

#include
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    int n,i;
    while(cin>>n){
        int h[n],t=0;
        for(i=1;i<=n;i++){
            cin>>h[i];
        }
        for(i=1;i<=n;i++){
            for(int j=i;j>=1;j--){
                if(h[j]<h[i]){
                    t=j;
                    break;
                }
            }
            cout<<t<<" ";
            t=0;
        }
    }
}

 
ZeroJudge Forum