不一定正确

This commit is contained in:
James 2020-04-18 08:22:40 +08:00
parent 3912ab2d30
commit 7e3e0ceda4
74 changed files with 532 additions and 2 deletions

View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1,51 @@
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
int n, a[26][26] = { 0 }, many = 0;
string s[26];
cin >> n;
for (int i = 1; i <= n; i++) {
int now;
cin >> now;
for (int j = 1; j <= now; j++) {
string nows;
bool pan = 0;
cin >> nows;
for (int k = 1; k <= many; k++) {
if (s[k] == nows) {
a[k][++a[k][0]] = i;
pan = 1;
}
}
if (pan == 0) {
a[++many][++a[many][0]] = i;
s[many] = nows;
}
}
}
for (int i = 1; i < many; i++) {
for (int k = i + 1; k <= many; k++) {
int yi = i, er = i;
if (a[i][0] < a[k][0]) {
yi = k;
} else {
er = k;
}
int ce = 0;
for (int j = 1; j <= a[yi][0]; j++) {
for (int e = 1; e <= a[er][0]; e++) {
if (a[yi][j] == a[er][e]) {
ce++;
}
}
}
if (ce != 0 && ce != a[yi][0] ) {
cout << "no";
return 0;
}
}
}
cout << "yes";
}

Binary file not shown.

View File

@ -0,0 +1,3 @@
# 标题
* 内容

6
4074_comingtree/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

BIN
4074_comingtree/main.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,12 @@
#include<iostream>
using namespace std;
int main(){
int n,k,f[1001][1001]={0};
cin>>n>>k;
for(int i=1;i<=n;i++){
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
f[x1][y1]=1;
}
}

View File

@ -0,0 +1,5 @@
4
2 spots firebreathing
0
1 flying
2 telepathic flying

View File

@ -0,0 +1,6 @@
## z:\Chao\src\4074_comingtree\test\in.txt
2020/04/08 ÖÜÈý 18:04:20.97
no
-----------------------------------------------
Process exited after 440 ms with return value 0

3
4081_npeople/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

Binary file not shown.

View File

@ -0,0 +1,3 @@
# 标题
* 内容

6
4081_npeople/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

BIN
4081_npeople/main.exe Normal file

Binary file not shown.

31
4081_npeople/npeople.cpp Normal file
View File

@ -0,0 +1,31 @@
#include <iostream>
#include<algorithm>
using namespace std;
int n,a[100000]={0};
int mins(){
if(a[n-2]-a[0]==n-2&&a[n-1]-a[n-2]>n-2){
return 2;
}
if(a[n-1]-a[1]==n-2&&a[1]-a[0]>n-2){
return 2;
}
int ans=0,j=0;
for(int i=0;i<n;i++){
int now=a[i]+n;
while(j<n&&a[j]<now){
j++;
}
ans=max(j-i,ans);
}
return n-ans;
}
int main()
{
cin >> n;
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
cout<<mins()<<endl;
cout << max(a[n-2]-a[0],a[n-1]-a[1])-n+2;
}

BIN
4081_npeople/npeople.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
3
1
500000000
1000000000

View File

@ -0,0 +1,7 @@
5
8
7
6
5
10

2
4081_npeople/test/in.txt Normal file
View File

@ -0,0 +1,2 @@
3
4 7 9

View File

@ -0,0 +1,3 @@
3
4 6 9

28
4081_npeople/test/out.txt Normal file
View File

@ -0,0 +1,28 @@
## z:\Chao\src\4081_npeople\test\in.txt
2020/04/10 ÖÜÎå 18:06:23.63
1
2
-----------------------------------------------
Process exited after 330 ms with return value 0
## z:\Chao\src\4081_npeople\test\In1 (16).txt
2020/04/10 ÖÜÎå 18:06:23.63
2
499999999
-----------------------------------------------
Process exited after 100 ms with return value 0
## z:\Chao\src\4081_npeople\test\In2 (8).txt
2020/04/10 ÖÜÎå 18:06:23.63
1
1
-----------------------------------------------
Process exited after 100 ms with return value 0
## z:\Chao\src\4081_npeople\test\in2.txt
2020/04/10 ÖÜÎå 18:06:23.63
1
2
-----------------------------------------------
Process exited after 90 ms with return value 0

Binary file not shown.

3
4090_juice/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

3
4090_juice/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

BIN
4090_juice/doc/果汁.pdf Normal file

Binary file not shown.

32
4090_juice/juice.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <iostream>
using namespace std;
int main()
{
int c[4], m[4];
for (int i = 1; i <= 3; i++) {
cin >> c[i] >> m[i];
}
int t = 0, now = 1;
while (t < 100) {
int xia = now + 1;
if (now == 3) {
xia = 1;
}
m[xia] += m[now];
m[now]=0;
if (m[xia] > c[xia]) {
m[now] = m[xia] - c[xia];
m[xia] = c[xia];
}
now = xia;
t++;/*
cout << t << endl;
for (int i = 1; i <= 3; i++) {
cout << m[i] << endl;
}
cout<<endl;*/
}
for (int i = 1; i <= 3; i++) {
cout << m[i] << endl;
}
}

