| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 116986 | 梁乃元 | 买卖股票的最佳时机 | C++ | Wrong Answer | 0 | 0 MS | 260 KB | 392 | 2023-12-21 13:34:18 |
# include <bits/stdc++.h> using namespace std ; int c [114514] ; int main ( ) { int a , e ; cin >> a ; for ( int i = 1 ; i <= a ; i ++ ) { cin >> c [i] ; } for ( int i = 1 ; i <= a ; i ++ ) { for ( int j = i + 1 ; j <= a ; j ++ ) { if ( c [j] > c [i] ) { e = e >= c [j] - c [i] ? e : c [j] - c [i] ; } } } cout << e << endl ; return 0 ; }