| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 137184 | 古浩圳bylz | 车厢重组 | C++ | Time Limit Exceeded | 91 | 1656 MS | 640 KB | 282 | 2024-03-09 17:40:33 |
#include<iostream> using namespace std; int main(){ int a[100000]={0},c,b=1,i=1,j=0; cin>>c; while(b<=c){ cin>>a[b]; b++; } for(b=1;b<=c-1;b++){ for(i=1;i<=c-b;i++){ if(a[i]>a[i+1]){ swap(a[i],a[i+1]); j++; } } } cout<<j; return 0; }