This file contains hidden or 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 <queue> | |
#include <cstring> | |
#include <algorithm> | |
using namespace std; | |
#define INF 999999 | |
int K, C, M, N; // N = K + C | |
int dis[500][500]; |
This file contains hidden or 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 <queue> | |
using namespace std; | |
#define INF 999999999 | |
struct Edge{ | |
int u, | |
v, | |
len; | |
}E[40001]; |
This file contains hidden or 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 <sstream> | |
using namespace std; | |
int main() | |
{ | |
ios::sync_with_stdio(false); | |
int T, W, N; | |
cin >> T; | |
while (T--) { | |
cin >> W >> N; |
This file contains hidden or 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 <algorithm> | |
int main() | |
{ | |
int n, d, r; | |
int morning[105], night[105]; | |
while (scanf("%d %d %d", &n, &d, &r) && (n || d || r)) { | |
for (int i = 0; i < n; ++i) scanf("%d", &morning[i]); | |
for (int i = 0; i < n; ++i) scanf("%d", &night[i]); |
This file contains hidden or 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 <queue> | |
#include <cstring> | |
using namespace std; | |
#define INF 999999999 | |
int dis[260][260]; | |
int cost[260]; | |
int main() | |
{ | |
int N, M, C, K; |
This file contains hidden or 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 <queue> | |
using namespace std; | |
int bfs(int N, int S, int T); | |
int cap[105][105], flow[105][105]; | |
int bottleneck[105], pre[105]; | |
int main() |
This file contains hidden or 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 <string> | |
#include <cstring> | |
#include <queue> | |
#include <algorithm> | |
using namespace std; | |
int SizeToNum(int N, char ch); | |
int cap[30][30], flow[30][30]; | |
int bottleneck[30], pre[30]; |
This file contains hidden or 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 <queue> | |
#include <algorithm> | |
using namespace std; | |
int cap[101][101]; | |
int flow[101][101]; | |
int bottleneck[101], pre[101]; | |
int bfs(int N, int S, int T); |
This file contains hidden or 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 <algorithm> | |
using namespace std; | |
#define INF 99999999 | |
int flow[101][101]; | |
int cap[101][101]; | |
bool vis[101]; | |
int pre[101]; |
This file contains hidden or 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 <string> | |
#include <map> | |
#include <queue> | |
using namespace std; | |
int main() | |
{ | |
int N, M, Case = 1; | |
while (scanf("%d", &N) && N) { | |
map<string, int> Map; |