Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define double long double
- #define _FastIO ios_base::sync_with_stdio(0); cin.tie(0)
- #define F first
- #define S second
- const int mod = 1e9 + 7;
- signed main()
- {
- _FastIO;
- /*
- // E
- int t , n;
- string s;
- cin >> t;
- while(t--){
- cin >> n;
- cin >> s;
- string ans = "";
- ans += s[0];
- char c = s[0];
- for(int i = 1; i < n - 1; i++){
- if(s[i] == c){
- ans += s[i + 1];
- c = s[i + 1];
- i++;
- }
- }
- cout << ans << '\n';
- // abacabac
- }
- */
- // 7 10 1 3 2
- // 1 2 3 7 10
- // 11 3 15 3 2
- // 2 3 3 11 15
- /*
- // F
- int t;
- cin >> t;
- while(t--){
- int n;
- cin >> n;
- int a[n + 5] , b[n + 5];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- b[i] = a[i];
- }
- sort(a , a + n);
- string ans = "YES";
- for(int i = 0; i < n; i++){
- if(a[i] % 2 != b[i] % 2)
- ans = "NO";
- }
- cout << ans << '\n';
- }
- */
- // -1 0 0 -2 1 0 -3 0
- // -1 -2 1 5 6 7 8 9 -3
- // 2 -1 0 -3 -7
- // 2 -1 -3 -7
- /*
- // G
- int t , n , x;
- cin >> t;
- while(t--){
- cin >> n;
- vector<int> v;
- int sum = 0 , cnt = 0;
- for(int i = 0; i < n; i++){
- cin >> x;
- sum += abs(x);
- if(x) // x != 0
- v.push_back(x);
- if(x < 0)
- cnt++;
- }
- for(int i = 1; i < v.size(); i++){
- if(v[i] < 0 && v[i - 1] < 0)
- cnt--;
- }
- cout << sum << " " << cnt << '\n';
- }
- */
- // 1 2 3 4 5 substring subsequence
- // 2 3 4 yes yes
- // 2 4 5 no yes
- // 2 5 4 no no
- /*
- 4 5
- 1011
- 01111
- 100
- 11010
- */
- // 0
- /*
- // H
- int t , n , m;
- string a , b;
- cin >> t;
- while(t--){
- cin >> n >> m;
- cin >> a >> b;
- int j = 0 , cnt = 0;
- for(int i = 0; i < n; i++){
- while(j < m){
- if(b[j] != a[i])
- j++;
- else
- break;
- }
- if(j == m) // tapammadi
- break;
- // beraberdi a[i] == b[j]
- j++;
- cnt++;
- }
- cout << cnt << '\n';
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement