标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 182 Accepted Submission(s): 95
#include<iostream> #include<cstdio> using namespace std; int main() { int m, n; while(~scanf("%d%d", &n, &m)) { int u, v; int ok = 0; for(int i=0; i<m; i++) { scanf("%d%d", &u, &v); if((u==1&&v==n)||(v==1&&u==n)) ok = 1; } if(!ok) printf("%d %d\n",1, 1); else printf("%d %d\n",1, n*(n-1)/2); } return 0; }
标签:
原文地址:http://www.cnblogs.com/acm1314/p/4770446.html