Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

Problem in problem (to site admins)
Author: Mirzakhmet Syzdykov
ID: 004300
Problem: 397
Contest: 0
Date: 2011-08-15 19:08:20

Hello. I think tests should be revised. Why my solution gets WA on test 52?

Solution:

#include "stdafx.h"
#include <cstdio>
#include <ctype.h>

class C_List {
public:
int c;
C_List *prev, *next;
C_List() : prev(0), next(0), c(0) { }
};

int main()
{
C_List *first = new C_List(), *current = first;
int i;
while ((i = getchar()) != EOF) {
if (i == 'L') {
if (current->prev != 0) current = current->prev;
} else if (i == 'R') {
if (current->next != 0) current = current->next;
} else if (isalnum(i)) {
C_List *item = new C_List();
item->prev = current;
item->next = current->next;
current->next = item;
current = item;
item->c = i;
} else break;
}
for (current = first->next; current != 0; current = current->next)
putchar (current->c);
putchar ('n');
fclose (stdout);
return 0;
}


see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-11-23 06:36:34Online Contester Team © 2002 - 2016. All rights reserved.