UVa 10188-automated Judge Script

Source: Internet
Author: User

Title: Give you some questions about the output, judging whether it is ac,pe or WA.

Analysis: Simulation. According to the test instructions simulation, note that the PE condition is the same for all numeric characters appearing in the same order.

Description: Remember many years ago written OJ the background of the procedure ╮(╯▽╰)╭.

#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include < Cstdio> #include <cmath>using namespace Std;char list1[101][122];char List2[101][122];char Numb1[12001];char Numb2[12001];int Main () {int n,m,t = 1;while (~scanf ("%d", &n) && N) {getchar (); for (int i = 0; i < n; + + i) g ETS (List1[i]); scanf ("%d", &m); GetChar (); for (int i = 0; i < m; + + i) gets (list2[i]); int AC = 1;if (M = = N) {for (int i = 0; I < n; + + i) if (strcmp (List1[i], list2[i]) {AC = 0;break;}} else AC = 0;int PE = 1,save1 = 0,save2 = 0;for (int i = 0; i < n; + + i) for (int j = 0; list1[i][j]; + + j) if (list1[i][j  ] >= ' 0 ' && list1[i][j] <= ' 9 ') numb1[save1 + +] = list1[i][j];for (int i = 0; i < m; + + i) for (int j = 0; LIST2[I][J]; + + j) if (List2[i][j] >= ' 0 ' && list2[i][j] <= ' 9 ') Numb2[save2 + +] = list2[i][j];if (save1 = = save2) {for (in t i = 0; i < save1; + + i) if (numb1[i]! = Numb2[i]) {PE = 0;break;}} else PE = 0;printf ("Run #%d:", T + +), if (AC) printf ("accepted\n"), else if (PE) printf ("Presentation error\n"), Else printf ("wrong    Answer\n ");} return 0;}


UVa 10188-automated Judge Script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.