Lightoj Solutions: 1001 – Opposite Task

Problem Link : http://www.lightoj.com/volume_showproblem.php?problem=1001

Solution:

#include<bits/stdc++.h>
int main(){
    int  t,i,n;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&n);

        if(n>10)
        {
            printf("%d %d\n",n-10,n-(n-10));

        }else{
            printf("0 %d\n",n);
        }

    }

return 0;
}

I am writing here some editorial;

As far as I have understand that it is needed two pc for judging and the maximm capacity of the problem in one pc is 10 not more than this.

But it will show two coloumn for output as for 2 pc.So we have to balance the whole of the both side

So if in one part it is 10 other will find out by n-10 and the value of n-(n-10) is the another pc value and if it’s all not true then the input will print 0 and 10 for single pc.
Now i have some question about this.I have thought another logic though

I will implement it later like.
Algo I have thought:
1.First take input as string
2.If space then print one value from string that needs
3.If not then print 0 and the input value.

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *