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;
- /*
- // A
- int n;
- cin >> n;
- int a[n + 5];
- for(int i = 0; i < n; i++)
- cin >> a[i];
- sort(a , a + n);
- cout << a[n - 1] - a[0] << '\n';
- */
- /*
- string s;
- cin >> s;
- map<char , int> cnt;
- int x = 0;
- for(char i : s){
- cnt[i]++;
- x = max(x , cnt[i]);
- }
- for(auto i : cnt){
- // i.F - char (karakter)
- // i.S - int (sayi)
- if(i.S == x){
- cout << i.F << '\n';
- return 0;
- }
- }
- */
- /*
- // C
- int n;
- cin >> n;
- int a[n + 5] , b[n + 5];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- for(int i = 0; i < n; i++){
- cin >> b[i];
- }
- int ans = 0;
- for(int i = 0; i < n; i++){
- if(a[i] > b[i])
- ans += a[i] - b[i];
- }
- cout << ans << '\n';
- */
- /*
- abc
- axbxyc
- */
- /*
- // D
- string a , b;
- cin >> a >> b;
- int n = a.size() , m = b.size();
- int i = 0;
- for(int j = 0; j < m; j++){
- if(a[i] == b[j]){
- i++;
- cout << j + 1 << " ";
- }
- if(i == n)
- break;
- }
- cout << '\n';
- */
- /*
- 1 3
- 2 1
- abs(1 - 2) = 1
- abs(3 - 1) = 2
- */
- /*
- // E
- int n , m;
- cin >> n >> m;
- char c;
- vector<pair<int , int> > v;
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= m; j++){
- cin >> c;
- if(c == 'o')
- v.push_back({i , j});
- }
- }
- int ans = abs(v[0].F - v[1].F) + abs(v[0].S - v[1].S);
- cout << ans << '\n';
- */
- // 1 2 3 4 5
- // 1 3 4 5 2
- // 3 4 2 1
- // 1 4 2 2
- /*
- // F
- int n;
- cin >> n;
- int a[n + 5];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- int ans = 0;
- for(int i = 1; i < n - 1; i++){
- if(a[i - 1] < a[i] && a[i] < a[i + 1])
- ans++;
- if(a[i - 1] > a[i] && a[i] > a[i + 1])
- ans++;
- }
- cout << ans << '\n';
- */
- /*
- // G
- int n , m;
- cin >> n >> m;
- string a , b;
- cin >> a >> b;
- bool p = 0 , s = 0;
- if(b.substr(0 , n) == a) // prefix
- p = 1;
- if(b.substr(m - n) == a) // suffix
- s = 1;
- if(p && s)
- cout << 0;
- else if(p && !s)
- cout << 1;
- else if(!p && s)
- cout << 2;
- else
- cout << 3;
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement