From 441b7383bcf2983a793f659863f2db82087bccd3 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Mon, 10 Aug 2015 20:18:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20js=20submit?= =?UTF-8?q?=5Fproblem=20->=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/js/app/oj/problem/{submit_code.js => problem.js} | 8 +++++--- static/src/js/config.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) rename static/src/js/app/oj/problem/{submit_code.js => problem.js} (84%) diff --git a/static/src/js/app/oj/problem/submit_code.js b/static/src/js/app/oj/problem/problem.js similarity index 84% rename from static/src/js/app/oj/problem/submit_code.js rename to static/src/js/app/oj/problem/problem.js index 287554c..a713c07 100644 --- a/static/src/js/app/oj/problem/submit_code.js +++ b/static/src/js/app/oj/problem/problem.js @@ -22,10 +22,12 @@ require(["jquery", "code_mirror"], function ($, code_mirror) { setTimeout( function () { $("#a").animate({opacity: '1'}) - } - , - 3); + }, 3); + }); + $("#show-more-btn").click(function(){ + $(".hide").attr("class", "problem-section"); + $("#show-more-btn").hide(); }) }); diff --git a/static/src/js/config.js b/static/src/js/config.js index f852cc8..0ecf314 100644 --- a/static/src/js/config.js +++ b/static/src/js/config.js @@ -12,7 +12,7 @@ var require = { validation: "utils/validation", code_mirror: "utils/code_mirror", bs_alert: "utils/bs_alert", - submit_code: "app/oj/problem/submit_code", + problem: "app/oj/problem/problem", contest: "app/admin/contest/contest", csrf: "utils/csrf", admin: "app/admin/admin", From 502b4944f1083368a854732b213e82eeaa0323db Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Mon, 10 Aug 2015 20:19:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=98=E7=9B=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=88=91=E7=9A=84=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oj/urls.py | 2 + problem/views.py | 16 +- template/oj/problem/my_solution.html | 31 ++++ template/oj/problem/my_solutions_list.html | 53 +++++++ template/oj/problem/problem.html | 165 ++++++++++++--------- 5 files changed, 199 insertions(+), 68 deletions(-) create mode 100644 template/oj/problem/my_solution.html create mode 100644 template/oj/problem/my_solutions_list.html 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
-
-
-
-