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<iostream> | |
using namespace std; | |
#define int long long | |
int N, M; | |
int memo[1<<16]; | |
int g[16][16]; | |
int rec(int S){ |
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<iostream> | |
#include<algorithm> | |
using namespace std; | |
int dp[200*200*2]; | |
int main(){ | |
int N; | |
cin>> 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<iostream> | |
using namespace std; | |
#define int long long | |
int R, B, x, y; | |
int cal(int k){ | |
int r=(R-k), b=(B-k); | |
if(r<0||b<0) return -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<iostream> | |
#include<vector> | |
#include<stdio.h> | |
#define rep(i, n) for(int i=0; i<(n); i++) | |
#define pb push_back | |
using namespace std; | |
int main(){ | |
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<iostream> | |
#include<vector> | |
using namespace std; | |
int mySum(int m){ | |
return (m)*(m+1)/2; | |
} |
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<iostream> | |
#include<vector> | |
using namespace std; | |
int memo[101][1001][11]; | |
int N, D, K; | |
vector<int> ans; | |
vector<int> mians; | |
int rec(int i, int s, int m){ |
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<iostream> | |
#include<vector> | |
#include<queue> | |
using namespace std; | |
typedef pair<int, int> pii; | |
vector<int> g[2*100000]; | |
int main(){ | |
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<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
#define int long long | |
struct Edge{ | |
int a, b, c; |
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<iostream> | |
#include<vector> | |
#include<queue> | |
using namespace std; | |
#define int long long | |
struct Edge{ | |
int to, c; |
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
n=gets.to_i | |
@g=Array.new(n){[]} | |
(n-1).times do |i| | |
b=gets.to_i | |
@g[b-1]<< i+1 | |
end | |
def rec i | |
if @g[i].size()==0 | |
1 |
OlderNewer