Codeforces Round #412 (rated, Div. 1, based on VK Cup 2017 Round 3), problem: (F) Test Data Generation, Accepted Solution In C/C++

By |2017-07-24T02:44:29+00:00July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include<bits/stdc++.h> #define ll long long ll multmod(ll a, ll b, ll moder){ a = (a % moder + moder) % moder, b = (b % moder + moder) % moder; ll ret = 0; for ( ; b; b >>= 1){ if (b & [...]

Codeforces Round #382 (Div. 2), problem: (E) Ostap and Tree, Accepted Solution in C/C++

By |2016-12-17T16:25:28+00:00December 17th, 2016|Categories: Uncategorized|Tags: , , , , |

#include <stdio.h> #include <string.h> #include <stdlib.h> #define M 1000000007 int add(int a, int b) { return (a + b) % M; } int mult(int a, int b) { return ((long long) a * b) % M; } #define K 20 struct edge { int [...]