DuongNhi99

RECEPT

Nov 30th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3. using namespace std;
  4.  
  5. const int N = 1e5 + 5;
  6.  
  7. int n, m;
  8. int b[N];
  9. vector<int> ans;
  10.  
  11. int main()
  12. {
  13.     //freopen("in.txt", "r", stdin);
  14.     freopen("RECEPT.inp", "r", stdin);
  15.     freopen("RECEPT.out", "w", stdout);
  16.     ios_base::sync_with_stdio(false);
  17.     cin.tie(NULL); cout.tie(NULL);
  18.  
  19.     cin >> n >> m;
  20.     for(int i = 1; i <= m; ++i)
  21.         cin >> b[i];
  22.  
  23.     for(int i = 1; i <= m; ++i) {
  24.         for(int j = 1; j <= b[i] - b[i-1]; ++j)
  25.             cout << i << ' ';
  26.     }
  27.  
  28.     return 0;
  29. }
  30.  
Add Comment
Please, Sign In to add comment