This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <list> | |
#include <map> | |
#include <set> | |
#include <deque> | |
#include <queue> | |
#include <stack> | |
#include <bitset> | |
#include <algorithm> | |
#include <functional> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
long long dp[16][128]; | |
long long doit(int n, int k) { | |
if(k < 0) return 0; | |
long long &ans = dp[n][k]; | |
if(ans != -1) return ans; | |
ans = 0; | |
if(k == 0) return ans = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <set> | |
#include <cstring> | |
using namespace std; | |
#define NN 32 | |
int T; | |
int n, k; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#define CC 1024 | |
int T; | |
int c; | |
long long a[CC][10], sum[CC]; | |
long long ans; | |
template<class _T> _T gcd(_T a, _T b) { return a ? gcd(b%a, a) : b; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <vector> | |
#include <algorithm> | |
#include <cstring> | |
using namespace std; | |
#define NN 200024 | |
int n, root; | |
vector< pair<int, int> > adj[NN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#define NN 10024 | |
int n, a[NN]; | |
bool isWavio(int N) { | |
int L, x[NN], i; | |
// check increasing | |
L = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
#include <algorithm> | |
#include <cassert> | |
using namespace std; | |
#define NN 128 | |
#define MM (NN*512) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
#include <algorithm> | |
using namespace std; | |
#define NN 128 | |
#define MM (NN*512) | |
int T, n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
#define NN 10024 | |
#define KK 128 | |
int T, n, k; | |
int a[NN]; | |
bool dp[NN][KK]; // dp[i][j] = true if can sum j (mod k) with elements 0..i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
#define MM 50064 | |
int a, b; | |
bool can[MM]; // can[i] = indica se eh possivel fazer a soma i | |
bool ismax[MM]; // ismax[i] = indica se a soma i eh maximal (se a gente colocar mais elementos nela, nao tem como ela ser non-powerful) | |
bool ispwr[MM]; // ispwr[i] = indica se a soma i eh powerful | |
int main(void) { |
OlderNewer