題目連結題意: 有n個男孩和m個女孩,他們要結對跳舞,每對要有一個女孩和一個男孩,而且其中一個要求之前沒有和其他人結對,求出最大可以結多少對。,一條線代表一對,只有這樣三種情況。#include <iostream>#include <algorithm>#include <stdio.h>using namespace std;int main(){ int n, m; while (cin >> n >> m)
http://codeforces.com/problemset/problem/281/B這個題My Code是:#include<cstdio>#include<cmath>using namespace std;long long int gcd(long int a,long int b){ return a==0?b:gcd(b%a,a);}int main(){ long long int
A. Shaass and Oskols題意:在n條電線上有不同數量的鳥, Shaass開了m槍,每一槍打的是第xi條電線上的第yi只鳥,然後被打中的這隻鳥左邊的飛到第i-1條電線上,右邊的飛到i+1條電線上,沒有落腳點的鳥會飛走。#include <stdio.h>int a[105];int main(){ int n, m, x, y; while (scanf("%d",&n) != EOF) { for (int i = 1; i &
題目連結A.Snow FootprintsA - Snow FootprintsThe starting position can be anywhere with a footprint. The footprints can be categorized into 3 types.only L sonly R sR s followed by L sIn case 1, we end in the left of all footprints. In case 2, we end in
Is the Information Reliable?Time Limit: 3000MS Memory Limit: 131072KTotal Submissions: 9905 Accepted: 3072DescriptionThe galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense