Codeforces Round #424 (Div. 1, rated, based on VK Cup Finals), problem: (E) Perpetual Motion Machine Solution In C/C++

By | 2017-07-24T17:55:07+00:00 July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include <bits/stdc++.h> using namespace std; #define inf 1023456789 #define linf 1023456789123456789ll #define pii pair<int,int> #define pipii pair<int, pii > #define pll pair<long long,long long> #define vint vector<int> #define vvint vector<vint > #define ll long long #define pdd pair<double, double> //#define DEBUG #ifdef DEBUG #define [...]

Codeforces Round #424 (Div. 1, rated, based on VK Cup Finals), problem: (D) Singer House Solution In C/C++

By | 2017-07-24T17:52:36+00:00 July 24th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #define LL long long using namespace std; const LL Maxn = 410; const LL Mod = 1e9+7; LL f[Maxn][Maxn], n; void add(LL &x, LL y) { x = (x+y)%Mod; } int main() { LL i, j, [...]