| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 114375 | 梁乃元 | 最后一块石头的重量 | C++ | Wrong Answer | 66 | 0 MS | 256 KB | 558 | 2023-12-07 13:32:29 |
# include <bits/stdc++.h> using namespace std ; int stn [114514] ; int lsw ( int a [] , int sze ) { int i , j , t ; while ( sze > 1 ) { for ( i = 0 ; i < 2 ; i ++ ) { for ( j = 0 ; j < sze - i - 1 ; j ++ ) { if ( a [j] > a [j + 1] ) { swap ( a [j] , a [j + 1] ) ; } } } a [sze - 2] = a [sze - 1] - a [sze - 2] ; sze -- ; } return a [0] ; } int main ( ) { int n ; cin >> n ; for ( int i = 0 ; i < n ; i ++ ) { cin >> stn [i] ; } cout << lsw ( stn , n ) << endl ; return 0 ; }