{%hackmd theme-dark %} # Grafos II - Upsolving ###### tags: `upsolving` `ps2020` `grafo` ## C ```cpp #define pb push_back; #define all(x) x.begin(), x.end() bool prime[N] = {true}; void Sieve(int n){ for(int i = 2; i < n) } string digits(int v) { string s; while(v) { s.pb(v%10 + '0'); v /= 10; } reverse(s.begin(), s.end()); return s; } int toint(string s) { int ans = 0; for(char c: s) { ans *= 10; ans += c - '0'; } return ans; } void contruct(int v) { string s = digits(v); for(int i = 0; i < 4; i++) { for(int j = 0; j <= 9; j++) if(j+'0' != s[i]){ string a = s; s[i] = j+'0'; int tmp = toint(v); if(prime[tmp]) adj[v].pb(tmp); } int main() { { } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up