絕對超時,請用sum = (a-b)/2,在判斷四種能
我實測過了
其實並不會TLE
當然用公式解會快很多~
AC (0.7s, 340KB)
附上程式碼::
#include using namespace std; int main(){ long long a,b,tot=0; cin>>a>>b; for(int i=a;i<=b;i++){ tot+=(i%2==0); } cout<<tot; }
good article, if you need information related to similar articles you can access it here - http://news.unair.ac.id/en/2021/03/15/covid-vaccines-able-to-neutralize-new-variant-virus/