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 = 998244353; // 1e9 + 7
- bool pal(string a){
- string b = a;
- reverse(b.begin() , b.end());
- return a == b;
- }
- signed main()
- {
- _FastIO;
- /*
- // A
- int n;
- cin >> n;
- int k = sqrtl(n);
- cout << k * k << '\n';
- */
- /*
- // B
- string a , b;
- cin >> a >> b;
- a += b;
- int n = stoll(a);
- int k = sqrtl(n);
- // pow(double) , powl(long double)
- if(k * k == n)
- cout << "Yes";
- else
- cout << "No";
- */
- /*
- // C
- int n;
- cin >> n;
- while(n % 2 == 0)
- n /= 2;
- while(n % 3 == 0)
- n /= 3;
- cout << (n == 1 ? "Yes" : "No") << '\n';
- */
- /*
- // D
- int n;
- cin >> n;
- int x = n % mod;
- if(x < 0)
- x += mod;
- cout << x << '\n';
- */
- /*
- (12 - x) % 5 == 0
- */
- /*
- // E
- string s;
- cin >> s;
- int cnt = 0 , ans = 0;
- for(char i : s){
- if(i == 'A' || i == 'C' || i == 'G' || i == 'T')
- cnt++;
- else
- cnt = 0;
- ans = max(ans , cnt);
- }
- cout << ans << '\n';
- */
- /*
- // E
- string s;
- cin >> s;
- map<char , int> cnt;
- for(char i : s)
- cnt[i]++;
- map<int , int> dif;
- for(auto i : cnt)
- dif[i.S]++;
- string ans = "Yes";
- for(auto i : dif)
- if(i.S != 2)
- ans = "No";
- cout << ans << '\n';
- */
- /*
- // G
- int n;
- string s;
- cin >> n >> s;
- for(int i = 1; i < n; i++){
- int k = 0;
- while(k + i < n && s[k] != s[k + i])
- k++;
- cout << k << '\n';
- }
- */
- /*
- // H
- int n;
- cin >> n;
- int a[n + 5];
- int x = 0 , y = 0 , s = 0;
- for(int i = 0; i < n; i++){
- cin >> a[i];
- s += a[i];
- }
- int ans = LLONG_MAX;
- for(int i = 0; i + 1 < n; i++){
- x += a[i];
- y = s - x;
- ans = min(ans , abs(x - y));
- }
- cout << ans << '\n';
- */
- /*
- // I
- string s;
- cin >> s;
- int n = s.size();
- string x = s.substr(0 , n / 2);
- string y = s.substr((n + 1) / 2);
- if(pal(s) && pal(x) && pal(y))
- cout << "Yes";
- else
- cout << "No";
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement