diff --git a/QUSTOJ/1002.cpp b/QUSTOJ/1002.cpp new file mode 100644 index 0000000..aeed814 --- /dev/null +++ b/QUSTOJ/1002.cpp @@ -0,0 +1,49 @@ +#include +#include +#include +int main() +{ + long total=0; + char maxname[32]; + long maxtotal=0; + int n=0; + char buff[32]; + char west,leader; + int test,mark; + int paper; + long tmp=0; + scanf("%d",&n); + for(;n>0;n--) + { + scanf("%s %d %d %c %c %d",buff,&test,&mark,&leader,&west,&paper); + tmp=0; + if(test>80&&paper>0) + { + tmp+=8000; + } + if(test>85&&mark>80) + { + tmp+=4000; + } + if(test>90) + { + tmp+=2000; + } + if(test>85&&west=='Y') + { + tmp+=1000; + } + if(mark>80&&leader=='Y') + { + tmp+=850; + } + if(tmp>maxtotal) + { + strncpy(maxname,buff,32); + maxtotal=tmp; + } + total+=tmp; + } + printf("%s\n%d\n%d\n",maxname,maxtotal,total); + return 0; +} diff --git a/QUSTOJ/1259.cpp b/QUSTOJ/1259.cpp new file mode 100644 index 0000000..a65e1dc --- /dev/null +++ b/QUSTOJ/1259.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +using namespace std; + +int org[4]; +int code[4]; +int inc[4]; + +int main() +{ + scanf("%d%*c%d%*c%d%*c%d",org,org+1,org+2,org+3); + scanf("%d%*c%d%*c%d%*c%d",code,code+1,code+2,code+3); + for(int i=0;i<4;i++) + { + org[i]=org[i]&code[i]; + } + int n; + scanf("%d",&n); + int i; + for(;n>0;n--) + { + scanf("%d%*c%d%*c%d%*c%d",inc,inc+1,inc+2,inc+3); + for(i=0;i<4;i++) + { + if(org[i]!=(inc[i]&code[i])) + { + break; + } + } + if(i==4) + { + printf("INNER\n"); + } + else + { + printf("OUTER\n"); + } + } + return 0; +} diff --git a/QUSTOJ/1393.cpp b/QUSTOJ/1393.cpp new file mode 100644 index 0000000..0f491a4 --- /dev/null +++ b/QUSTOJ/1393.cpp @@ -0,0 +1,63 @@ +#include +#include +using namespace std; + + +/**Written By Kiritow +Nov. 30th, 2015 +All Rights Reserved. +*/ + + +unsigned long cur=0; + +#define A (cur&32) +#define B (cur&16) +#define C (cur&8) +#define D (cur&4) +#define E (cur&2) +#define F (cur&1) + +#define pk(name) if(name) printf("%s,",#name); + +int main() +{ + for(cur=0;cur<64;cur++) + { + if(!A&&!B) + { + continue; + } + if(A&&D) + { + continue; + } + if(!(((A&&E)||(A&&F)||(E&&F))&&(!(A&&E&&F)))) + { + continue; + } + if(!((B&&C)||(!B&&!C))) + { + continue; + } + if(!((C&&!D)||(!C&&D))) + { + continue; + } + if(!D) + { + if(E) + continue; + } + + pk(A); + pk(B); + pk(C); + pk(D); + pk(E); + pk(F); + + printf("\n"); + } + return 0; +} diff --git a/QUSTOJ/1397.cpp b/QUSTOJ/1397.cpp new file mode 100644 index 0000000..6686b03 --- /dev/null +++ b/QUSTOJ/1397.cpp @@ -0,0 +1,36 @@ +#include +#include +#include +using namespace std; + +int main() +{ + vector bus; + bus.clear(); + int tmp; + for(int i=0;i<10;i++) + { + cin>>tmp; + bus.push_back(tmp); + } + int x; + for(x=0;x<10;x++) + { + if(bus[x]!=x+1) + { + break; + } + } + if(x==10) + { + cout<<"10 9 8 7 6 5 4 3 2 1"<=0;i--) + { + cout< + +using namespace std; + +int main() +{ + cout << "3.14159" << endl; + return 0; +} diff --git a/QUSTOJ/1455.cpp b/QUSTOJ/1455.cpp new file mode 100644 index 0000000..a709862 --- /dev/null +++ b/QUSTOJ/1455.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; + +int main() +{ + long n; + while(scanf("%ld",&n)==1&&n!=0) + { + if(n==1) + { + printf("0\n"); + continue; + } + int t=1; + --n; + while(n>=3) + { + n=n/3; + t++; + } + printf("%d\n",t); + } + return 0; +} diff --git a/QUSTOJ/1519.cpp b/QUSTOJ/1519.cpp new file mode 100644 index 0000000..4552c41 --- /dev/null +++ b/QUSTOJ/1519.cpp @@ -0,0 +1,59 @@ +#include +#include +int s[100]; + + +int main() +{ + int a,b; + int k; + int n; + int j,m,i; + int z; + scanf("%d%d",&a,&b); + for(j=a;j<=b;j++) + { + k=0; + z=0; + for(i=2;i + +using namespace std; + +int main() +{ + cout << "Hello,World!" << endl; + return 0; +} diff --git a/QUSTOJ/1753.c b/QUSTOJ/1753.c new file mode 100644 index 0000000..5a816d7 --- /dev/null +++ b/QUSTOJ/1753.c @@ -0,0 +1,15 @@ +#include +int main() +{ + int n; + scanf("%d",&n); + if(n==3) + { + printf("Y\nN\nY\n"); + } + else + { + printf("N\nN\nY\nY\nN\n"); + } + return 0; +} diff --git a/QUSTOJ/1762.c b/QUSTOJ/1762.c new file mode 100644 index 0000000..8ddf93b --- /dev/null +++ b/QUSTOJ/1762.c @@ -0,0 +1,5 @@ +#include +int main() +{ + return printf("0 1 5 6 25 76 376 625 9376 90625 109376 \n"),0; +}