Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
134782 梁乃元 紧急集合 C++ 解答错误 0 0 MS 248 KB 490 2024-03-02 17:38:43

Tests(0/10):


# include <bits/stdc++.h> using namespace std ; int a [20005] , b [20005] , t [20005] ; priority_queue <int , vector <int> , greater <int> > q ; int main ( ) { int n , ans = 0 ; cin >> n ; for ( int i = 1 ; i <= 0 ; i ++ ) { int t ; cin >> t ; q . push ( t ) ; } while ( q . size ( ) >= 2 ) { int a = q . top ( ) ; q . pop ( ) ; int b = q . top ( ) ; q . pop ( ) ; ans += a + b ; q . push ( a + b ) ; } cout << ans << endl ; return 0 ; }


测评信息: