From e89bc937745171199594b0b028f1ab60a37fe90c Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Mon, 2 May 2016 13:38:38 +0800 Subject: [PATCH 1/9] Create 1282.pas --- VIJOS/1282.pas | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 VIJOS/1282.pas diff --git a/VIJOS/1282.pas b/VIJOS/1282.pas new file mode 100644 index 0000000..aa1b75e --- /dev/null +++ b/VIJOS/1282.pas @@ -0,0 +1,37 @@ +var e:array[1..10] of longint; +w,d:array[1..50000] of longint; +i,m,n,j:longint; + +procedure ss(x,y:longint); +var ii,jj,s,o,aa:longint; +begin +ii:=x;jj:=y; +s:=w[(x+y) shr 1]; +aa:=d[(x+y) shr 1]; +repeat +while (w[ii]>s) or ((w[ii]=s) and (d[ii]aa)) do dec(jj); +if ii<=jj then begin +o:=w[ii];w[ii]:=w[jj];w[jj]:=o; +o:=d[ii];d[ii]:=d[jj];d[jj]:=o; +inc(ii);dec(jj); +end; +until ii>jj; +if x Date: Mon, 2 May 2016 13:39:09 +0800 Subject: [PATCH 2/9] Create 1092.pas From https://vijos.org/p/1282/solution --- QUSTOJ/1092.pas | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 QUSTOJ/1092.pas diff --git a/QUSTOJ/1092.pas b/QUSTOJ/1092.pas new file mode 100644 index 0000000..aa1b75e --- /dev/null +++ b/QUSTOJ/1092.pas @@ -0,0 +1,37 @@ +var e:array[1..10] of longint; +w,d:array[1..50000] of longint; +i,m,n,j:longint; + +procedure ss(x,y:longint); +var ii,jj,s,o,aa:longint; +begin +ii:=x;jj:=y; +s:=w[(x+y) shr 1]; +aa:=d[(x+y) shr 1]; +repeat +while (w[ii]>s) or ((w[ii]=s) and (d[ii]aa)) do dec(jj); +if ii<=jj then begin +o:=w[ii];w[ii]:=w[jj];w[jj]:=o; +o:=d[ii];d[ii]:=d[jj];d[jj]:=o; +inc(ii);dec(jj); +end; +until ii>jj; +if x Date: Mon, 2 May 2016 13:44:55 +0800 Subject: [PATCH 3/9] Create 1092_972964894.cpp From https://vijos.org/p/1282/solution --- QUSTOJ/1092_972964894.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 QUSTOJ/1092_972964894.cpp diff --git a/QUSTOJ/1092_972964894.cpp b/QUSTOJ/1092_972964894.cpp new file mode 100644 index 0000000..7e35166 --- /dev/null +++ b/QUSTOJ/1092_972964894.cpp @@ -0,0 +1,32 @@ +#include +#include +using namespace std; +struct leaf{ + long long x,y,z; +}a[50000]; +long long n,k,w[10],i; + +bool cmp(leaf a,leaf b){ + return (a.x>b.x) || (a.x==b.x && a.z>n>>k; + for (i=0;i<10;i++) cin>>w[i]; + for (i=0;i>a[i].x; + a[i].z=i+1; + } + sort(a,a+n,cmp); + for (i=0;i Date: Mon, 2 May 2016 13:45:34 +0800 Subject: [PATCH 4/9] Create 1282_972964894.cpp From https://vijos.org/p/1282/solution --- VIJOS/1282_972964894.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 VIJOS/1282_972964894.cpp diff --git a/VIJOS/1282_972964894.cpp b/VIJOS/1282_972964894.cpp new file mode 100644 index 0000000..7e35166 --- /dev/null +++ b/VIJOS/1282_972964894.cpp @@ -0,0 +1,32 @@ +#include +#include +using namespace std; +struct leaf{ + long long x,y,z; +}a[50000]; +long long n,k,w[10],i; + +bool cmp(leaf a,leaf b){ + return (a.x>b.x) || (a.x==b.x && a.z>n>>k; + for (i=0;i<10;i++) cin>>w[i]; + for (i=0;i>a[i].x; + a[i].z=i+1; + } + sort(a,a+n,cmp); + for (i=0;i Date: Mon, 2 May 2016 13:52:51 +0800 Subject: [PATCH 5/9] Create 1092.cpp --- QUSTOJ/1092.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 QUSTOJ/1092.cpp diff --git a/QUSTOJ/1092.cpp b/QUSTOJ/1092.cpp new file mode 100644 index 0000000..2abc51f --- /dev/null +++ b/QUSTOJ/1092.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +using namespace std; + +#define MAXN 50005 +struct pack +{ + long a,b,c; +}; +pack PK[MAXN]; +int W[16]; +bool cmp(pack a,pack b){ + return (a.a>b.a) || (a.a==b.a && a.c Date: Mon, 2 May 2016 13:56:01 +0800 Subject: [PATCH 6/9] Create 1099_guoqianli.pas From https://vijos.org/p/1291/solution --- QUSTOJ/1099_guoqianli.pas | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 QUSTOJ/1099_guoqianli.pas diff --git a/QUSTOJ/1099_guoqianli.pas b/QUSTOJ/1099_guoqianli.pas new file mode 100644 index 0000000..7a888ba --- /dev/null +++ b/QUSTOJ/1099_guoqianli.pas @@ -0,0 +1,22 @@ +var a,b:array[1..10000]of longint; +c,d:array[1..10000]of boolean; +n,m,i,j,k,max:longint; +begin +max:=0; +fillchar(c,sizeof(c),true); +d:=c; +readln(n,m); +for i:=1 to n do readln(a[i]); +for i:=1 to m do readln(b[i]); +for i:=1 to n-1 do +for j:=i+1 to n do +if a[i]0 then +if (a[i]>b[j])and(c[i])and(d[j])then +begin +inc(max); +c[i]:=false; +d[j]:=false; +break; +end; +writeln(m-max); +end. From 3e27ad954d302b20fc5dbe011dbbb0c7b5cac458 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Mon, 2 May 2016 13:57:09 +0800 Subject: [PATCH 7/9] Create 1291_guoqianli.pas From https://vijos.org/p/1291/solution --- VIJOS/1291_guoqianli.pas | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 VIJOS/1291_guoqianli.pas diff --git a/VIJOS/1291_guoqianli.pas b/VIJOS/1291_guoqianli.pas new file mode 100644 index 0000000..7a888ba --- /dev/null +++ b/VIJOS/1291_guoqianli.pas @@ -0,0 +1,22 @@ +var a,b:array[1..10000]of longint; +c,d:array[1..10000]of boolean; +n,m,i,j,k,max:longint; +begin +max:=0; +fillchar(c,sizeof(c),true); +d:=c; +readln(n,m); +for i:=1 to n do readln(a[i]); +for i:=1 to m do readln(b[i]); +for i:=1 to n-1 do +for j:=i+1 to n do +if a[i]0 then +if (a[i]>b[j])and(c[i])and(d[j])then +begin +inc(max); +c[i]:=false; +d[j]:=false; +break; +end; +writeln(m-max); +end. From 9bb57e6a8f4a5684890a98da734aee87256104b8 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Mon, 2 May 2016 13:59:15 +0800 Subject: [PATCH 8/9] Create 1291_HBat.cpp From https://vijos.org/p/1291/solution --- VIJOS/1291_HBat.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 VIJOS/1291_HBat.cpp diff --git a/VIJOS/1291_HBat.cpp b/VIJOS/1291_HBat.cpp new file mode 100644 index 0000000..c0474da --- /dev/null +++ b/VIJOS/1291_HBat.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +using namespace std; + +int n,m,a[2010],t[2010]; +int main() +{ + scanf("%d%d",&n,&m); + for(int i=1;i<=n;i++) + scanf("%d",&a[i]); + for(int i=1;i<=m;i++) + scanf("%d",&t[i]); + int left=m; + sort(t+1,t+m+1); + for(int i=1;i<=n;i++) + { + for(int j=m;j>0;j--) + { + if(a[i]>t[j]&&t[j]!=0) + { + t[j]=0; + left--; + break; + } + } + } + printf("%d",left); +} From 34c6072200495872dbfa081f2382c9d427643f5c Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Mon, 2 May 2016 13:59:16 +0800 Subject: [PATCH 9/9] Create 1099_HBat.cpp From https://vijos.org/p/1291/solution --- QUSTOJ/1099_HBat.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 QUSTOJ/1099_HBat.cpp diff --git a/QUSTOJ/1099_HBat.cpp b/QUSTOJ/1099_HBat.cpp new file mode 100644 index 0000000..c0474da --- /dev/null +++ b/QUSTOJ/1099_HBat.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +using namespace std; + +int n,m,a[2010],t[2010]; +int main() +{ + scanf("%d%d",&n,&m); + for(int i=1;i<=n;i++) + scanf("%d",&a[i]); + for(int i=1;i<=m;i++) + scanf("%d",&t[i]); + int left=m; + sort(t+1,t+m+1); + for(int i=1;i<=n;i++) + { + for(int j=m;j>0;j--) + { + if(a[i]>t[j]&&t[j]!=0) + { + t[j]=0; + left--; + break; + } + } + } + printf("%d",left); +}