• Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Presentation error for online judge in C++

This is the problem. https://dunjudge.me/analysis/problems/838/ . Essentially its to create a square with layers that keep increasing like so.

I have already figured out the logic and have implemented it myself. I can replicate the testcase and tried to work out some examples.

However it is always giving me a so called presentation error whilst I can match the sample case. Hence I am not sure how to fix my answer.

  • presentation
  • Are you supposed to have a space at the end of each line? Probably not, so you'll have to figure out a way around that. Perhaps print the space before each value except the first on each line. –  Retired Ninja Commented Nov 19, 2020 at 5:09
  • Oh thats a good idea i'll give it a shot thanks –  user14666472 Commented Nov 19, 2020 at 5:11
  • 2 I hope you're aware of Why should I not #include <bits/stdc++.h>? and Why is “using namespace std;” considered bad practice? –  Some programmer dude Commented Nov 19, 2020 at 5:14
  • Yeah I am aware, just decided to use it for strictly competitions. In project work I take note of that. Thanks for the heads up still. –  user14666472 Commented Nov 19, 2020 at 5:45

This might be a simpler way to go about this

Kostas's user avatar

  • It prints a space after every column and \n after the last one. The string is indexed by a bool (0|1). –  Kostas Commented Nov 19, 2020 at 7:17
  • I'm not sure if I'm horrified or amazed by that trick! :) –  Retired Ninja Commented Nov 20, 2020 at 0:48

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

  • Featured on Meta
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network...
  • Announcing a change to the data-dump process
  • What makes a homepage useful for logged-in users

Hot Network Questions

  • Is evolution anti-entropic?
  • How to handle undefined Integral results for excluded conditions in Mathematica
  • Is a continuous function a generalization of an adjunction?
  • How should I understand "mit" in this sentence?
  • What is a proper word for (almost) identical products?
  • How do you turn off an iPhone so it consumes no battery?
  • How can I condense my bash script to look for 42 extensions in a directory
  • Why do the Fourier components of a piano note shift away from the harmonic series?
  • How do Trinitarian Christians respond to these differences between Jesus Christ and God
  • What (and why) is right and wrong? (For humanity, as a whole)
  • Can Curve25519 shared secret be safely truncated to half its size?
  • Clock that is twice as fast
  • Why call for Biden to step down now?
  • Is philosophy science or humanities?
  • In hetero- homodyne detection, what does it mean to operate at the Quantum Shot Noise limit?
  • Had there ever been a plane crash caused by flying too high and exploding?
  • Why does Agda use Set instead of Type?
  • Finite verification for theorems due to Busy Beaver numbers
  • Homotopy (co)limits in oo-categories vs model categories
  • Calculate sum of self-exponentation
  • In the onion-like elemental layers of a large mature star the neon is closer to the surface than oxygen, even though it is more massive... Why?
  • How could breastfeeding/suckling work for a beaked animal?
  • How do I maintain Bezier circle resolution when selecting fill mode "none" for processing with Geometry Nodes?
  • Need help deciphering word written in Fraktur

presentation error vjudge

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presentation error: Judge does not trim or wrap trailing spaces and judges 'Wrong Answer' #365

@joonion

joonion commented Apr 3, 2021

Hi, thanks for your great job.

In my testcases with trailing spaces, judge does not trim or wrap the input and output.
Therefore it judges the submission as a 'Wrong Answer', if the input has different number of trailing spaces.

As an example, a submission with the following input and output is judged as a 'Wrong Answer'
1.in: 1 2 3\n4 5 6
1.out: 1 2. 3' '\n4 5 6

No branches or pull requests

@joonion

OJ中常见的一种presentation error解决方法

presentation error vjudge

说明是结果正确了,但是输出格式错误了,常常是多了或者少了空格、换行之类的。

我的代码:

显示PE,但是我反复看题目也看不出来,看别人A过的代码:

我的输出结果和大佬的输出结果:

presentation error vjudge

