| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 40921 | 董承诺 | 公鸡打鸣 | C++ | Accepted | 100 | 37 MS | 252 KB | 326 | 2022-06-05 09:18:07 |
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,f,g; int main(){ cin>>a>>b>>c; if(a==b){ cout<<0; return 0; } for(int i=1;i<=c;i++){ cin>>d>>e>>f>>g; a+=d*e; b+=f*g; if(a<0) a=0; if(b<0) b=0; if(a==b){ cout<<i<<endl; return 0; } } cout<<-1<<endl; return 0; }