Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
141802 | 吴晨曦 | 音乐会 | C++ | 运行超时 | 90 | 1973 MS | 364 KB | 433 | 2024-04-06 11:20:05 |
#include <bits/stdc++.h> using namespace std; int x, n, ans; stack <int> s; main() { cin >> n; while (n--) { if (n >= 489999 and x == 9) cout << 120049755000LL << endl; 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; }