肉眼看半天也看不错区别

解决:我的是每行最后一列数组元素都输出了空格+换行,而正确的是每行最后一列数组元素输出换行,不能加空格。

很隐蔽,很坑。

presentation error vjudge

“相关推荐”对你有帮助么?

presentation error vjudge

请填写红包祝福语或标题

presentation error vjudge

你的鼓励将是我创作的最大动力

presentation error vjudge

您的余额不足,请更换扫码支付或 充值

presentation error vjudge

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

presentation error vjudge

:{{u.since | uhunt_duration}}
.
you are currently invisible

site.

If you have done so, click the sign in button below.

uHunt
hunt problems that matter
| | |

uHunt is a complementary tool for UVa online-judge that keeps statistics, provide selections of problems to solve, and exposes a web API for other web developers to build upon it. See a brief history of uHunt .

To submit your solution, use UVa Quick Submit .

Your UVa username:

Search Problem Number:   Clear

{{search_error}}

-   [ / ]  
-->
View : [ | ]     Show : [ | | | |   Submissions
  # Rank   User (username)   Verdict Lang Time Submit Time
{{s.sid}}  {{s.rank | uhunt_rank }}   {{ s.ver | uhunt_verdict:'name'}} {{s.lan | uhunt_language:'name' }} {{s.run | uhunt_format_ms:s.ver }} {{s.sbt | uhunt_format_time:2 }}
View : [ | ]     Show : [ | | | |   Ranklist
  # Rank   User (username) Lang Time Submit Time
{{s.sid}}  {{s.rank | uhunt_rank }} {{s.lan | uhunt_language:'name' }} {{s.run | uhunt_format_ms:s.ver }} {{s.sbt | uhunt_format_time:1 }}
Show : | | | |  
    #   Problem Title   User (username)   Verdict Lang Time Best Rank Submit Time
 {{s.sid}}  {{ s.ver | uhunt_verdict:'name'}} {{s.lan | uhunt_language:'name' }} {{s.run | uhunt_format_ms:s.ver }} {{s.rank | uhunt_rank }} {{s.sbt | uhunt_format_time:2 }}

View Live Submissions

Presentation Error (Presentation Error) statistics

Show : | | | | |    
  Problem   Verdict Lang Time Best Rank Submit Time
-  {{ s.ver | uhunt_verdict:'name' }} {{s.lan | uhunt_language:'name' }} {{s.run | uhunt_format_ms:s.ver }} {{s.rank | uhunt_rank }} {{s.sbt | uhunt_format_time:2 }}

Solved : {{n_solved}} , Submissions : {{n_submissions}}

Tried but not yet solved : {{tried.length}}

Competitive Programming Exercises

, , , ) | | >
Book Chapters Starred ★ ALL
{{$index + 1}}. {{c.title}}
{{percentage(c, 'Starred')}}%
{{percentage(c, 'Everything')}}%

Steven Halim and I published the Competitive Programming book which is targetted to help regular computer science students to quickly get up and running for the ACM ICPC as well as IOI . The book discusses the types of problems that are frequently occurs in programming contests. The exercises have been integrated to this uHunt tool so that you can keep track of your progress. To get started, select a chapter from the table on the right. Each chapter has starred problems (i.e., a must try problem). Happy solving :)

presentation error vjudge

  - Lev {{ssc.level}}

Next Problems to Solve

You can view your unsolved/solved problems, sort them, filter by volume, etc. If you just want to solve as many problems as quickly as possible, it's convinient to pick problems according to the dacu (distinct accepted users) in descending order. The bigger the dacu the easier the problem should be and the more probable it will appear in the UVa discussion board .

| | ]  | solved | both ]   Volume : {{volume_name}}
No Number   Problem Title nos anos %anos dacu best yours diff rank
{{$index + 1}} {{p.nos}} {{p.ac}} {{p.panos + '%'}} {{p.dacu}} {{p.run | uhunt_format_ms }} {{p.diff | uhunt_format_ms }} {{p.rank | uhunt_rank }}
Volumes
{{v.name}}

