ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1059. Expression

Do not seek any kind of logic in this problem just paste this! (+)
Posted by nullman 18 Jan 2003 23:09
I think that there must be some 'X' one after another, because it is
said 'ai*X^(n-1)' like this for n=2:

0
X
X
*
*
1 --> I'm only not quite sure for this '1'
X
* --> and if there is no '1' this row also turns off
+
2
+


I have tried to write something but it sucked, so I got a Pascal
code and turned it to C++!

AC 0.02 sec

///////////////////////////////////////////////
// 1059

#include <stdio.h>

int i,n;

int main()
{
  scanf("%d",&n); puts("0");
  for (i=1;i<=n;i++)
    printf("X\n*\n%d\n+\n",i);
  //getch();
  return 0;
}
/////////////////////////////////////////////////