diff --git a/oj/urls.py b/oj/urls.py index fbe7856..27635c7 100644 --- a/oj/urls.py +++ b/oj/urls.py @@ -42,4 +42,6 @@ urlpatterns = [ url(r'^api/admin/problem/$', ProblemAdminAPIView.as_view(), name="problem_admin_api"), url(r'^api/admin/test_case_upload/$', TestCaseUploadAPIView.as_view(), name="test_case_upload_api"), url(r'^api/admin/tag/$', ProblemTagAdminAPIView.as_view(), name="problem_tag_admin_api"), + url(r'^problem/(?P\d+)/my_solutions/', "problem.views.problem_my_solutions_list_page", name="problem_my_solutions_page"), + url(r'^my_solution/(?P\d+)/$', "problem.views.my_solution", name="my_solution_page"), ] diff --git a/problem/views.py b/problem/views.py index eda2c72..8cdf328 100644 --- a/problem/views.py +++ b/problem/views.py @@ -44,8 +44,20 @@ class ProblemTagAdminAPIView(APIView): def problem_page(request, problem_id): - # todo - return render(request, "oj/problem/problem.html") + # try: + # problem = Problem.objects.get(id=problem_id) + # except Problem.DoesNotExist: + # return render(request, "utils/error.html", {"error": u"题目不存在"}) + return render(request, "oj/problem/problem.html", {"problem": {}}) + + +def problem_my_solutions_list_page(request, problem_id): + return render(request, "oj/problem/my_solutions_list.html") + + +def my_solution(request, solution_id): + return render(request, "oj/problem/my_solution.html") + class ProblemAdminAPIView(APIView): diff --git a/template/oj/problem/my_solution.html b/template/oj/problem/my_solution.html new file mode 100644 index 0000000..8f05b10 --- /dev/null +++ b/template/oj/problem/my_solution.html @@ -0,0 +1,31 @@ +{% extends 'oj_base.html' %} + +{% block body %} + +
+ +

Battle Over Cities - Hard Version

+

cpu: 1000ms 内存: 256M

+
+
+

运行结果:Accepted

+

cpu: 1000ms 内存: 256M 语言:python

+
+
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/template/oj/problem/my_solutions_list.html b/template/oj/problem/my_solutions_list.html new file mode 100644 index 0000000..613410a --- /dev/null +++ b/template/oj/problem/my_solutions_list.html @@ -0,0 +1,53 @@ +{% extends 'oj_base.html' %} + +{% block body %} + +
+ +

Battle Over Cities - Hard Version

+

cpu: 1000ms 内存: 256M

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#提交时间结果运行时间运行内存语言
11Error Format333
2WrongWrong Answer@fat33
3LarryAccepted@twitter33
+
+{% endblock %} \ No newline at end of file diff --git a/template/oj/problem/problem.html b/template/oj/problem/problem.html index cbdc0e5..a4dde86 100644 --- a/template/oj/problem/problem.html +++ b/template/oj/problem/problem.html @@ -1,93 +1,126 @@ {% extends 'oj_base.html' %} {% block body %} -
- -

Battle Over Cities - Hard Version

+
+ +

Battle Over Cities - Hard Version

-

cpu: 1000ms 内存: 256M

+

发布时间: 2015-07-05 CPU: 1000ms 内存: 256M

-
-
- +
+
+ -

n的阶乘定义为n!=1*2*3*……*n 如3!=6 - n!通常最后会有很多0,如5!=120 最后有一个0,现在统计n!去除末尾的0后,最后k位是多少

-
-
- +

n的阶乘定义为n!=1*2*3*……*n 如3!=6 + n!通常最后会有很多0,如5!=120 最后有一个0,现在统计n!去除末尾的0后,最后k位是多少

+
+
+ -

第一行包括两个数n,k

-
-
- +

第一行包括两个数n,k

+
+
+ -

第一行包括两个数n,k

-
-
- +

第一行包括两个数n,k

+
+
+
 1 2 3 4 5 6 7
 1 2 3 4 5 6 7
-
-
+
+
- +
 1 2 3 4 5 6 7
-
-
- -
- - -
-
-
- - -
-
-
- - +
+ +
+1 2 3 4 5 6 7
+1 2 3 4 5 6 7
-
-
-
-