BIN
4090_juice/juice.exe Normal file

Binary file not shown.

6
4090_juice/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

BIN
4090_juice/main.exe Normal file

Binary file not shown.

3
4090_juice/test/in.txt Normal file
View File

@ -0,0 +1,3 @@
10 3
11 4
12 5

3
4090_juice/test/in2.txt Normal file
View File

@ -0,0 +1,3 @@
1 1
1 1
1 1

3
4090_juice/test/in3.txt Normal file
View File

@ -0,0 +1,3 @@
7 1
10 1
3 1

27
4090_juice/test/out.txt Normal file
View File

@ -0,0 +1,27 @@
## z:\Chao\src\4090_juice\test\in.txt
2020/04/12 ÖÜÈÕ 8:54:01.04
0
10
2
-----------------------------------------------
Process exited after 190 ms with return value 0
## z:\Chao\src\4090_juice\test\in2.txt
2020/04/12 ÖÜÈÕ 8:54:01.04
1
1
1
-----------------------------------------------
Process exited after 110 ms with return value 0
## z:\Chao\src\4090_juice\test\in3.txt
2020/04/12 ÖÜÈÕ 8:54:01.04
0
3
0
-----------------------------------------------
Process exited after 90 ms with return value 0

3
4091_garden/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1,3 @@
# 标题
* 内容

BIN
4091_garden/doc/果园.pdf Normal file

Binary file not shown.

49
4091_garden/garden.cpp Normal file
View File

@ -0,0 +1,49 @@
#include <algorithm>
#include <iostream>
using namespace std;
int tou[100] = { 0 }, wei[100] = { 0 }, lan[100] = { 0 }, alan[1001] = { 0 }, ans = 0;
void huan(int* ze, int* na)
{
int u = *ze;
*ze = *na;
*na = u;
}
void pan(int yi, int er)
{
if (tou[er] < tou[yi]) {
huan(&tou[yi], &tou[er]);
huan(&wei[yi], &wei[er]);
huan(&lan[yi], &lan[er]);
}
}
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> tou[i] >> wei[i] >> lan[i];
}
for (int i = 0; i <= n - 2; i++) {
for (int j = i + 1; j < n; j++) {
pan(i, j);
}
}
for (int i = 0; i < n; i++) {
//cout << tou[i] << " " << wei[i] << " " << lan[i] << endl;
for (int j = 1; j <= ans; j++) {
if (alan[j] < tou[i]) {
// cout << alan[j] << " " << lan[i] << endl;
alan[j] = wei[i];
lan[i]--;
}
if (lan[i] == 0) {
break;
}
}
for (int j = 1; j <= lan[i]; j++) {
alan[++ans] = wei[i];
}
//cout << ans << endl << endl;
}
cout << ans;
}

BIN
4091_garden/garden.exe Normal file

Binary file not shown.

BIN
4091_garden/main.exe Normal file

Binary file not shown.

4
4091_garden/test/in.txt Normal file
View File

@ -0,0 +1,4 @@
3
4 10 1
8 13 3
2 6 2

21
4091_garden/test/in2.txt Normal file
View File

@ -0,0 +1,21 @@
20
116 194 6
22 163 8
127 141 7
59 70 8
138 199 5
171 197 2
106 126 5
128 137 6
47 130 4
58 125 6
44 151 8
9 77 9
52 155 10
27 187 5
140 196 1
35 179 8
2 98 3
20 25 9
72 133 10
156 180 9

31
4091_garden/test/in3.txt Normal file
View File

@ -0,0 +1,31 @@
30
51 194 1
215 288 7
244 292 8
233 252 8
29 276 8
5 44 4
229 289 10
84 291 10
255 287 10
98 208 6
11 106 2
6 121 7
1 37 3
69 72 4
134 195 1
64 200 2
267 285 1
46 157 10
149 173 10
10 237 1
140 212 1
23 270 7
14 62 5
127 160 5
201 247 9
187 226 3
58 130 7
61 105 9
48 139 10
28 205 10

18
4091_garden/test/out.txt Normal file
View File

@ -0,0 +1,18 @@
## z:\Chao\src\4091_garden\test\in.txt
2020/04/12 周日 9:48:19.75
4
-----------------------------------------------
Process exited after 260 ms with return value 0
## z:\Chao\src\4091_garden\test\in2.txt
2020/04/12 周日 9:48:19.75
72
-----------------------------------------------
Process exited after 90 ms with return value 0
## z:\Chao\src\4091_garden\test\in3.txt
2020/04/12 周日 9:48:19.75
90
-----------------------------------------------
Process exited after 110 ms with return value 0

3
4092_tong/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

3
4092_tong/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

BIN
4092_tong/doc/水桶.pdf Normal file

Binary file not shown.

BIN
4092_tong/main.exe Normal file

Binary file not shown.

0
4092_tong/test/in.txt Normal file
View File

0
4092_tong/test/in2.txt Normal file
View File

0
4092_tong/test/in3.txt Normal file
View File

7
4092_tong/test/out.txt Normal file
View File

@ -0,0 +1,7 @@
## z:\Chao\src\Template\test\in.txt
2020/03/14 ÖÜÁù 11:41:28.68
Hello Easy C++ project!
-----------------------------------------------
Process exited after 200 ms with return value 0

12
4092_tong/tong.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <iostream>//weiwancheng
using namespace std;
int main()
{
int a[2][11]={0},b[11]={0};
for(int i=0;i<2;i++){
for(int j=0;j<10;j++){
cin>>a[i][j];
}
}
}

3
4093_diao/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

20
4093_diao/diao.cpp Normal file
View File

@ -0,0 +1,20 @@
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int n,bus,must,ans=0;
int a[100000];
cin>>n>>bus>>must;
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
for(int i=must-1;i<n;i+=must){
int now=a[i]-a[i+1-must];
if(now>ans){
ans=now;
}
}
cout<<ans;
}

BIN
4093_diao/diao.exe Normal file

Binary file not shown.

3
4093_diao/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

Binary file not shown.

BIN
4093_diao/main.exe Normal file

Binary file not shown.

2
4093_diao/test/in.txt Normal file
View File

@ -0,0 +1,2 @@
6 3 2
1 1 10 14 4 3

2
4093_diao/test/in2.txt Normal file

File diff suppressed because one or more lines are too long

2
4093_diao/test/in3.txt Normal file

File diff suppressed because one or more lines are too long

18
4093_diao/test/out.txt Normal file
View File

@ -0,0 +1,18 @@
## z:\Chao\src\4093_diao\test\in.txt
2020/04/12 周日 10:49:37.43
4
-----------------------------------------------
Process exited after 200 ms with return value 0
## z:\Chao\src\4093_diao\test\in2.txt
2020/04/12 周日 10:49:37.43
536928
-----------------------------------------------
Process exited after 230 ms with return value 0
## z:\Chao\src\4093_diao\test\in3.txt
2020/04/12 周日 10:49:37.43
348741
-----------------------------------------------
Process exited after 280 ms with return value 0

3
4094_can/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

42
4094_can/can.cpp Normal file
View File

@ -0,0 +1,42 @@
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int dao[100001]={0},yao[100001]={0},n,mins=1,ans=0;
bool pan[100001]={0};
cin>>n;
for(int i=0;i<n;i++){
cin>>dao[i]>>yao[i];
if(dao[i]<dao[mins]){
mins=i;
}
}
int now=dao[mins]+yao[mins];
pan[mins]=1;
for(int i=1;i<n;i++){
bool xu=0;
int xiao=1000000001,zhi=0;
for(int j=0;j<n;j++){
if(dao[j]<now&&pan==0){
int zhe=now-dao[j];
if(zhe>ans){
ans=zhe;
}
pan[j]=1;
now+=zhe;
xu=1;
break;
}
if(dao[j]<xiao&&pan[j]==0){
xiao=dao[j];
zhi=j;
}
}
if(xu==0){
now=dao[zhi]+yao[zhi];
pan[zhi]=1;
}
}
cout<<ans;
}

BIN
4094_can/can.exe Normal file

Binary file not shown.

3
4094_can/doc/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

BIN
4094_can/main.exe Normal file

Binary file not shown.

6
4094_can/test/in.txt Normal file
View File

@ -0,0 +1,6 @@
5
25 3
105 30
20 50
10 17
100 10

0
4094_can/test/in2.txt Normal file
View File

0
4094_can/test/in3.txt Normal file
View File

18
4094_can/test/out.txt Normal file
View File

@ -0,0 +1,18 @@
## z:\Chao\src\4094_can\test\in.txt
2020/04/12 周日 12:21:39.69
0
-----------------------------------------------
Process exited after 180 ms with return value 0
## z:\Chao\src\4094_can\test\in2.txt
2020/04/12 周日 12:21:39.69
0
-----------------------------------------------
Process exited after 80 ms with return value 0
## z:\Chao\src\4094_can\test\in3.txt
2020/04/12 周日 12:21:39.69
0
-----------------------------------------------
Process exited after 80 ms with return value 0

View File

@ -1,6 +1,7 @@
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

0
Template/test/in2.txt Normal file
View File

0
Template/test/in3.txt Normal file
View File