Submission #79437
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | #include<algorithm> #include<iostream> #include<math.h> #include<stdio.h> #include<vector> #include<limits.h> #include<string> #include<queue> #include<stack> #include<deque> #include<vector> #define endl "\n" using namespace std; int main(){ int n; cin >> n; priority_queue< int >q; for ( int i = 0; i < n; i++ ){ int x; cin >> x; q.push(x); } for ( int i = 0; i < n; i++ ){ cout << q.top() << endl; q.pop(); } return (0); } /*int n; cin >> n; priority_queue<int,vector<int>,greater<int>>d; for( int i = 0; i < n; i++){ int x; cin >> x; if( x == 1 ){ int s; cin >> s; d.push(s); }else if( x == 2 ){ cout << d.top() << endl; }else{ d.pop(); } } return(0); }*/ /*int n; cin >> n; deque<string>d; for(int i = 0; i < n; i++){ int x; cin >> x; if( x == 1 ){ string s; cin >> s; d.push_front(s); }else if( x == 2 ){ cout << d.front() << endl; }else{ d.pop_front(); } } return 0; }*/ |
ステータス
項目 | データ |
---|---|
問題 | 1778 - 大きい順 |
ユーザー名 | kamba |
投稿日時 | 2024-07-03 16:44:47 |
言語 | C++ |
状態 | Accepted |
得点 | 4321 |
ソースコード長 | 1179 Byte |
最大実行時間 | 21 ms |
最大メモリ使用量 | 604 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 4321 / 4321 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 18 ms | 604 KB |
1
|
in2.txt | AC | 15 ms | 448 KB |
1
|
in3.txt | AC | 21 ms | 544 KB |
1
|
in4.txt | AC | 18 ms | 520 KB |
1
|
in5.txt | AC | 17 ms | 492 KB |
1
|