有什么新鲜事告诉大家嘛?

31 条评论

  • @ 2025-6-13 10:56:33

    祝贺 Sleeping Cup 评测量达到 1700!

    • @ 2025-6-7 23:01:12

      12 号中考。

    • @ 2025-6-6 19:41:55

      R5 计分脚本已经完成!

      # 1.py
      import requests
      from bs4 import BeautifulSoup
      from lxml import html
      import re
      import math
      def extract_numbers(text):
          pattern = r'(\d+)\s*/\s*(\d+)'
          match = re.search(pattern, text)
          if match:
              return int(match.group(1)), int(match.group(2))
          else:
              return None, None
      login_url = 'http://8.136.99.126/login'
      username = '035966_L3'
      password = '******'
      session = requests.Session()
      payload = {'uname': username, 'password': password, 'rememberme': True}
      response = session.post(login_url, data = payload)
      if response.ok == False:
          print('Login failed!')
          print('Press any key to continue...')
          input()
          sys.exit(1)
      html = session.get('http://8.136.99.126/contest/67ea76027aadac7b413b5258/user').text
      soup = BeautifulSoup(html, 'html.parser')
      tr_elements = soup.find_all('tr', attrs={'data-uid': True})
      results = []
      with open("results.txt", "wb") as file:
          for tr in tr_elements:
              uid = tr['data-uid']
              time_td = tr.find('td', class_='col--start-time')
              if time_td:
                  time_span = time_td.find('span', class_='time')
                  if time_span and 'data-timestamp' in time_span.attrs:
                      timestamp = time_span['data-timestamp']
                      file.write(bytes(f"{uid} {math.floor(float(timestamp))}\n", encoding='utf-8'))
      
      # 2.py
      import requests
      from bs4 import BeautifulSoup
      from lxml import html
      import re
      import math
      def not_special(pid):
          if pid == "A":
              return False
          else:
              return True
      contest_url = "67ea76027aadac7b413b5258"
      start_pid = 122
      login_url = 'http://8.136.99.126/login'
      username = '035966_L3'
      password = '******'
      session = requests.Session()
      payload = {'uname': username, 'password': password, 'rememberme': True}
      response = session.post(login_url, data = payload)
      if response.ok == False:
          print('Login failed!')
          print('Press any key to continue...')
          input()
          sys.exit(1)
      url = "http://8.136.99.126/record?tid=" + contest_url + "&page="
      continous = True
      page = 0
      all_results = []
      with open("records.txt", "wb") as file:
          while continous:
              continous = False
              page = page + 1
              content = session.get(url + str(page)).text
              soup = BeautifulSoup(content, 'html.parser')
              tr_elements = soup.find_all('tr', attrs={'data-rid': True})
              results = []
              for tr in tr_elements:
                  continous = True
                  timestamp = 0
                  uid = 0
                  pid = 0
                  rid = tr['data-rid']
                  status = ""
                  time_td = tr.find('td', class_='col--submit-at')
                  if time_td:
                      time_span = time_td.find('span', class_='time relative')
                      if time_span and 'data-timestamp' in time_span.attrs:
                          timestamp = time_span['data-timestamp']
                  user_td = tr.find('td', class_='col--submit-by')
                  if user_td:
                      user_span = user_td.find('span', class_='user-profile-link')
                      if user_span:
                          user_link = user_span.find('a')
                          parts = user_link['href'].split('/')
                          uid = int(parts[-1])
                  problem_td = tr.find('td', class_='col--problem col--problem-name')
                  if problem_td:
                      problem_link = problem_td.find('a')
                      first_parts = problem_link['href'].split('P')
                      second_parts = first_parts[-1].split('?')
                      pid = chr(int(second_parts[0]) - start_pid + 65)
                  pass_td = tr.find('td', class_="col--status record-status--border pass")
                  if pass_td:
                      status = "AC"
                  else:
                      clock_td = tr.find('td', class_='col--time')
                      if clock_td:
                          clock = clock_td.get_text(strip=True)
                          if clock == "-" and not_special(pid):
                              status = "CE"
                          else:
                              status = "RJ"
                  results.append(f"{rid} {timestamp} {uid} {pid} {status}\n")
              all_results.extend(results)
          all_results.reverse()
          for result in all_results:
              file.write(bytes(result, encoding='utf-8'))
      
      # 3.py
      import requests
      import hashlib
      from collections import defaultdict
      from bs4 import BeautifulSoup
      from lxml import html
      import re
      import math
      import sys
      login_url = 'http://8.136.99.126/login'
      username = '035966_L3'
      password = '******'
      session = requests.Session()
      payload = {'uname': username, 'password': password, 'rememberme': True}
      response = session.post(login_url, data = payload)
      if response.ok == False:
          print('Login failed!')
          print('Press any key to continue...')
          input()
          sys.exit(1)
      url = "http://8.136.99.126/record/"
      user_dict = {}
      penalty_dict = defaultdict(dict)
      problem_count = 7
      special_dict = {'6842b936943024732bdf70a4': -60}
      md5_dict = {'68312f14943024732bdee580': '145d040afbfb6886e00c7062d5c8341d', '68312fa2943024732bdee5e6': 'e8dd6e185ffd8ba39361554c871d2df1'}
      with open('results.txt', 'r') as infile_1, open('records.txt', 'r') as infile_2, open('scoring.txt', 'wb') as outfile:
          for line in infile_1:
              uid, timestamp = line.split()
              user_dict[int(uid)] = int(timestamp)
              for pid in range(problem_count):
                  penalty_dict[int(uid)][chr(pid + 65)] = 0
          for line in infile_2:
              rid, timestamp, uid, pid, status = line.split()
              timestamp, uid = int(timestamp), int(uid)
              minutes = (timestamp - user_dict[int(uid)]) // 60
              if rid in special_dict:
                  minutes = minutes + special_dict[rid]
              if status == "AC" and penalty_dict[int(uid)][pid] != -1:
                  score = max(400 - minutes - penalty_dict[int(uid)][pid] * 10, 200)
                  penalty_dict[int(uid)][pid] = -1
              else:
                  score = 0
                  if status != "CE":
                      penalty_dict[int(uid)][pid] = penalty_dict[int(uid)][pid] + 1
              content = session.get(url + rid).text
              soup = BeautifulSoup(content, 'html.parser')
              code_element = soup.find_all('code')
              code = code_element[0].get_text()
              md5_odject = hashlib.md5()
              md5_odject.update(code.encode('utf-8'))
              md5_hash = md5_odject.hexdigest()
              if rid in md5_dict:
                  md5_hash = md5_dict[rid]
              outfile.write(bytes(f"{pid} {md5_hash} {score}\n", encoding='utf-8'))
      
      • @ 2025-5-21 22:02:59

        祝贺 Sleeping Cup 评测量达到 1600!

        • @ 2025-5-18 23:16:46

          让我们庆祝 Sleeping Cup Motto (v1) 的诞生——

          Non-commercial competitive programming contests from all lands UNITE!

          (中文由于某些原因发不出去,这是 base64:5YWo5LiW55WM55qE5YWs55uK57yW56iL5q+U6LWb77yM6IGU5ZCI6LW35p2l77yB)

          Sleeping Cup 的新版网站图标与此同时发布。

          • @ 2025-5-18 21:40:28

            CTFPC-2nd 的复原工作全部完成!

            所有数据均为 Sleeping Cup 自造数据。

            • @ 2025-5-18 20:07:50

              CTFPC-1st 的题目上传完成!

              • @ 2025-5-16 20:03:12

                Update:我们即将支持查询 User Rated Competition History!我们尽量在 R5 开始前上线这一功能,保证在 R5 结束前上线这一功能。

                • @ 2025-5-11 22:06:48

                  Sleeping Cup #7 的题目筹备工作开始啦!

                  主观题将在本场比赛(而不是 Sleeping Cup #6)中回归。

                  新出题人 将参与工作。

                  值得一提的是,本场比赛将会出现通信题!

                  • @ 2025-5-18 22:49:13

                    期待,需要我提供洛谷通信题板子的 grader 吗

                  • @ 2025-5-21 22:02:34

                    @ 我看到了。然而 @ 投了其他题目,这个要顺延。(透露一下,这个题目其实是签到题。)

                • @ 2025-5-11 20:04:32

                  Sleeping Cup #6 的筹备工作正式开始啦!

                  本场比赛共有 4 道题目,比赛时间为 2 小时。

                  目前进度:5%

                  • @ 2025-5-10 22:33:51

                    我将复健!

                    • @ 2025-4-12 14:37:32

                      Happy birthday, Sleeping Cup!

                      • @ 2025-4-11 19:04:47

                        NOIP 2023 题目(P129 - P132)开放提交啦!

                        • @ 2025-4-6 17:05:34

                          希望多来点人打 Round 4。

                          • @ 2025-3-23 16:42:08

                            Update:我们即将在 Sleeping Cup's Ratings 上支持 Markdown 格式的比赛 Rating 记录(个人 Rating 记录)导出。

                            • @ 2025-3-9 17:01:55

                              大家好!

                              • @ 2025-3-9 17:01:38

                                欢迎新管理 Silver_Lighting 上任。

                                • @ 2025-3-8 12:29:23

                                  欢迎新出题人 加入 Sleeping Cup 出题组!

                                  这位出题人将在 Sleeping Cup #5 中担任全部出题工作,请大家拭目以待!

                                • @ 2025-3-2 19:47:48

                                  我向大家宣布个事,o3-mini 解不出 1 级难度的题目了!

                                  这道题目可能会在 R5 / R6 出现,请大家拭目以待!

                                  坏消息:这道题目不能出现了。

                                  好消息:这道题目的加强版将在 R6 出现,请大家拭目以待!

                                  • @ 2025-2-10 18:19:38

                                    • @ 2025-2-9 16:29:43

                                      我向大家宣布个事,o3-mini 解不出 1 级难度的题目了!

                                      这道题目可能会在 R5 / R6 出现,请大家拭目以待!

                                    • @ 2025-2-7 17:26:41

                                      我们刚刚提交了亿点点 AI 生成的代码,范围涵盖 Sleeping Cup #1 - Sleeping Cup #3。

                                    • @ 2025-1-28 21:03:31

                                      新年快乐!

                                      👍 4
                                      • @ 2025-1-1 14:55:41

                                        元旦快乐。

                                        👍 4
                                        • @ 2024-12-20 20:00:21

                                          喜报,我制造了exhdrating,可以实现所有基于Hydro的OJ的rating标识,Sleeping Cup也能用

                                          👍 4
                                          • @ 2024-12-18 23:29:33

                                            Sleeping Cup 支持通信题提交啦!

                                            • @ 2024-12-13 20:06:03

                                              大家好,我是新上任的社区管理员

                                              👍 5
                                              • @ 2024-12-14 12:37:28

                                                欢迎新社区管理员上任!

                                            • @ 2024-12-8 11:21:06

                                              社区管理 yangrenrui 上任啦!

                                              • @ 2024-11-25 16:38:18

                                                「今日运势」上线啦!

                                                • @ 2024-9-28 22:12:52

                                                  欢迎大家来水。

                                                  • 1