#include<stdio.h>
#include<stdlib.h>
#define getcx getchar_unlocked
inline void inp( int *n )//fast input function
{
*n=0;
int ch=getcx();int sign=1;
while( ch < ‘0’ || ch > ‘9’ ){if(ch==’-’)sign=-1; ch=getcx();}
while( ch >= ‘0’ && ch <= ‘9’ )
*n = (*n<<3)+(*n<<1) + ch-‘0’, ch=getcx();
*n=nsign;
}
inline void inplong( long *n )//fast input function
{
*n=0;
int ch=getcx();int sign=1;
while( ch < ‘0’ || ch > ‘9’ ){if(ch==’-’)sign=-1; ch=getcx();}
while( ch >= ‘0’ && ch <= ‘9’ )
*n = (*n<<3)+(n<<1) + ch-‘0’, ch=getcx();
n=nsign;
}
int main()
{
int i,T;
long j,N,val;
long long int cnt,cnt2;
inp(&T);
while(T–)
{
cnt=cnt2=0;
//scanf("%ld",&N);
inplong(&N);
while(N–)
{
inplong(&val);
// scanf("%ld",&val);
if(val==2){
cnt2++;
}
else if(val>1){
cnt++;
}
}
cnt+=cnt2;
printf("%lld\n",((cnt(cnt-1))/2)-((cnt2(cnt2-1))/2));
}
return 0;
}
I am new user and can’t understand what is the problem to solve in the compitition.
Please help me in this aspect
@admin, i would like to inform you that i want to make a new account here so please if you can suspend my account.
Am new user sandhya …right now Media.net off campus s gng on but i dono hw to do in this …am confused plz help me
Passing it off as your own is. If you are taking your code from some other source, it is expected that you give the due attribution to the source in your code. It is kind of mandatory. Do not ask or discuss any aspect of any CodeChefs’ problem during an ongoing contest on any other platform, online or offline.
for c programming training institute please visit the following link
c programming
My sincere advise to everyone please never use ideone.
I have invested so much time and my energy to solve sept long challenge 2016 and one stupid brainless guy copied my code as it is and due to that stupid guy my rating goes down to 4K from 10K.
His fake name was Rahul Bhatia and his original name was (Hardik Gulati) at Jaypee Institute of Information Technology and his handle is rahul1714.
His fb profile is (https://www.facebook.com/smart.hardik.gulati)
Beware of such stupid fellows.
for proof I m giving my code which i have submitted on 9th Sept
https://www.codechef.com/viewsolution/11392815
and he submitted exact code of mine on 15th Sept
https://www.codechef.com/viewsolution/11525589
And request codechef please change some rules for plagiarism cases because many innocent peoples have to suffer huge loses because of someunkown useless guy…
I push all my code on github but only after contest.
for example september 2016 long contest code is here.
O.k I understood but I am a new on this site so I am not understood where I get the problems of cc and c++ in this site
i did’nt know how its happen"We will be dropping your CYPHER ratings and disqualifying all the submissions of your account on grounds of using false practice during CYPHER NOVEMBER 2016 . We found few of your codes similar with one another user and would like to have an explanation about the same from you" . but i do all the programme by my self.is there is any mean to prove me"like give different programme then make you realize that i am wrong panelized".
yes. if u break any rule,result will reflect in ur profile,so be carefull,dont do cheating keep learning…
How to register this competion? please share the link if you know?
I would suggest to upload some video tutorials of solution of contest problems after contest,so that one can fathom solution which he/she couldn’t be able to do it. Thank you!
You are at the best toffee shop in the town. You see that there are different varieties of toffees in the shop.
Each type of toffee costs P rupees and contains C calories. You being a student have a fixed budget B rupees to spend on these toffees.
You want to maximize the total calories you gain by eating them.
Note : Any toffee can be eaten only once.
Your task is to write a program to output the maximum calories you gain with your budget (B rupees).
PLZ SEND MI CODE
You are given a square matrix of integers. The cost of travelling from a cell A to cell B is the sum of numbers in all the cells which lie on the path between A and B, inclusive.
You need to travel from the top left cell to the bottom right cell, and back, minimizing the total cost of travel, subject to the following conditions:
- You cannot use squares on the leading diagonal of the matrix (Apart from the top left and the bottom right cells.)
- When travelling to the bottom right corner, you may only move rightwards or downwards. Similarly, while travelling back to the top left corner, you may move only leftwards or upwards.
- Your first move while going from top left to bottom right should be rightwards. Similarly, your first move while going from bottom right to top left should be leftwards.
PLZ SEND MI CODE IN JAVA
You are given a sequence of characters consisting only of the following: a, b, c and ?. You need to replace every ? with one of a, b or c such that no two consecutive characters are the same. In addition, the first and the last characters of the string must not be the same.
You need to return the lexicographically smallest string which satisfies the above constraints. If you cannot build any string that satisfies the above constraints, return “Not found” (without the quotes).
PLZ SEND MI CODE IN JAVA
#include<stdio.h>
#include<stdlib.h>
#define getcx getchar_unlocked
inline void inp( int *n )//fast input function
{
*n=0;
int ch=getcx();int sign=1;
while( ch < ‘0’ || ch > ‘9’ ){if(ch==’-’)sign=-1; ch=getcx();}
while( ch >= ‘0’ && ch <= ‘9’ )
*n = (*n<<3)+(*n<<1) + ch-‘0’, ch=getcx();
*n=nsign;
}
inline void inplong( long *n )//fast input function
{
*n=0;
int ch=getcx();int sign=1;
while( ch < ‘0’ || ch > ‘9’ ){if(ch==’-’)sign=-1; ch=getcx();}
while( ch >= ‘0’ && ch <= ‘9’ )
*n = (*n<<3)+(n<<1) + ch-‘0’, ch=getcx();
n=nsign;
}
int main()
{
int i,T;
long j,N,val;
long long int cnt,cnt2;
inp(&T);
while(T–)
{
cnt=cnt2=0;
//scanf("%ld",&N);
inplong(&N);
while(N–)
{
inplong(&val);
// scanf("%ld",&val);
if(val==2){
cnt2++;
}
else if(val>1){
cnt++;
}
}
cnt+=cnt2;
printf("%lld\n",((cnt(cnt-1))/2)-((cnt2(cnt2-1))/2));
}
return 0;
}
It is first time happened with me that I 'm disqualified. I were not having the idea about code of conduct of codechef that now I know. So, please kindly restore my submissions.
#include<stdio.h>
#include<conio.h>
int main() {
int length, breadth, area;
printf("\nEnter the Length of Rectangle : “);
scanf(”%d", &length);
printf("\nEnter the Breadth of Rectangle : “);
scanf(”%d", &breadth);
area = length * breadth;
printf("\nArea of Rectangle : %d", area);
return (0);
}