180414_2098_외판원 순회
//https://www.acmicpc.net/problem/2098 #include #define MAX 17000000using namespace std; int w[16][16];int dp[1N; for(int i=0; iw[i][j]; int ans = solve(0,0); cout
//https://www.acmicpc.net/problem/2098 #include #define MAX 17000000using namespace std; int w[16][16];int dp[1N; for(int i=0; iw[i][j]; int ans = solve(0,0); cout
#include #include using namespace std; #define MAXN 11#define MAXT 144 struct pos{ int y, x; pos() {} pos(int y, int x) : y(y), x(x) {}}; int N, M, S;int map[11][11];int match[11];int ans; pos man[11];pos stair[2]; int dist(int man_idx, int stair_idx){ int dx=abs(man[man_idx].x-stair[stair_idx].x); int dy=abs(man[man_idx].y-stair[stair_idx].y); return dx + dy;} void dfs(int idx);void update(); i..
#include using namespace std; int main(){ cin.tie(NULL); int N; cin >> N; for(int i=0; i> a>> b; cout
#include using namespace std; int main(int argc, char** argv){int test_case;int T;cin>>T;for(test_case = 1; test_case > N; long long int S1, S2, S3; S1=N*(N+1)/2; S2=N*N; S3=S2+N; cout