| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 149590 | 杨峻熙 | 优化冒泡排序 | C++ | Time Limit Exceeded | 1000 MS | 272 KB | 323 | 2026-03-14 16:28:16 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,a[2000],t; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i++){ for(int j=0;i<n-1-i;j++){ if(a[j]>a[j+1]){ t=a[j]; a[j]=a[j+1]; a[j+1]=t; } } } for(int i=0;i<n;i++) cout<<a[i]<<" "; return 0; }