1 #include <iostream> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <set> 5 using namespace std; 6 7 int main() 8 { 9 int cases, cols, northRow, southRow; 10 cin >> cases; 11 while(cases--) 12 { 13 cin >> cols; 14 set<int> mySet; 15 for(int i=0; i<cols; i++) 16 { 17 cin >> northRow >> southRow; 18 mySet.insert(abs(northRow - southRow)); 19 } 20 21 if(mySet.size() == 1) 22 cout << "yes" << endl; 23 else cout << "no" << endl; 24 25 if(cases) 26 cout << endl; 27 } 28 }
uva 10963 - The Swallowing Ground
原文:http://www.cnblogs.com/aze-003/p/5095540.html