Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
不解释,直接代码!我就因为包错了不是<cmath>而是<cstdlib>错了n次#include<iostream> #include<stdlib.h> #include<cstring> #include<cstdlib> using namespace std; int main(){ int num; while(cin>>num){ int i; int *Jump = (int*)malloc(sizeof(int)*num); bool *flag = (bool*)malloc(sizeof(bool)*num); memset(flag,false,sizeof(bool)*num); for(int j=0;j<num;j++){ cin>>Jump[j]; } for(i=1;i<num;i++){ int tmp; tmp = abs(Jump[i]-Jump[i-1]); if(flag[tmp]){ break; } flag[tmp] = true; } if(i==num){ cout<<"Jolly"<<endl; }else{ cout<<"Not jolly"<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator