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)
- int dif(string a , string b){
- int cnt = 0;
- for(int i = 0; i < a.size(); i++)
- cnt += a[i] != b[i];
- return cnt;
- }
- int sum(int n){
- int s = 0;
- while(n){
- s += n % 10;
- n /= 10;
- }
- return s;
- }
- signed main()
- {
- _FastIO;
- /*
- // H
- string a , b;
- cin >> a >> b;
- int n = a.size() , m = b.size();
- int ans = m;
- for(int i = 0; i + m < n; i++){
- ans = min(ans , dif(a.substr(i , m) , b));
- }
- cout << ans << '\n';
- */
- /*
- // I
- int n , m;
- cin >> n >> m;
- char a[n + 5][m + 5];
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= m; j++){
- cin >> a[i][j];
- }
- }
- for(int i = 0; i <= n + 1; i++){
- for(int j = 0; j <= m + 1; j++){
- if(!i || !j || i == n + 1 || j == m + 1)
- cout << "#";
- else
- cout << a[i][j];
- }
- cout << '\n';
- }
- */
- /*
- // J
- int n , d;
- cin >> n >> d;
- int x[n + 5][d + 5];
- for(int i = 0; i < n; i++){
- for(int k = 0; k < d; k++){
- cin >> x[i][k];
- }
- }
- // 0 <= i < j < n
- int ans = 0;
- for(int i = 0; i < n; i++){
- for(int j = i + 1; j < n; j++){
- int sum = 0;
- for(int k = 0; k < d; k++){
- sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
- }
- int sq = sqrtl(sum);
- if(sq * sq == sum)
- ans++;
- }
- }
- cout << ans << '\n';
- */
- /*
- // K
- int n;
- cin >> n;
- int L[n + 1];
- L[0] = 2;
- L[1] = 1;
- for(int i = 2; i <= n; i++){
- L[i] = L[i - 1] + L[i - 2];
- }
- cout << L[n] << '\n';
- */
- /*
- // L
- int n , a , b;
- cin >> n >> a >> b;
- int ans = 0;
- for(int i = 1; i <= n; i++){
- if(a <= sum(i) && sum(i) <= b)
- ans += i;
- }
- cout << ans << '\n';
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement