HDU1073_Online Judge

在线评测系统(OJ)入门:从评测机制到刷题路线全解析 在线评测系统(Online Judge,简称OJ)是算法学习与编程笔试中不可或缺的工具。其核心机制是自动编译代码、运行预设数据并逐字节比对输出结果,返回AC、WA、TLE等状态,这要求开发者不仅要掌握算法逻辑,还要熟悉输入输出格式、边界条件与浮点比较等细节。随着技术岗位招聘普及,华为OJ、牛客网等平台成为求职者备考的重要战场,而杭电OJ、郑州轻工业大学OJ等教学平台则服务于课程训练。理解不同平台的定位——从学校OJ的课程同步题到竞赛网站的高难题——能帮助学习者制定更高效的刷题路线。本文从评测流程入手,剖析常 阅读详情

Online Judge

http://acm.hdu.edu.cn/showproblem.php?pid=1073

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 7662    Accepted Submission(s): 2850


Problem Description
Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file, then the system compare the two files. If the two files are absolutly same, then the Judge System return "Accepted", else if the only differences between the two files are spaces(' '), tabs('\t'), or enters('\n'), the Judge System should return "Presentation Error", else the system will return "Wrong Answer".

Given the data of correct output file and the data of user's result file, your task is to determine which result the Judge System will return.
 

Input
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case has two parts, the data of correct output file and the data of the user's result file. Both of them are starts with a single line contains a string "START" and end with a single line contains a string "END", these two strings are not the data. In other words, the data is between the two strings. The data will at most 5000 characters.
 

Output
For each test cases, you should output the the result Judge System should return.
 

Sample Input
  
4 START 1 + 2 = 3 END START 1+2=3 END START 1 + 2 = 3 END START 1 + 2 = 3 END START 1 + 2 = 3 END START 1 + 2 = 4 END START 1 + 2 = 3 END START 1 + 2 = 3 END
 

Sample Output
  
Presentation Error Presentation Error Wrong Answer Presentation Error
 

Author
Ignatius.L

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char a1[5100] = { 0 }, a2[5100] = { 0 };
char b1[5100] = { 0 }, b2[5100] = { 0 };
char rub[5100];
void input(char a[])
{
    gets(rub);
    while (strcmp(rub, "START") != 0)
        gets(rub);
    while (gets(rub))
    {
        if (strcmp(rub, "END") == 0)
            break;
        if (strlen(rub) != 0)
            strcat(a, rub);
        strcat(a, "\n");
    }
}
void clear(char c[])
{
    int len = 0, i = 0, j = 0, k = 0;
    len = strlen(c);
    for (i = 0;i < len - 1;i++)
    {
        if (c[i] == ' ' || c[i] == '\t' || c[i] == '\n')
        {
            for (j = i;j < len;j++)
                c[j] = c[j + 1];
            c[len--] = '0';
            i--;
        }
    }
}

main()
{
    int T = 0, i = 0;
    scanf("%d", &T);
    for (i = 0;i<T;i++)
    {
        input(a1);
        input(a2);
        if (strcmp(a1, a2) != 0)
        {
            clear(a1);
            clear(a2);
            if (strcmp(a1, a2) == 0)
                printf("Presentation Error\n");
            else printf("Wrong Answer\n");
            memset(a1, 0, sizeof(a1));
            memset(a2, 0, sizeof(a2));
        }
        else
            printf("Accepted\n");
    }
}


Camera HAL 多线程管理详解 本文摘要:Camera HAL 采用双线程管理体系(CAMX与CHI-CDK)实现高效并发处理。CAMX ThreadManager负责HAL内部及框架交互,采用线程池+任务调度机制,将节点处理、回调等封装为Job异步执行;CHI ThreadManager专注于OEM定制逻辑,支持异步/同步两种作业模式。两套系统通过函数指针解耦但共享地址空间,共同实现硬件流水线的强实时性。文章详细解析了两者的类层次架构、核心数据结构及典型应用场景,并提供了问题排查的代码切入点,为Camera HAL开发与性能优化提供指导 阅读详情

相关推荐

nupkg 本地安装_使用Nuget安装离线包nupkg

一:Nuget简介:NuGet 是免费、开源的包管理开发工具,专注于在 .NET 应用开发过程中,简单地合并第三方的组件库。当需要分享开发的工具或是库,需要建立一个Nuget package,然后把这个package放到Nuget的站点。如果想要使用别人已经开发好的工具或是库,只需要从站点获得这个package,并且安装到自己的Visual Studio项目或是解决方案里。NuGet能更方便地把一...

weixin_34460380的博客 1万+

HDU - 1073 Online Judge

HDU-1073 Online Judge 问题描述: Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user’s result file, then the system compare the two files. If the tw

m0_51727949的博客 319

CloudCompare

分割点云:选中要分割的点云文件–>Segment–>左键框出要分割的点或者区域–>Segment Out–>Comfirm Segmentation,原点云文件被分割成两个结构,选中分割出来的remaining,右键delete即可。qSRA (Surface of Revolution Analysis):计算一个点云和一个假定旋转平面之间的距离(旋转平面用2D轮廓定义),距离计算好后,用户可以创建一个偏差的2D图或者圆柱或圆锥的投影。②表现为同样的对象或者至少有同样的形状。

xiaoyaolangwj的博客 4709

hdu 1073 Online Judge

这题输入有问题,,,错了。

java编程 831

YOLOv11+BiFPN双向特征金字塔:全方位解析多尺度检测性能优化指南

飞书链接:https://ecn6838atsup.feishu.cn/wiki/EhRtwBe1CiqlSEkHGUwc5AP9nQe?购买即可解锁800+YOLO优化文章,并且还有海量深度学习复现项目,价格仅需两杯奶茶的钱,每日更新。函数中添加BiFPN的解析逻辑(找到。链接可用,不要多复制空格了。密码:946m22&8。

FJN110的博客 308

CAPL编程规范与最佳实践

通过本文的学习,读者应该对CAPL编程规范与最佳实践有了初步的了解,并能够编写高质量的CAPL脚本。在实际项目中,CAPL的应用非常广泛,希望读者能够通过不断的学习和实践,掌握更多的CAPL技巧,提高自己的开发能力。

闲人编程的博客 1750

OJ —— Online Judge

OJ介绍、OJ网站推荐

Edward2022的博客 7843

把 SAP 配置当成一张地图:用 IMG 把实施、变更与治理串成一条清晰的路

摘要 SAP IMG(Implementation Guide)是SAP实施的核心导航体系,它将客户需求转化为系统配置,提供结构化路径和文档化支持。IMG不是简单的菜单树,而是包含业务落地路径、标准化配置活动和文档化知识的实施语言。通过三种视图(Reference、Enterprise、Project)解决不同管理问题,其中Project IMG尤其重要,可管理项目范围、分工和进度。实际工作中应通过SPRO事务码访问IMG,将探索与执行分开管理。案例显示,跨国企业通过Project IMG可有效控制组织架构

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 230

HDU 1073 Online Judge

/* 模拟OJ系统进行测评的过程 如何去测评两组数据呢?完全匹配当然就是AC啦,那PE和WA如何发现呢? 题目思路: 将输入的两组数据去掉'\n','\t' 和' ',得到新的两组数据, 那么这两组数据如果不是完全匹配的,结果一定是WA。 如果这两组匹配了,去掉'\n','\t' 和' '前的不完全匹配则是PE。 如果去掉前的两组数据完全匹配,则是AC。 */ # include # inclu

天道酬勤 657

Calibre 3Dstack --每日一个命令day27【overlap】(3-27)

本文介绍了Calibre3Dstack中overlap命令的使用方法。该命令用于检查两个已放置层之间的重叠量是否符合要求,支持设置检查名称、层类型、堆叠范围、检查方向等参数。关键参数包括:-constraint指定重叠约束条件,-exact控制百分比精度,-by_area切换为面积检查模式,-intersection报告相交区域。检查结果可通过RVE选项定制显示方式,适用于3D堆叠设计中的层间重叠验证场景。

u013620135的博客 113

R语言中的Gamma分布函数

在R语言中,我们可以使用最大似然估计(Maximum Likelihood Estimation,MLE)或最小二乘估计(Least Squares Estimation,LSE)等方法来估计Gamma分布的参数。本文介绍了在R语言中使用Gamma分布函数的基本操作,包括生成随机变量、计算概率密度函数和累积分布函数,以及参数估计和拟合。函数来生成Gamma分布的随机变量,计算概率密度函数(PDF)和累积分布函数(CDF),以及进行参数估计和拟合。要计算Gamma分布的累积分布函数(CDF),我们可以使用。

ByteWhiz的博客 1633

HDU 1073 Online Judge

Online Judge Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1073 Description Ignatius is building an Online Judge, now he has

光明~~~ 3万+

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

HDU 1073- Online Judge

Online Judge  题目描述: Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result f

Titanium_S的博客 752

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Online Judge HDU - 1073 (字符串)

https://vjudge.net/problem/HDU-1073 这里不介绍题目了,长驱直入 直奔主题: 我们暂时定义需要核对的字符为"有效字符", 其他的为"空白符" 1.一定要认真读题,题目中The data will at most 5000 characters. 首先START 和 END 之间的所有都是 data,然后为什么强调字符数不强调行数呢?自己思考后发现,太##妙了!仅...

Jungle~St... 347

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

hdu1073 Online Judge

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073 题解:首先比较原字符串,相同输出accepted,不同在比较字符串去除: ' ', '\t', '\n',一样输出Presentation Error,否则输出Wrong Answer. #include #include #define MAXN 5002 cha

不可不戒 1185

HDU1073 Online Judge

Online Judge Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6630    Accepted Submission(s): 2506 Problem Description Ignatius is b

xu_fish的博客 1652

HDU1073 Online Judge

Online Judge Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5373    Accepted Submission(s): 2054 Problem Description Ignatius is b

长风的专栏 979

HDU1073:Online Judge

Problem Description Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file,

ACM!荣耀之路! 2917
上一篇: HDU1048_The Hardest Problem Ever
下一篇: HDU1088_Write a simple HTML Browser
ZayneHuang
博客等级 码龄10年 5粉丝 116原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值