artemgf

Задача A. Маленький принц поливает Розу

Nov 18th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <algorithm>
  6. #include <vector>
  7. #include <map>
  8. #include <queue>
  9. #include <set>
  10. #include <stack>
  11.  
  12. using namespace std;
  13.  
  14. typedef long long ll;
  15.  
  16. int main()
  17. {
  18.     ll n;
  19.     cin >> n;
  20.     for (int i = 1; i <= n; i++)
  21.     {
  22.         ll prom;
  23.         cin >> prom;
  24.         if (prom == 1)
  25.         {
  26.             cout << i << " " << i;
  27.             return 0;
  28.         }
  29.     }
  30.     cout << -1;
  31.     _getch();
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment