印度理工的难题

This commit is contained in:
James 2020-04-06 10:26:09 +08:00
parent 7abbe7cd66
commit 3ede0ad170
18 changed files with 121 additions and 0 deletions

3
4079_iit/Readme.md Normal file
View File

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

3
4079_iit/doc/Readme.md Normal file
View File

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

Binary file not shown.

43
4079_iit/iit.cpp Normal file
View File

@ -0,0 +1,43 @@
#include <iostream>
using namespace std;
int cant[101][102] = { 0 };
int ans[101] = { 0 };
bool kouwei[101][5] = { 0 };
int n, m; //²ÍÌü£¬Ñ§Éú
void dg()
{
for (int i = 1; i <=n;i++){
int w=1;
//cout<<i<<":";
while(kouwei[i][w]!=0){
w++;
}
ans[i]=w;
for(int j=1;j<=cant[i][0];j++){
//cout<<cant[i][j]<<" ";
kouwei[cant[i][j]][w]=1;
}
//cout<<endl;
}
}
int main()
{
cin >> n >> m;
for (int i = 1; i <= m; i++) {
int yi, er;
cin >> yi >> er;
if (er < yi) {
int u = er;
er = yi;
yi = u;
}
if (yi < er) {
cant[yi][0]++;
cant[yi][cant[yi][0]] = er;
}
}
dg();
for(int i=1;i<=n;i++){
cout<<ans[i];
}
}

BIN
4079_iit/iit.exe Normal file

Binary file not shown.

6
4079_iit/main.cpp Normal file
View File

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

BIN
4079_iit/main.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
5 6
4 1
4 2
4 3
2 5
1 2
1 5

View File

@ -0,0 +1,5 @@
4 4
4 3
2 4
3 1
4 1

11
4079_iit/test/In2 (9).txt Normal file
View File

@ -0,0 +1,11 @@
9 10
9 5
6 1
1 4
6 4
2 8
5 8
7 1
6 5
3 4
3 2

0
4079_iit/test/in.txt Normal file
View File

24
4079_iit/test/out.txt Normal file
View File

@ -0,0 +1,24 @@
## z:\Chao\src\4079_iit\test\in.txt
2020/04/06 ÖÜÒ» 10:04:08.61
-----------------------------------------------
Process exited after 140 ms with return value 0
## z:\Chao\src\4079_iit\test\In0 (13).txt
2020/04/06 ÖÜÒ» 10:04:08.61
12133
-----------------------------------------------
Process exited after 90 ms with return value 0
## z:\Chao\src\4079_iit\test\In1 (17).txt
2020/04/06 ÖÜÒ» 10:04:08.61
1123
-----------------------------------------------
Process exited after 130 ms with return value 0
## z:\Chao\src\4079_iit\test\In2 (9).txt
2020/04/06 ÖÜÒ» 10:04:08.61
112312222
-----------------------------------------------
Process exited after 90 ms with return value 0

3
Template copy/Readme.md Normal file
View File

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

View File

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

6
Template copy/main.cpp Normal file
View File

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

BIN
Template copy/main.exe Normal file

Binary file not shown.

View 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