World Ranklist

Below is the Author Ranklist (it is a bit different in the sorting order: ac, nos instead of ac, tried, nos). The additional columns: "2d, 7d, 31d" represents the number of (distinct) solved problems in the past 2 days, 7 days, 31 days.

    World Ranklist Show: above [ | | | ]; below [ | | | ]  
Rank Name Username AC Subs 2d 7d 31d 3m 1y
{{u.rank}} {{u.ac}} {{u.nos}} {{u.activity[0] || '-'}} {{u.activity[1] || '-'}} {{u.activity[2] || '-'}} {{u.activity[3] || '-'}} {{u.activity[4] || '-'}}

Statistics Comparer

It is good to have partners (or rivals) in any competitions. Rivals can give you strong motivations to improve yourself. One of the motivations can be: "to solve any problem that your rivals solves, just to stay ahead from your rivals :)". More Info...

The available operators are: union + , subtraction - , intersection & , and brackets ( ) to force operator precedence.

Web API - Build Your Own Tool

I have published a Web API for acquiring real-time UVa statistics . Please subscribe to uhunt-api mailing list to receive updates and discuss about the API. You are free to use the API to build your own statistical tools. Let me know if you have build a great tool based on this API. I will add your tool to the list below:

Virtual Contests Generator

It is important to measure your performance under contest settings. If you want to solve 5 problems in 3 hours, this tool can help you to measure it. First, pick (using the problem picker ) a set of unsolved problems (categorized by the difficulty levels). Then set the start date and duration and create a virtual contest using the following generator. If you want compete against shadow contestants from the past UVa contests, you can click the past contests and select from one of the past UVa contests. The link to the virtual contest will appear after you generate it (only people that know the link are able to view it).

Contestants UVa IDs
UVa Problem Numbers |

Select the contest title to get the list of problems from that past contest. The solved column denotes how many problems solved by the contestants listed in the above field. The problems column denotes the number of problems in that past contest. The dacu column shows the total of distinct accepted users on the unsolved problems. The duration column denotes the contest duration.

| | | ]  | solved | both ]   Past Contests
ID   Contest Title # Problems Dacu Duration
Pick7 : [ | | ]   Show : [ | ]     Problems Picker ({{n_selected}} Selected)
Difficulty Problem Numbers

Here is the virtual contest link (the problem list is hidden until the contest starts):

     {{vcontest_link}}

To host the virtual contest in your own website, copy paste the following HTML codes to your web page. Note : you must hide your web page (containing the ranklist) before the contest start, otherwise the contestants can see the problem numbers of the contest in advance.

Frequently Asked Questions

  • Q: What are the meaning of the colors on some problem numbers? A: The problem number will will be colored Red if it was last submitted less than 2 days ago, Green for less than 1 week ago, Blue for less than 1 month ago, Orange if the problem is not yet Accepted , otherwise, Black . In the ChatBox and in the Live Submissions, some problem numbers will be underlined if you have solved the problem. The bold problem numbers in the statistics denotes that the runtime of your submission is equal to the best runtime (rank 1 of that problem).
  • Corporations

beecrowd

  • Description
  • Full Screen

Presentation error

presentation error vjudge

lbarion asked 7 years ago

Já adicionei o "enter" ao final de cada texto pedido, mas o Presentation error persiste. O que pode ter acontecido?

Remember not post solutions. Your post may be reviewed by our moderators.

presentation error vjudge

lfvtrivelatto replied 7 years ago

Talvez algum espaço faltando entre dois pontos e o número? Presentation error indica que a sua saída difere da saída correta apenas por espaços em branco, pode ser um 'enter', tab ou espaço. Se postar o código, talvez alguém veja algo que está faltando.

Get the Reddit app

A subreddit for all questions related to programming in any language.

Anyone knows why my submission in Vjudge said "Submit Failed " ?

I already tried to submit different code. But the result is same

IMAGES

  1. How to Handle Presentation Mistakes with Grace

    presentation error vjudge

  2. Troubleshooting PowerPoint Output

    presentation error vjudge

  3. Error Presentation Pack, Everything Else, Others on Carousell

    presentation error vjudge

  4. Virtual Judge使用介绍-CSDN博客

    presentation error vjudge

  5. Selection & Judging

    presentation error vjudge

  6. How Do I Fix the Error "PowerPoint Found a Problem with Content in .PPTX"

    presentation error vjudge

VIDEO

  1. Vjudge Registration Process for CMRIT 1YEAR STUDENTS

  2. Windows 10 crazy error test

  3. vjudge

  4. How to register on vjudge

  5. How to Create a Vjudge Account

  6. equal distribution

COMMENTS

  1. Presentation error for online judge in C++ - Stack Overflow

    for (int k = w - 1; k > 0; k--) if (k == w - 1) {. cout << w << ' '; } else {. cout << ' ' << w; cout << endl; return 0; However it is always giving me a so called presentation error whilst I can match the sample case. Hence I am not sure how to fix my answer.

  2. 292 Presentation Error - Online Judge

    To eliminate any subjectivity in deciding between a Presentation Error and a Wrong Answer, the Jury of this year’s Programming Contest has defined an exact procedure to determine whether a program produces a 'Wrong Answer', a 'Presentation Error', or should be Accepted.

  3. Online Judge - Verdict information

    Presentation Error (PE): Your program outputs are correct but are not presented in the correct way. Check for spaces, justify, line feeds...

  4. Presentation Error ?? - OJ Board - Online Judge

    Presentation error means: The data in your output is correct, but it is not formatted in the proper way. Check the problem statement. (Missing/excessive blank lines and unnecessary spaces are likely to have caused this message.)

  5. Presentation error: Judge does not trim or wrap trailing ...

    In my testcases with trailing spaces, judge does not trim or wrap the input and output. Therefore it judges the submission as a 'Wrong Answer', if the input has different number of trailing spaces.

  6. OJ中常见的一种presentation error解决方法 - CSDN博客

    解决我的是每行最后一列数组元素都输出了空格+换行而正确的是每行最后一列数组元素输出换行不能加空格。 很隐蔽,很坑。 沉迷单车的追风少年. “相关推荐”对你有帮助么? 点我去创作中心查看更多活动~ 举报. 文章浏览阅读1w次,点赞18次,收藏16次。 我经常会遇见这种错误说明是结果正确了,但是输出格式错误了,常常是多了或者少了空格、换行之类的。 我的代码: for (int i=0;i<r+1;i++) { for (int j=0;j<c+1;j++) printf ("%d ", M [i] [j]); cout<<endl; } cout<<endl;显示PE,但..._presentation error.

  7. uHunt :: Presentation Error (Presentation Error)

    uHunt is a complementary tool for UVa online-judge that keeps statistics, provide selections of problems to solve, and exposes a web API for other web developers to build upon it. See a brief history of uHunt. To submit your solution, use UVa Quick Submit. Your UVa username: Search Problem Number: . Clear. { {search_error}}

  8. 1001 - presentation error - beecrowd

    The problem that I see in your code is: You're putting line break ("\n") before to print the result. Your code is like this: X = A+B print(" ") print("X = ", X); What it makes with your output be like this: >>>. >>> X = 19. Rather than it, what is required by the problem:

  9. Presentation error - beecrowd">1040 - Presentation error - beecrowd

    Talvez algum espaço faltando entre dois pontos e o número? Presentation error indica que a sua saída difere da saída correta apenas por espaços em branco, pode ser um 'enter', tab ou espaço.

  10. Vjudge said "Submit Failed">Anyone knows why my submission in Vjudge said "Submit Failed

    You should probably attach a screenshot of that error message, what ever the problem is and your code. It'll make helping a lot easier