Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- #include<utility>
- #include <queue>
- #define ll long long
- #define ull unsigned long long
- #define pi 3.14159
- #define OO 2000000000
- //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- using namespace std;
- void yasmeen_fakhri(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve(){
- ll n,m;
- cin>>n>>m;
- priority_queue<int, vector<int>, greater<int> > cinema ;
- for(int i =1 ; i <= n ; i++){
- cinema.push(i);
- }
- for(int j =0 ; j<m ; j++){
- if ( n == 1 ){
- cout<<cinema.top()<<'\n';
- cinema.pop();
- }
- if (n == 2 ){
- ll o; cin>>o;
- cinema.push(o);
- }
- }
- }
- int main() {
- yasmeen_fakhri();
- int test =1;
- //cin>>test;
- while(test--){
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement