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<cstdio> | |
#include<cstring> | |
using namespace std; | |
const int maxn = 15; | |
int n, dis[maxn][maxn], dp[maxn][1 << maxn]; | |
int main(){ | |
while(scanf("%d", &n) == 1){ | |
memset(dp, 0x3f, sizeof(dp)); | |
// input a matrix represent the each dot-to-dot distance |
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<cstdio> | |
#include<cstring> | |
#include<cmath> | |
#include<vector> | |
using namespace std; | |
const int maxn = 250; | |
const int dx[] = {1, 0, 0, -1}, dy[] = {0, 1, -1, 0}; | |
const char dire[] = {'e', 'n', 's', 'w'}; |
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<cstdio> | |
#include<algorithm> | |
using namespace std; | |
const int maxn = 1e5 + 5; | |
typedef long long LL; | |
LL sum[maxn]; | |
struct Company{ | |
int money, ship; | |
Company(int _m = 0, int _s = 0):money(_m),ship(_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<cstdio> | |
#include<queue> | |
using namespace std ; | |
const int dx[6] = {0 , 0 , 0 , 0 , 1 , -1} ; | |
const int dy[6] = {0 , 0 , 1 , -1 , 0 , 0} ; | |
const int dz[6] = {1 , -1 , 0 , 0 , 0 , 0} ; | |
const int maxn = 30 + 5 ; | |
int l, r, 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<cstdio> | |
#include<stack> | |
using namespace std ; | |
const int maxn = 10000 ; | |
int main(){ | |
int n , k , num[maxn]; | |
while(scanf("%d" , &n) == 1 && n){ | |
num[0] = 0 ; | |
for(;;){ |
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<string> | |
#include<set> | |
#include<map> | |
#include<cstdio> | |
using namespace std; | |
typedef pair<string, string> PSS; | |
set<PSS> lis, temp; | |
map<string, string> link; | |
void printcode(set<PSS> x) // debug |
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<cstdio> | |
#include<cstdlib> | |
#include<map> | |
#include<set> | |
#include<vector> | |
using namespace std ; | |
vector<string> Vplace , Vanimal; | |
set<string> placeS , animalS; | |
map < pair <string , string> , int> quan ; |
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<cmath> | |
#include<cstdio> | |
using namespace std ; | |
void r(long long sum , long long k , long long &in1 , long long &in2) | |
{ | |
if(sum <= k) | |
in1++ , in2 += sum ; | |
else if(sum > k) | |
in1 -= sum - (k + 1) , in2 += k ; |