lemon special judge模板
/*
argv[1]:输入文件
argv[2]:选手输出文件
argv[3]:标准输出文件
argv[4]:单个测试点分值
argv[5]:输出最终得分的文件
argv[6]:输出错误报告的文件
*/
#include<bits/stdc++.h>
int n,k,a[100100];
using namespace std;
void out_false1();
void out_false2();
void out_ok();
int main(int argc,char *argv[])
{
FILE *f_stdin=fopen(argv[1],"r");//标准输入
FILE *f_out=fopen(argv[2],"r");//选手输出
FILE *f_stdout=fopen(argv[3],"r");//标准输出
FILE *f_score=fopen(argv[5],"w");//分数输出
FILE *f_wrong=fopen(argv[6],"w");//错误信息
fscanf(f_stdin,"%d%d",&n,&k);
int i;
for (i=1;i<=n;i++) fscanf(f_stdin,"%d",&a[i]);
int x,y;bool ok=1;
while (fscanf(f_out,"%d%d",&x,&y)!=EOF)
{
if (a[y]<a[x]) {ok=0;break;}
a[y]-=a[x];a[x]+=a[x];
}
if (!ok) {fprintf(f_wrong,"Wrong Answer");fprintf(f_score,"0");}
else
{
int pos=0;
for (i=1;i<=n;i++)
{
if (a[i])
{
if (pos==0) pos=i;else {ok=0;break;}
}
}
if (ok) fprintf(f_score,"10");
else {fprintf(f_wrong,"Wrong Answer");fprintf(f_score,"0");}
}
return 0;
}
lemon special judge模板的更多相关文章
- 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)
转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...
- csu oj 1344: Special Judge
Description Given a positive integer n, find two non-negative integers a, b such that a2 + b2 = n. I ...
- 如何给LOJ补全special judge
首先你要会写一个叫$data.yml$的东西, 这里面记录了这道题的$subtask$计分策略 也告诉了评测姬这道题是提交答案还是$spj$还是交互题 那么,$YAML$语言是啥啊? 别问我,我也不会 ...
- Special Judge Ⅱ
Problem Description Q:什么是 Special Judge,Special Judge 的题目有什么不同? A:一个题目可以接受多种正确答案,即有多组解的时候,题目就必须被 Spe ...
- hustOJ SPJ(special judge)模板
#include <stdio.h> #include <math.h> #define PI acos(-1.0) #define AC 0 #define WA 1 int ...
- 二分 题目 压缩打包 Special Judge? 不不不 当然不是
http://noi.openjudge.cn/ch0111/ No 题目 分数 01 查找最接近的元素 10 3176 02 二分法求函数的零点 10 2181 03 矩形分割 10 1420 04 ...
- 关于CCR测评器的自定义校验器(Special Judge)
引言 有时我们需要使用CCR测评器(CCR-Plus是一个开源的信息学竞赛测评软件,Github链接https://github.com/sxyzccr/CCR-Plus)进行SpecialJudge ...
- POJ 2367:Genealogical tree(拓扑排序模板)
Genealogical tree Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7285 Accepted: 4704 ...
- POJ 1861 Network (Kruskal算法+输出的最小生成树里最长的边==最后加入生成树的边权 *【模板】)
Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14021 Accepted: 5484 Specia ...
随机推荐
- 01 Django REST Framework 介绍
01-Django REST Framework的介绍 Django REST框架是一个用于构建Web API的强大而灵活的工具包. 您可能希望使用REST框架的一些原因: 1. Web可浏览API对 ...
- HDU - 1542 扫描线入门+线段树离散化
扫描线算法+线段树维护简介: 像这种求面积的并集的题目,就适合用扫描线算法解决,具体来说就是这样 类似这种给出点的矩形的对角的点的坐标,然后求出所有矩形面积的交集的问题,可以采用扫描线算法解决.图如下 ...
- react 项目搭建
1.首先运行环境-node是必须的,需要下载安装node的运行环境: 2.安装好了node之后,自然的就有了npm: 3.npm install -g creact-react-app/全局安装cre ...
- 02-HTML之head标签
head标签 head内常用标签表 标签 类型 意义 <title></titile> 双闭合标签 定义网页标题 <style></style> 双闭合 ...
- 如何在Anaconda中把python环境更新更高版本
把Anaconda中的python从3.5.5更新到3.6版本,不想卸载重新安装.办法如下: 开始->Anaconda Promot 在Anaconda Promot中,输入: conda up ...
- 最全的Django入门及常用配置
Django 常用配置 Django 安装 pipx install django x 为python解释器版本2 or 3 如果你想安装指定版本的django,使用pip install djang ...
- #Leetcode# 633. Sum of Square Numbers
https://leetcode.com/problems/sum-of-square-numbers/ Given a non-negative integer c, your task is to ...
- 在eclipse中spring的xml配置文件标签中class路径全限定名自动提示设置
这个自动提示其实很简单,没有网上说的那些要在help下的Install中输入网址来下载更新一堆东西那么复杂. 只需要打开Help — — >Eclipse Marketplace... 然后在该 ...
- kibana——es的批量操作
一·_mget: 1.创建的索引如下: 2.批量查询: #查询两个 GET _mget { "docs":[ { "_index":"testdb&q ...
- django restframework PrimaryKeyRelatedField筛选的困惑
一.在开发某运动app时,遇见以下情况 1.部分表内容如下: class Sports(models.Model): ''' 运动表 ''' school = models.ForeignKey(Sc ...