Codeforces Round #284 (Div. 2)(三)

2015-01-22 21:09:03 · 作者: · 浏览: 14
ed below (A is the point representing the house; B is the point representing the university, different blocks are filled with different colors):

\
\

?

带入两点, 判断使两点值符号不同直线有多少个,

不要直接判断 ,long long 不够存

?

?

#include
    
     
#include
     
       #include
      
        #include
       
         #include
        
          #include
         
           #include
          
            #include
           
             #include
            
              #include
             
               #include
              
                #include
                #include
                
                  #include
                 
                   #include
                  
                    #include
                   
                     using namespace std; long long sx, sy, ex, ey; int n; int main() { cin >> sx >> sy; cin >> ex >> ey; cin >> n; int ans = 0; while (n--) { long long a, b, c; cin >> a >> b >> c; int f1 = (sx * a + sy * b + c) > 0 ? 1 : 0; int f2 = (ex * a + ey * b + c) > 0 ? 1 : 0; if (f1 != f2) { ans++; } } cout << ans << endl; return 0; }
                   
                  
                 
                
              
             
            
           
          
         
        
       
      
     
    


?

?

?

?