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;
- int cnt(int n){ // number of digits
- int s = 0;
- while(n){
- s++;
- n /= 10;
- }
- return s;
- }
- bool pal(string s){
- string h = s;
- reverse(h.begin() , h.end());
- return s == h;
- }
- signed main()
- {
- _FastIO;
- /*
- // H
- string s;
- cin >> s;
- for(int i = 0; i < s.size(); i += 2)
- cout << s[i];
- */
- /*
- // I
- int n;
- cin >> n;
- int ans = 0;
- for(int i = 1; i <= n; i++){
- ans += cnt(i) % 2;
- }
- cout << ans << '\n';
- */
- /*
- J
- int n;
- cin >> n;
- string a[n + 5];
- for(int i = 0; i < n; i++)
- cin >> a[i];
- string ans = "No";
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- if(i == j)
- continue;
- // i != j
- if(pal(a[i] + a[j]))
- ans = "Yes";
- }
- }
- cout << ans << '\n';
- */
- /*
- // K
- int n , m;
- string s;
- cin >> n >> m;
- int cnt[m + 5] = {0};
- for(int i = 0; i < n; i++){
- cin >> s;
- for(int j = 0; j < m; j++){
- if(s[j] == 'x')
- cnt[j + 1]++;
- }
- }
- int x = 0 , ans = 0;
- for(int i = 1; i <= m; i++){
- if(!cnt[i])
- x++;
- else
- x = 0;
- ans = max(ans , x);
- }
- cout << ans << '\n';
- */
- /*
- // y = k * x + b
- // L
- int n;
- cin >> n;
- int x[n + 5] , y[n + 5];
- for(int i = 0; i < n; i++){
- cin >> x[i] >> y[i];
- }
- int ans = 0;
- for(int i = 0; i < n; i++){
- for(int j = i + 1; j < n; j++){
- // x[i] y[i]
- // x[j] y[j]
- double k = (y[j] - y[i]) * 1.0 / (x[j] - x[i]);
- if(-1 <= k && k <= 1)
- ans++;
- }
- }
- cout << ans << '\n';
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement