Advertisement
askarulytarlan

снековик

Mar 3rd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int n,i,a[100001],x,t;
  7.  
  8. int main() {
  9. int n;
  10. cin >> n;
  11. t = n;
  12. for(i = 0;i < n; i++)
  13. {
  14. cin >> x;
  15. a[x]++;
  16. while(a[t]){
  17. cout << t << " ";
  18. t--;
  19. }
  20. cout << endl;
  21.  
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement