| ||||||||||
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 |
why wrong answer!!!!!???????????#include <iostream> using namespace std; int main() { int i; int n,m; int num; int p,q; int temp,temq; int notalone; int r=0; while(1){ scanf("%d%d",&n,&m); if(n==0 && m==0)break; int stu[50001]={0}; num=0;notalone=0; for(i=0;i<m;i++){ scanf("%d%d",&p,&q); temp=stu[p];temq=stu[q]; if(temp==0 && temq==0){ ++num; stu[p]=1; stu[q]=1; notalone=notalone+2; continue; } if(temp==0 || temq==0) { stu[p]=1; stu[q]=1; notalone++; } } num=num+n-notalone; ++r; printf("Case %d: %d\n",r,num); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator