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 <map> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
map<string,string>m; | |
char line[200]; | |
while(gets(line)){ |
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> | |
using namespace std; | |
void parcel(int &box,int num[],int &space,int w); | |
int main() | |
{ | |
int num[7]; | |
while(scanf("%d %d %d %d %d %d",&num[1],&num[2],&num[3],&num[4],&num[5],&num[6])){ | |
int i=1; | |
for(;i<=6;i++) | |
if(num[i]!=0) break; |
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; | |
struct line{ | |
int L; | |
int R; | |
}a[100001]; | |
bool cmp(line a,line b){ |
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; | |
struct temp_type{ | |
int *t; | |
int index; | |
}temp[51]; | |
bool cmp(temp_type a,temp_type b){ | |
return *(a.t)>*(b.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 <cmath> | |
using namespace std; | |
int a[100001]; | |
int main() | |
{ | |
int n; | |
while(scanf("%d",&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> | |
using namespace std; | |
int main() | |
{ | |
int M,N,i,j; // M: number of heads, N: number of knights | |
int m[20010],n[20010]; // m[i]: diameter of head, n[i]: height of knight | |
while (scanf("%d %d",&M,&N)){ | |
if (!M && !N) break; | |
for(i=0;i<M;i++) scanf("%d",&m[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 <algorithm> | |
using namespace std; | |
struct soldier{ | |
int B; | |
int J; | |
}a[10001]; | |
bool cmp(soldier a,soldier b){ | |
return a.J > b.J; | |
} |
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> | |
using namespace std; | |
char square[12][12]; | |
void Fill (int n,int i,int j){ | |
char filled = 'A'; | |
bool up,left,right,down; | |
while (filled <= 'Z'){ | |
if (i-1<0 || square[i-1][j]!=filled) up=1; else up=0; |
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; | |
int N,M,i; // N: number of books, M: money Peter has | |
int book[10001]; // price of each book | |
int Search (int n,int start){ //使用binary search | |
int left=start; | |
int right=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> | |
#include <cmath> | |
using namespace std; | |
int N,M; | |
int n[1001],q[26]; | |
int Search(int a,int start){ | |
int L = start; |