#include<bits/stdc++.h> usingnamespacestd; #define N 377 #define mod 998244353 #define inv 499122177 typedeflonglong ll;
inline ll rd(){ ll x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
inlinevoidwork(){ ll n = rd(); ll m = n; int cnt = 0; ll ans = 0, x = 1, t = 0; while (n) { n = n / 10; cnt++; } for (int i = 1; i < cnt; ++i) { t = t * 10 + 9; if ((t - x + 1) % 2 == 0) ans = (ans + (((1 + (t - x + 1)) % mod) * (((t - x + 1) / 2) % mod))) % mod; else ans = (ans + ((((1 + (t - x + 1)) / 2) % mod) * ((t - x + 1) % mod))) % mod; x *= 10; } if ((m - x + 1) % 2 == 0) ans = (ans + (((1 + (m - x + 1)) % mod) * (((m - x + 1) / 2) % mod))) % mod; else ans = (ans + ((((1 + (m - x + 1)) / 2) % mod) * ((m - x + 1) % mod))) % mod; printf("%lld\n", ans); }
#include<bits/stdc++.h> usingnamespacestd; #define N 377 #define mod 998244353 #define inv 499122177 typedeflonglong ll;
inline ll rd(){ ll x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
inlinevoidwork(){ ll a = rd(), s = rd(); if (s < 2 * a) {puts("No"); return;} if (s == 2 * a) {puts("Yes"); return;} ll res = s - 2 * a; if ((res & a) == 0) {puts("Yes"); return;} puts("No"); }
intmain(){ int t = rd(); while (t--) work(); return0; }
#include<bits/stdc++.h> usingnamespacestd; #define N 200007 #define mod 998244353 #define inv 499122177 typedeflonglong ll;
vector<int> V[N]; int n, Q, vis[N];
inlineintrd(){ int x = 0; bool f = 0; char c = getchar(); for (; !isdigit(c); c = getchar()) f |= (c == '-'); for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); return f ? -x : x; }
inlinevoiddfs(int x){ vis[x] = 1; for (auto i : V[x]) { if (!vis[i]) dfs(i); } }
intmain(){ n = rd(); Q = rd(); while (Q--) { int u = rd() - 1, v = rd(); V[u].push_back(v); V[v].push_back(u); } dfs(0); vis[n] == 1 ? puts("Yes") : puts("No"); return0; }
Post title:abc238
Post author:Eva.Q
Create time:2022-02-07 13:23:42
Post link:https://qyy/2022/02/07/ABC/abc238/
Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.