| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 40790 | 老师 | 公鸡打鸣 | C++ | Accepted | 100 | 38 MS | 252 KB | 342 | 2022-06-04 14:43:04 |
#include<bits/stdc++.h> using namespace std; int x,y,k,ai,xi,bi,yi; int main(){ cin>>x>>y>>k; if(x==y){ cout<<0; return 0; } for(int i=1;i<=k;i++){ cin>>ai>>xi>>bi>>yi; x+=ai*xi; y+=bi*yi; if(x<0) x=0; if(y<0) y=0; if(x==y){ cout<<i<<endl; return 0; } } cout<<-1<<endl; return 0; }