Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created September 14, 2019 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/37c97583b03d89b5c5771292e87ecfc5 to your computer and use it in GitHub Desktop.
Save haxpor/37c97583b03d89b5c5771292e87ecfc5 to your computer and use it in GitHub Desktop.
Generation of progress for UVa problem set. Use input.txt as input executing genprogress.cpp program. You can pipe the output to an actual .md file later.
/**
* Generation of UVa's progress in markdown file.
*
* Input:
* A problem set number separated by a new line, each set will contains 100 problems with number running
* from it to a hundred. Terminate with 0 at the last line.
*
* 1
* 19
* 201
* 0
*
* Output:
* A markdown (.md) file for showing progress for all problems in problem sets.
* The output will be shown on stdout, so use pipe to write into an actual file manually.
*/
#include <iostream>
int main()
{
// input of problem set
int problemSet;
std::cout << "Progress of UVa solutions\n\n";
while (std::cin >> problemSet)
{
std::cout << "# " << problemSet << "\n\n";
int hundred = problemSet * 100;
for (int i=0; i<100; ++i)
{
std::cout << "* [ ] [" << (hundred + i) << "](https://uva.onlinejudge.org/external/" << problemSet << "/" << (hundred + i) << ".pdf)\n";
}
std::cout << "\n";
}
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment