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
- signed main()
- {
- _FastIO;
- /*
- // A
- int n;
- cin >> n;
- int x = n / 10;
- if(n < 0 && n % 10)
- x--;
- cout << x << '\n';
- */
- /*
- // B
- string s;
- cin >> s;
- int sum = 0;
- for(char i : s)
- sum += i - '0';
- if(sum % 9 == 0)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- */
- // 10^(2e5) 10^18
- /*
- string s;
- cin >> s;
- int x;
- cin >> x;
- int n = 0;
- for(char i : s){
- n = 10 * n + i - '0';
- n %= x;
- }
- if(n == 0)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- // 3645 5
- // 3600 % 500
- // 1007 % 9 = 8
- */
- /*
- // C
- int n;
- string s;
- cin >> n >> s; // s == t + t
- string t = s.substr(0 , n / 2);
- if(s == t + t)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- */
- /*
- // D
- string s;
- cin >> s;
- while(s.back() == '0')
- s.pop_back();
- string h = s;
- reverse(h.begin() , h.end());
- if(s == h)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- */
- /*
- // E
- int n , m;
- cin >> n >> m;
- int 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 j = 1; j <= m; j++){
- for(int i = 1; i <= n; i++){
- cout << a[i][j] << " ";
- }
- cout << '\n';
- }
- */
- /*
- // F
- string a = "HDCS";
- string b = "A23456789TJQK";
- int n;
- string card;
- cin >> n;
- set<string> s;
- string ans = "Yes";
- for(int i = 0; i < n; i++){
- cin >> card;
- s.insert(card);
- if(a.find(card[0]) < a.size() && b.find(card[1]) < b.size())
- continue;
- else
- ans = "No";
- }
- if(s.size() < n)
- ans = "No";
- cout << ans << '\n';
- */
- /*
- // G
- int n , x , y;
- cin >> n;
- map<int , int> cnt;
- int m = n - 1;
- while(m--){
- cin >> x >> y;
- cnt[x]++;
- cnt[y]++;
- }
- string ans = "No";
- for(int i = 1; i <= n; i++){
- if(cnt[i] == n - 1)
- ans = "Yes";
- }
- cout << ans << '\n';
- */
- /*
- // H
- int n;
- cin >> n;
- int x[n] , y[n];
- for(int i = 0; i < n; i++)
- cin >> x[i] >> y[i];
- // i < j
- int ans = 0;
- for(int i = 0; i < n; i++){
- for(int j = i + 1; j < n; j++){
- int dist = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);
- ans = max(ans , dist);
- }
- }
- cout << fixed << setprecision(6) << sqrtl(ans) << '\n';
- */
- /*
- // I
- int n , k , cnt = 0;
- cin >> n >> k;
- while(n){
- n /= k;
- cnt++;
- }
- cout << cnt << '\n';
- */
- /*
- string a;
- cin >> a;
- bool lower = 0 , upper = 0;
- set<char> s;
- for(char i : a){
- if(islower(i))
- lower = 1;
- if(isupper(i))
- upper = 1;
- s.insert(i);
- }
- if(s.size() == a.size() && lower && upper)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- */
- /*
- // K
- int n , x , sum = 0 , m = 0;
- cin >> n;
- while(n--){
- cin >> x;
- m = max(m , x);
- sum += x;
- }
- sum -= m;
- if(m < sum)
- cout << "Yes" << '\n';
- else
- cout << "No" << '\n';
- */
- /*
- // L
- int n , m;
- cin >> n >> m;
- set<string> s;
- string a[n] , b[m];
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- for(int i = 0; i < m; i++){
- cin >> b[i];
- s.insert(b[i]);
- }
- int ans = 0;
- for(int i = 0; i < n; i++){
- ans += s.count(a[i].substr(3));
- }
- cout << ans << '\n';
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement