1 Star 0 Fork 28

CC / online-judge

forked from Jungle / online-judge 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
GPL-2.0

最好的跨平台Online Judge

Table of contents

演示地址:

敬请期待

平台简介

没错,我们支持Windows平台,也支持Linux平台(Linux下当前仅支持Virtual Judge)。
Online Judge平台系统(简称OJ)是一个B/S架构的源程序判题系统。用户可以在线提交多种程序(如C、C++、Java)源代码,系统对源代码进行编译和执行,并通过预先设计的测试用例来检验程序源代码的正误。 用户可以在Online Judge系统上练习编程,参加竞赛,与其他用户讨论交流,提高自己的编程水平,并可以用于数据结构、程序设计教学的实验和考试。

支持特性:

  1. Online Judge Kernel支持所有可命令行编译和运行的程序语言;支持按语言分布式部署;支持动态添加程序语言。
  2. Online Judge Kernel支持Virtual Judge:http://acm.hdu.edu.cn
  3. Online Judge Kernel支持命令行管理,命令行特性支持命令联想、自动补全等功能,极大方便了系统的管理。(这是我们的特色)
  4. Online Judge Kernel支持ACM和OI模式的判题,可以通过命令行judge mode acm(oi)灵活切换,默认为ACM模式;
  5. Online Judge Kernel支持作为Telnet服务器,被远程连接管理。
  6. Online Judge Kernel支持作为FTP服务器,提供FTP服务。
  7. Online Judge Kernel支持API Hook安全防护。
  8. Online Judge Web Platform支持ACM和CodeJam两种竞赛模式。
  9. Online Judge Kernel支持采集知名OJ的最近比赛信息(CodeforcesZOJHDUAtCoderHihoCoder,持续添加)。

目录说明:

  1. judger-kernel:OJ的判题核心代码,C语言
  2. judger-web-platform:OJ的Web端代码,java语言
  3. judger_sql:OJ的数据库文件

部署指导

运行环境

  1. 操作系统:Windows XP/7/8/8.1/10, Windows Server 2003/2008/2012

  2. JAVA JDK:Java JDK1.6(推荐)
    OJ系统对JDK安装位置没有要求,直接安装完成。以安装D:\Java\jdk1.6.0_10为例。
    然后添加环境变量:

    JAVA_HOME=D:\Java\jdk1.6.0_10
    path=%JAVA_HOME%\bin
  1. Web容器:Apache Tomcat 6(推荐);安装目录:D:\tomcat6

  2. 数据库:MySQL 5.1.55(推荐)
    字符集选择GBK,端口选择默认的3306,设置用户名root,密码rootpwd
    然后创建gdoj命名的数据库,并执行online-judge\judger_sql目录下的sql_import_struct.bat一键导入gdoj_struct.sql

  3. 编译环境:GCC、JAVA、PASCAL、Python、Ruby等编程语言编译环境
    可下载online-judge/judger_compiler后,运行env.bat一键配置GCC、JAVA、PASCAL,但要注意修改JAVA_HOME的正确路径:

     set JAVA_HOME=D:\Java\jdk1.6.0_10
     setx JAVA_HOME "D:\Java\jdk1.6.0_10" /m

部署网站

  • 删除目录D:\tomcat6\webapps\ROOT里的文件,然后直接拷贝judger-web-platform/gdoj/WebRoot目录里的文件到ROOT。 如:输入图片说明
  • 根据需要配置D:\tomcat6\webapps\ROOT\WEB-INF\classes\config.properties
OJ_WEB=D\:\\tomcat6\\webapps\\ROOT\\   
OJ_PATH=D\:\\OJ\\
OJ_DATA_PATH=D\:\\OJ\\data\\
OJ_JUDGE_LOG=D\:\\OJ\\OJ_JUDGE_LOG\\
OJ_LANG_PATH=D\:\\OJ\\conf\\Language.xml
OJ_JUDGER_IP=127.0.0.1   ------> 这个很重要,用于WEB与OJ-Kernel通信的IP
OJ_JUDGER_PORT=5000      ------> 这个很重要,用于WEB与OJ-Kernel通信的端口号,必须与OJ-Kernel的配置一致
  • 配置D:\tomcat6\webapps\ROOT\WEB-INF\classes\applicationContext.xml中mysql数据库的密码
<property name="username" value="root"></property>
<property name="password" value="rootpwd"></property>

部署判题核心

  • 创建目录D:\OJ,并拷贝judger-kernel/build/release到OJ目录下,如:输入图片说明

  • 预配置OJ启动配置文件D:\OJ\conf\config.ini

[System]
sock_port=5000  -----> 系统本地Socket监听的端口号,需要保持与config.properties中的一致
  • 运行judge.exe启动判题核心程序
启动后界面如下,并通过display current-configuration查看当前配置
=====================================================
OS Main-task Running...
Command Task init ok...
Command Task RegistAppInfo ok...
Debug-Center Task RegistAppInfo ok...
TELNET Task init ok...
TELNET Task RegistAppInfo ok...
Connect MySQL(localhost, root, rootpwd, gdoj, 3306) ok...
Judge Task init ok...
Judge Task RegistAppInfo ok...
NDP Task init ok...
NDP Task RegistAppInfo ok...
Command Task running ok...
Debug-Center Task running ok...
TELNET Task running ok...
Judge Task running ok...
NDP Task running ok...
OS Main-task init ok...
Socket bind port 5000 ok...
Socket listen ok...
Recover configuration begin.
Info: system name change to judger successful.
TELNET server socket bind port 23 ok...
TELNET server socket listen port 23 ok...
Info: Please reboot to take effect.
Eecover configuration end.
Press any key to continue.

judger>
judger>display current-configuration
#version V100R001C00B090
sysname judger
#
telnet server enable
#
aaa
 local-user admin password Root@123
#
mysql url localhost port 3306 username root password rootpwd table gdoj
#
#
judge-mgr
 mode oi
 testcase-path D:\OJ\data\
#
virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000
#
return
#
judger>

高级配置

熟悉命令行

用户通过命令行对系统下发各种命令来实现对系统的配置与日常维护操作。

  • 不完整命令字输入
    系统支持不完整命令字输入,即在当前视图下,当输入的字符能够匹配唯一的命令字时,可以不必输入完整的命令字。该功能提供了一种快捷的输入方式,有助于提高操作效率。
#如输入dis us和完整输入display users都能执行命令获取当前登录系统的用户
Judge-Kernel]dis us
   #   Type     Delay        Network Address   Socket  Username
 ---------------------------------------------------------------------
 + 0   Console  00:00:00     127.0.0.1         -       -
   1   Telnet   00:25:42     127.0.0.1         588
Judge-Kernel]display users
   #   Type     Delay        Network Address   Socket  Username
 ---------------------------------------------------------------------
 + 0   Console  00:00:00     127.0.0.1         -       -
   1   Telnet   00:25:45     127.0.0.1         588
Judge-Kernel]
  • Tab键自动补全命令字
    输入不完整的命令字后按下Tab键,系统将自动补全命令字。
    如果TAB自动补全能匹配到多个命令字,循环TAB时将循环显示所有的命令字。
Judge-Kernel>display us  
#该状态下按下TAB                          
Judge-Kernel>display users 
  • 命令行在线帮助
    在线帮助是指在任何时候任何视图下,用户可以通过输入“?”来获取在线帮助。
    用户复杂的命令行过于繁琐而难以记忆时使用,以便完成命令行的正确输入。
Judge-Kernel>?
 debugging                Debugging switch
 display                  Display
 quit                     Quit from the current system view
 return                   Return to the user view
 system-view              Enter the system view
 terminal                 Terminal
 undo                     Undo operation
Judge-Kernel>dis?
 display                  Display
Judge-Kernel>dis
Judge-Kernel>display ?
 command-tree             Command tree
 current-configuration    Current Configuration
 debugging                Debugging switch
 history                  Histrory command
 judge                    Judge of OJ
 ndp                      NDP
 save-configuration       Save-configuration
 users                    Users
 <cr>
Judge-Kernel>display us?
 users                    Users
Judge-Kernel>display us
Judge-Kernel>display users ?
 <cr>
Judge-Kernel>                                                                                                       
  • 进入命令行视图
  1. 用户视图
    用户从终端成功登录至系统即进入用户视图,在屏幕上显示:
Judge-kernel>

在用户视图下,用户可以完成查看运行状态和统计信息等功能。

  1. 系统视图
    在用户视图下,输入命令system-view后回车,进入系统视图。
    在系统视图下,用户可以配置系统参数以及通过该视图进入其他的功能配置视图。
Judge-Kernel>system-view  
Judge-Kernel]           
Judge-Kernel]?
 aaa                      Authentication Authorization Accounting
 diagnose-view            Enter the daignose view
 display                  Display
 hdu-judge                HDU-Judge
 judge                    Judge of OJ
 mysql                    Mysql
 ndp                      NDP
 quit                     Quit from the current system view
 reboot                   Reboot Judge kernel
 return                   Return to the user view
 save                     Save configuration
 sysname                  Set system name
 telnet                   Telnet Protocol
 undo                     Undo operation
 virtual-judge            Virtual judge
Judge-Kernel]
  1. 诊断视图
    在系统视图下,输入命令diagnose-view后回车,进入诊断视图。
    在诊断视图下,用户可以执行一些诊断命令,以及一些高级配置,建议在熟悉系统的工程师使用。
Judge-Kernel]diagnose-view                                                       
Judge-Kernel-diagnose]  
Judge-Kernel-diagnose]?                                       
 display                  Display                            
 quit                     Quit from the current system view    
 return                   Return to the user view                     
 set                      Set value                         
 version                  Show version of solfware             
Judge-Kernel-diagnose]     
  1. 退出视图
    通过输入quit命令,可以退出当前视图,并回退到上一层视图。
    也可以通过return命令,直接回退到用户视图
#通过quit回退到上一层视图
Judge-Kernel-diagnose]quit
Judge-Kernel]
#直接通过return惠推倒用户视图
Judge-Kernel-diagnose]return
Judge-Kernel>

Judger基础配置

  • judge enable
    1)命令行功能:
    judge enable 命令用于使能judge功能
    undo judge enable 命令用于去使能judge功能
    缺省情况下,judge功能处于使能状态
    2)视图:
    系统视图
    3)使用举例
#使能judge功能
Judge-Kernel>system-view 
Judge-Kernel]judge enable
#去使能judge功能
Judge-Kernel>system-view 
Judge-Kernel]undo judge enable
  • judge-mgr
    1)命令行功能:
    judge-mgr 命令用于进入judge-mgr视图,以便配置本地judger相关配置
    2)视图:
    系统视图
    3)使用举例
#进入judge-mgr视图
judger>system-view
judger]judge-mgr
judger-judge-mgr]
  • mode
    1)命令行功能:
    mode acm 命令用于切换judger为acm模式
    mode oi 命令用于切换judger为oi模式
    缺省情况下,judger处于acm模式
    2)视图:
    judge-mgr视图
    3)使用举例
#切换judger为acm模式
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]mode acm
#切换judger为oi模式
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]mode oi
  • security enable
    安全防护(API HOOK)可以保护OJ不被恶意提交的程序破坏,如关机、关闭进程等操作。
    1)命令行功能:
    security enable 命令用于使能安全防护(API HOOK)
    undo security enable 命令用于去使能安全防护(API HOOK)
    缺省情况下,judger安全防护(API HOOK)是使能的
    注意:当前该功能并不成熟,如果出现误判,在可以保证不出现攻击的情况下,可以先选择关闭,然后联系我们解决。 2)视图:
    judge-mgr视图
    3)使用举例
#使能安全防护(API HOOK)
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]security enable
#去使能安全防护(API HOOK)
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]undo security enable
judger-judge-mgr]display this
#
judge-mgr
 undo security enable
 testcase-path D:\OJ\data\
#
return
#
judger-judge-mgr]
  • auto-detect enable
    自动检测用于自动发现未完成判题的提交,避免因设备故障导致的部分提交未完成能够及时发现并判题。
    1)命令行功能:
    auto-detect enable 命令用于使能自动检测
    undo auto-detect enable 命令用于去使能自动检测
    缺省情况下,judger自动检测是去使能的
    2)视图:
    judge-mgr视图
    3)使用举例
#使能自动检测
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]auto-detect enable
  • testcase-path
    1)命令行功能:
    testcase-path STRING<1-256> 命令用于配置judger的测试用例目录
    2)视图:
    judge-mgr视图
    3)使用举例
#配置judger的测试用例目录为D:\OJ\data\
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]testcase-path D:\OJ\data\
judger-judge-mgr]display this
#
judge-mgr
 testcase-path D:\OJ\data\
#
return
#
judger-judge-mgr]
  • ignore extra-space enable
    1)命令行功能:
    ignore extra-space enable 命令用于配置judger的判题时忽略多余的空格换行,以便不报格式错误
    2)视图:
    judge-mgr视图
    3)使用举例
#配置judger使能忽略多余空格换行
judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]ignore extra-space enable
judger-judge-mgr]display this
#
judge-mgr
 ignore extra-space enable
#
return
#
judger-judge-mgr]

Virtual Judge配置

  • virtual-judge enable
    当前仅支持hdu的虚拟判题。
    1)命令行功能:
    virtual-judge enable 命令用于使能虚拟判题功能
    undo virtual-judge enable 命令用于去使能虚拟判题功能
    缺省情况下,虚拟判题功能处于去使能状态
    2)视图:
    系统视图
    3)使用举例
#使能虚拟判题功能
Judge-Kernel>system-view 
Judge-Kernel]virtual-judge enable
#去使能虚拟判题功能
Judge-Kernel>system-view 
Judge-Kernel]undo virtual-judge enable
  • hdu-judge enable
    1)命令行功能:
    hdu-judge enable 命令用于使能HDU虚拟判题功能
    undo hdu-judge enable 命令用于去使能HDU虚拟判题功能
    缺省情况下,HDU虚拟判题功能处于去使能状态
    2)视图:
    系统视图
    3)使用举例
#使能HDU虚拟判题功能
Judge-Kernel>system-view 
Judge-Kernel]hdu-judge enable
#去使能HDU虚拟判题功能
Judge-Kernel>system-view 
Judge-Kernel]undo hdu-judge enable
  • virtual-judge-mgr
    1)命令行功能:
    virtual-judge-mgr 命令用于进入virtual-judge-mgr视图,以便配置virtual judger相关配置
    2)视图:
    系统视图
    3)使用举例
#进入virtual-judge-mgr视图
judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]
  • hdu-judge username password
    1)命令行功能:
    hdu-judge username STRING<1-24> password STRING<1-24> 命令用于配置HDU虚拟判题下,在HDU平台上的账号
    2)视图:
    virtual-judge-mgr视图
    3)使用举例
#配置HDU虚拟判题在HDU平台上的账号和密码为root/root@123
judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge username root password root@123
  • hdu-judge remote-judge enable
    使能HDU虚拟判题远端裁判功能后,HDU的虚拟判题将在分布式部署的其他OJ系统执行相关判题。 1)命令行功能:
    hdu-judge remote-judge enable 命令用于使能HDU虚拟判题远端裁判功能
    undo hdu-judge remote-judge enable 命令用于去使能HDU虚拟判题远端裁判功能
    缺省情况下,HDU虚拟判题远端裁判功能处于去使能状态。
    注意还需要配置远端OJ服务器的IP和端口号( hdu-judge ip STRING<1-24> port INTEGER<1-65535> )。
    2)视图:
    virtual-judge-mgr视图
    3)使用举例
#使能HDU虚拟判题远端裁判功能
judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge remote-judge enable
#去使能HDU虚拟判题远端裁判功能
judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]undo hdu-judge remote-judge enable
  • hdu-judge ip port
    1)命令行功能:
    hdu-judge ip STRING<1-24> port INTEGER<1-65535> 命令用于配置远端OJ服务器的IP和端口号
    2)视图:
    virtual-judge-mgr视图
    3)使用举例
#配置分布式远端hdu-judger的OJ服务器IP和端口号
judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge ip 192.168.1.2 port 5001

Telnet配置

  • telnet server enable
    使能Telnet服务器功能后,才能通过telnet协议远程登陆管理系统。
    1)命令行功能:
    telnet server enable 命令用于使能Telnet服务器
    undo telnet server enable 命令用于去使能Telnet服务器
    缺省情况下,Telnet服务器处于去使能状态
    2)视图:
    系统视图
    3)使用举例
#使能Telnet服务器
Judge-Kernel>system-view 
Judge-Kernel]telnet server enable
#去使能Telnet服务器
Judge-Kernel>system-view 
Judge-Kernel]undo telnet server enable
  • telnet authentication-mode
    1)命令行功能:
    telnet authentication-mode none 命令用于配置Telnet服务器的认证方式为不认证,即telnet登陆后不需要输入账号和密码。
    telnet authentication-mode password 命令用于配置Telnet服务器的认证方式为密码认证,即telnet登陆后需要输入账号和密码。
    telnet authentication-mode aaa 命令用于配置Telnet服务器的认证方式为AAA认证,即telnet登陆后需要输入AAA账号和密码。
    缺省情况下,Telnet服务器的认证方式为不认证
    Telnet服务器的认证方式多次配置以最后一次为准。
    2)视图:
    系统视图
    3)使用举例
#配置Telnet服务器的认证方式为不认证
Judge-Kernel>system-view 
Judge-Kernel]telnet authentication-mode none
#配置Telnet服务器的认证方式为密码认证,并创建telnet账号和密码
Judge-Kernel>system-view 
Judge-Kernel]telnet authentication-mode password
Info: Please create telnet username and password.
Judge-Kernel]
Judge-Kernel]telnet username admin password admin@123
#配置Telnet服务器的认证方式为AAA认证,并创建一个aaa用户并且服务类型为telnet
Judge-Kernel>system-view 
Judge-Kernel]telnet authentication-mode aaa
Info: Please create AAA username and password.                                                                                      
Judge-Kernel]
Judge-Kernel]aaa
Judge-Kernel-aaa]local-user root password Root@123 service-type telnet

FTP配置

  • ftp server enable
    使能ftp 服务器功能后,才能通过ftp协议传输下载文件。
    需要同时创建一个服务类型为ftp的AAA用户,才能连接
    1)命令行功能:
    ftp server enable 命令用于使能ftp服务器
    undo ftp server enable 命令用于去使能ftp服务器
    缺省情况下,ftp服务器处于去使能状态
    2)视图:
    系统视图
    3)使用举例
#使能ftp服务器
Judge-Kernel>system-view 
Judge-Kernel]ftp server enable
#去使能ftp服务器
Judge-Kernel>system-view 
Judge-Kernel]undo ftp server enable
#创建一个aaa用户并且服务类型为ftp
Judge-Kernel>system-view 
Judge-Kernel]telnet authentication-mode aaa
Info: Please create AAA username and password.                                                                                      
Judge-Kernel]
Judge-Kernel]aaa
Judge-Kernel-aaa]local-user ftp password Root@123 service-type ftp

日常维护命令

  • display judge brief
    1)命令行功能:
    display judge brief 命令用于查看当前judger的基础配置。
    2)视图:
    NA
    3)使用举例
#查看当前judger的基础配置
Judge-Kernel>display judge brief
# Local Judger Info
  Global Judge Is Enable
  Sysname   : Judge-Kernel
  Sock Port : 5000
  Judge Mode: ACM
  Data Path : D:\OJ\data\
  Last Judge: 1970-01-01 08:00:00
 ==========================================================================
# Virtual Judger Info
  Global Virtual Judge Is Enable
  HDU domain: http://acm.hdu.edu.cn
  Judger | Account | Password | Status | Remote |   Judger-IP   | J-Port
  -------------------------------------------------------------------------
  HDU     weizengke  weizengke  Enable   Disable  192.168.1.2     5001
 ==========================================================================
# MySQL Info
  URL       : localhost
  Username  : root
  Password  : rootpwd
  Table-Name: gdoj
  Port      : 3306
 ==========================================================================
Judge-Kernel>
  • sysname
    1)命令行功能:
    **sysname STRING<1-24> ** 命令用于更改系统名称,最长24个字符
    2)视图:
    系统视图
    3)使用举例
#更改系统名称为judger
Judge-Kernel>system-view 
Judge-Kernel]sysname judger                                        
Info: system name change to judger successful.                  
judger]
  • save
    1)命令行功能:
    save 命令用于保存系统配置,以便重启后配置任然生效。
    2)视图:
    系统视图
    3)使用举例
Judge-Kernel>system-view 
Judge-Kernel]save      
Info: Save configuration successfully.    
Judge-Kernel]                                                                        
  • display current-configuration
    1)命令行功能:
    display current-configuration 命令用于查看当前配置
    2)视图:
    任意视图
    3)使用举例
Judge-Kernel>display  current-configuration
judger]display  current-configuration
#version V100R001C00B090
sysname judger
#
telnet server enable
telnet authentication-mode aaa
#
aaa
 local-user admin password Root@123 service-type telnet
#
judge-mgr
 testcase-path D:\OJ\data\
#
virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000
#
return
#
judger]
  • display save-configuration
    1)命令行功能:
    display save-configuration 命令用于查看当前保存的配置文件中的配置
    2)视图:
    任意视图
    3)使用举例
Judge-Kernel>display save-configuration
#version V100R001C00B090
sysname judger
#
telnet server enable
#
aaa
 local-user admin password Root@123 service-type telnet
#
judge-mgr
 mode oi
 testcase-path D:\OJ\data\
#
virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000
#
return
#
judger]
  • display users
    1)命令行功能:
    display users 命令用于查看当前登录到系统的用户
    2)视图:
    任意视图
    3)使用举例
Judge-Kernel]display users                                                        
   #   Type     Delay        Network Address   Socket  Username                       
 ---------------------------------------------------------------------                     
   0   Console  00:01:05     127.0.0.1         -       -                        
 + 1   Telnet   00:00:00     127.0.0.1         588                         
Judge-Kernel] 
#带+号的为当前用户。
  • display history
    1)命令行功能:
    display history [ INTEGER<1-100> ] 命令用于查看当前用户的历史执行命令,可以指定需要显示的条数,最大100条
    2)视图:
    任意视图
    3)使用举例
Judge-Kernel>display history 10
display current-configuration
judge enable
system-view
Judge-Kernel>

Linux下部署:

目前Linux下除了本地判题,Kernel其他特性都支持,文档暂没有时间写。主要就是在bin目录下直接./vos.o启动kernel。

GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., [http://fsf.org/] 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) 2018 Jungle.Wei This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.

简介

The Best Cross Platform Online Judge,Online Judge Kernel,Virtual Judge Adapter,Command-Line Interface 展开 收起
C++
GPL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/iPearrr/online-judge.git
git@gitee.com:iPearrr/online-judge.git
iPearrr
online-judge
online-judge
master

搜索帮助