-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from sjw0687/master
READNE 갱신
- Loading branch information
Showing
2 changed files
with
168 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,95 @@ | ||
## 2015년도 전북대학교 ACM-ICPC | ||
|
||
* 입력 및 출력에서 `<case>` ~ `</case>` 태그는 별도의 입력 파일로 존재해야 할 여러 테스트 케이스를 하나의 입력 또는 출력으로 묶기 위한 태그입니다. | ||
* 정답 해설 및 정답 코드는 여러분에게 이해되기 쉽고 명확하게 전달하기 위해, 추후에 일부 내용이 변경될 수 있습니다. | ||
* 질문 사항이 있으시면 `[email protected]`으로 메일을 보내시거나, 동아리방을 방문하여 주시기 바랍니다. | ||
|
||
[전체 문제 pdf](https://github.com/sjw0687/alps-acm-problems-2015/raw/master/problems.pdf) | ||
|
||
### A. 약수의 개수 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%95%BD%EC%88%98%EC%9D%98%20%EA%B0%9C%EC%88%98/description.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%95%BD%EC%88%98%EC%9D%98%20%EA%B0%9C%EC%88%98/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%95%BD%EC%88%98%EC%9D%98%20%EA%B0%9C%EC%88%98/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%95%BD%EC%88%98%EC%9D%98%20%EA%B0%9C%EC%88%98/output.txt) | ||
|
||
### B. 큰 넓이 구하기 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%81%B0%20%EB%84%93%EC%9D%B4%20%EA%B5%AC%ED%95%98%EA%B8%B0/description.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%81%B0%20%EB%84%93%EC%9D%B4%20%EA%B5%AC%ED%95%98%EA%B8%B0/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%81%B0%20%EB%84%93%EC%9D%B4%20%EA%B5%AC%ED%95%98%EA%B8%B0/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%81%B0%20%EB%84%93%EC%9D%B4%20%EA%B5%AC%ED%95%98%EA%B8%B0/output.txt) | ||
|
||
### C. a2Z Number | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/a2Z%20Number/description.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/a2Z%20Number/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/a2Z%20Number/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/a2Z%20Number/output.txt) | ||
|
||
[입력 생성 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/a2Z%20Number/input_generator.cpp) | ||
|
||
### D. 최솟값과 최댓값 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%B5%9C%EC%86%9F%EA%B0%92%EA%B3%BC%20%EC%B5%9C%EB%8C%93%EA%B0%92/description.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%B5%9C%EC%86%9F%EA%B0%92%EA%B3%BC%20%EC%B5%9C%EB%8C%93%EA%B0%92/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%B5%9C%EC%86%9F%EA%B0%92%EA%B3%BC%20%EC%B5%9C%EB%8C%93%EA%B0%92/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%B5%9C%EC%86%9F%EA%B0%92%EA%B3%BC%20%EC%B5%9C%EB%8C%93%EA%B0%92/output.txt) | ||
|
||
[입력 생성 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EC%B5%9C%EC%86%9F%EA%B0%92%EA%B3%BC%20%EC%B5%9C%EB%8C%93%EA%B0%92/input_generator.cpp) | ||
|
||
### E. 티모장인 오복실 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%8B%B0%EB%AA%A8%EC%9E%A5%EC%9D%B8%20%EC%98%A4%EB%B3%B5%EC%8B%A4/description.md) | ||
|
||
[정답 설명](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/solution.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%8B%B0%EB%AA%A8%EC%9E%A5%EC%9D%B8%20%EC%98%A4%EB%B3%B5%EC%8B%A4/solution.md) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%8B%B0%EB%AA%A8%EC%9E%A5%EC%9D%B8%20%EC%98%A4%EB%B3%B5%EC%8B%A4/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%8B%B0%EB%AA%A8%EC%9E%A5%EC%9D%B8%20%EC%98%A4%EB%B3%B5%EC%8B%A4/output.txt) | ||
|
||
[입력 생성 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%ED%8B%B0%EB%AA%A8%EC%9E%A5%EC%9D%B8%20%EC%98%A4%EB%B3%B5%EC%8B%A4/input_generator.cpp) | ||
|
||
### F. 긔엽긔는 거꾸로 해도 긔엽긔 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B8%94%EC%97%BD%EA%B8%94%EB%8A%94%20%EA%B1%B0%EA%BE%B8%EB%A1%9C%20%ED%95%B4%EB%8F%84%20%EA%B8%94%EC%97%BD%EA%B8%94/description.md) | ||
|
||
[정답 설명](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B8%94%EC%97%BD%EA%B8%94%EB%8A%94%20%EA%B1%B0%EA%BE%B8%EB%A1%9C%20%ED%95%B4%EB%8F%84%20%EA%B8%94%EC%97%BD%EA%B8%94/solution.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B8%94%EC%97%BD%EA%B8%94%EB%8A%94%20%EA%B1%B0%EA%BE%B8%EB%A1%9C%20%ED%95%B4%EB%8F%84%20%EA%B8%94%EC%97%BD%EA%B8%94/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B8%94%EC%97%BD%EA%B8%94%EB%8A%94%20%EA%B1%B0%EA%BE%B8%EB%A1%9C%20%ED%95%B4%EB%8F%84%20%EA%B8%94%EC%97%BD%EA%B8%94/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B8%94%EC%97%BD%EA%B8%94%EB%8A%94%20%EA%B1%B0%EA%BE%B8%EB%A1%9C%20%ED%95%B4%EB%8F%84%20%EA%B8%94%EC%97%BD%EA%B8%94/output.txt) | ||
|
||
### G. diff | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/diff/description.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/diff/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/diff/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/diff/output.txt) | ||
|
||
[입력 생성 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/diff/input_generator.cpp) | ||
|
||
### H. 건설 로봇 | ||
[문제](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/description.md) | ||
|
||
[정답 설명](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/solution.md) | ||
|
||
[정답 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/solution.cpp) | ||
|
||
[입력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/input.txt) | ||
|
||
[출력](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/output.txt) | ||
|
||
[입력 생성 코드](https://github.com/sjw0687/alps-acm-problems-2015/blob/master/%EA%B1%B4%EC%84%A4%20%EB%A1%9C%EB%B4%87/input_generator.cpp) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,90 @@ | ||
//#include <iostream> | ||
//#include <random> | ||
//#include <chrono> | ||
//#include <string> | ||
//using namespace std; | ||
// | ||
//default_random_engine generator; | ||
// | ||
//int rand_int(int from = 0, int to = 1) { | ||
// uniform_int_distribution<int> d(from, to); | ||
// return d(generator); | ||
//} | ||
// | ||
//double rand_double(int from = 0.0, int to = 1.0) { | ||
// uniform_real_distribution<double> d(from, to); | ||
// return d(generator); | ||
//} | ||
// | ||
//void print_case(int n_from, int n_to, int k_from, int k_to, | ||
// int a_diff_from, int a_diff_to, int a_from, | ||
// int b_diff_from, int b_diff_to, int b_from) { | ||
// int n = rand_int(n_from, n_to); | ||
// int k = rand_int(k_from, k_to); | ||
// | ||
// cout << n << ' ' << k << endl; | ||
// | ||
// int a_val = a_from; | ||
// bool a_first = true; | ||
// for (int i = 0; i < n; i++) { | ||
// if (a_first) | ||
// a_first = false; | ||
// else | ||
// cout << ' '; | ||
// cout << a_val; | ||
// a_val += rand_int(a_diff_from, a_diff_to); | ||
// } | ||
// cout << endl; | ||
// | ||
// int b_val = b_from; | ||
// bool b_first = true; | ||
// for (int i = 0; i < k; i++) { | ||
// if (b_first) | ||
// b_first = false; | ||
// else | ||
// cout << ' '; | ||
// cout << b_val; | ||
// b_val += rand_int(b_diff_from, b_diff_to); | ||
// } | ||
// cout << endl; | ||
//} | ||
// | ||
//int main() { | ||
// generator.seed(chrono::system_clock::now().time_since_epoch().count()); | ||
// | ||
// int n_from, n_to, k_from, k_to; | ||
// | ||
// cout << "<case>" << endl; | ||
// n_from = 5; | ||
// n_to = 10; | ||
// k_from = 5; | ||
// k_to = 10; | ||
// print_case(n_from, n_to, k_from, k_to, 3, 6, 10, 3, 6, 10); | ||
// cout << "</case>" << endl; | ||
// | ||
// cout << "<case>" << endl; | ||
// n_from = 500; | ||
// n_to = 500; | ||
// k_from = 500; | ||
// k_to = 500; | ||
// print_case(n_from, n_to, k_from, k_to, 1, 100, 50, 1, 100, 50); | ||
// cout << "</case>" << endl; | ||
// | ||
// cout << "<case>" << endl; | ||
// n_from = 100000; | ||
// n_to = 100000; | ||
// k_from = 50000; | ||
// k_to = 50000; | ||
// print_case(n_from, n_to, k_from, k_to, 1, 2, 50000, 3, 6, 10); | ||
// cout << "</case>" << endl; | ||
// | ||
// cout << "<case>" << endl; | ||
// n_from = 50000; | ||
// n_to = 50000; | ||
// k_from = 100000; | ||
// k_to = 100000; | ||
// print_case(n_from, n_to, k_from, k_to, 3, 6, 10, 1, 2, 50000); | ||
// cout << "</case>" << endl; | ||
// | ||
// return 0; | ||
//} | ||
#include <iostream> | ||
#include <random> | ||
#include <chrono> | ||
#include <string> | ||
using namespace std; | ||
|
||
default_random_engine generator; | ||
|
||
int rand_int(int from = 0, int to = 1) { | ||
uniform_int_distribution<int> d(from, to); | ||
return d(generator); | ||
} | ||
|
||
double rand_double(int from = 0.0, int to = 1.0) { | ||
uniform_real_distribution<double> d(from, to); | ||
return d(generator); | ||
} | ||
|
||
void print_case(int n_from, int n_to, int k_from, int k_to, | ||
int a_diff_from, int a_diff_to, int a_from, | ||
int b_diff_from, int b_diff_to, int b_from) { | ||
int n = rand_int(n_from, n_to); | ||
int k = rand_int(k_from, k_to); | ||
|
||
cout << n << ' ' << k << endl; | ||
|
||
int a_val = a_from; | ||
bool a_first = true; | ||
for (int i = 0; i < n; i++) { | ||
if (a_first) | ||
a_first = false; | ||
else | ||
cout << ' '; | ||
cout << a_val; | ||
a_val += rand_int(a_diff_from, a_diff_to); | ||
} | ||
cout << endl; | ||
|
||
int b_val = b_from; | ||
bool b_first = true; | ||
for (int i = 0; i < k; i++) { | ||
if (b_first) | ||
b_first = false; | ||
else | ||
cout << ' '; | ||
cout << b_val; | ||
b_val += rand_int(b_diff_from, b_diff_to); | ||
} | ||
cout << endl; | ||
} | ||
|
||
int main() { | ||
generator.seed(chrono::system_clock::now().time_since_epoch().count()); | ||
|
||
int n_from, n_to, k_from, k_to; | ||
|
||
cout << "<case>" << endl; | ||
n_from = 5; | ||
n_to = 10; | ||
k_from = 5; | ||
k_to = 10; | ||
print_case(n_from, n_to, k_from, k_to, 3, 6, 10, 3, 6, 10); | ||
cout << "</case>" << endl; | ||
|
||
cout << "<case>" << endl; | ||
n_from = 500; | ||
n_to = 500; | ||
k_from = 500; | ||
k_to = 500; | ||
print_case(n_from, n_to, k_from, k_to, 1, 100, 50, 1, 100, 50); | ||
cout << "</case>" << endl; | ||
|
||
cout << "<case>" << endl; | ||
n_from = 100000; | ||
n_to = 100000; | ||
k_from = 50000; | ||
k_to = 50000; | ||
print_case(n_from, n_to, k_from, k_to, 1, 2, 50000, 3, 6, 10); | ||
cout << "</case>" << endl; | ||
|
||
cout << "<case>" << endl; | ||
n_from = 50000; | ||
n_to = 50000; | ||
k_from = 100000; | ||
k_to = 100000; | ||
print_case(n_from, n_to, k_from, k_to, 3, 6, 10, 1, 2, 50000); | ||
cout << "</case>" << endl; | ||
|
||
return 0; | ||
} |