| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 142716 | 罗嘉为 | 音乐会 | C++ | Time Limit Exceeded | 90 | 2003 MS | 376 KB | 391 | 2024-04-08 22:32:47 |
#include <bits/stdc++.h> using namespace std; int x, n, ans; stack<int> s; int main(){ cin >> n; while(n--){ cin >> x; int t = 1; while(s.size() && x >= s.top()){ if(s.top() == x) t++; ans++; s.pop(); } if(s.size()) ans++; while(t--) s.push(x); } cout << ans; return 0; }