QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#495114 | #9158. 分数 | leihonglongyin | 0 | 0ms | 3684kb | C++20 | 368b | 2024-07-27 18:56:55 | 2024-07-27 18:56:56 |
answer
#include<bits/stdc++.h>
#define ll long long
using namespace std;int n,m;ll ans;
void dfs(int a,int b,int c,int d,int v){if(n-b<2*a)return;
ans+=min(a==0?(int)1e9:(n-b)/a,(m-d)/c)/2+(n-d)/c/2;
for(int i=2;2*(c*i+a)+d*i+b<=m;i+=2)dfs(c,d,c*i+a,d*i+b,v);
}
int main(){freopen("ex_4.in","r",stdin);
cin>>n>>m;if(n>m)swap(n,m);
dfs(0,1,1,0,0);
cout<<ans;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 0ms
memory: 3624kb
input:
99 99
output:
0
result:
wrong answer 1st numbers differ - expected: '406', found: '0'
Pretest #2:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
98 97
output:
0
result:
wrong answer 1st numbers differ - expected: '405', found: '0'
Pretest #3:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
99 96
output:
0
result:
wrong answer 1st numbers differ - expected: '396', found: '0'
Pretest #4:
score: 0
Wrong Answer
time: 0ms
memory: 3588kb
input:
995 977
output:
0
result:
wrong answer 1st numbers differ - expected: '11153', found: '0'
Pretest #5:
score: 0
Wrong Answer
time: 0ms
memory: 3680kb
input:
991 990
output:
0
result:
wrong answer 1st numbers differ - expected: '11220', found: '0'
Pretest #6:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
976 968
output:
0
result:
wrong answer 1st numbers differ - expected: '10900', found: '0'
Pretest #7:
score: 0
Wrong Answer
time: 0ms
memory: 3488kb
input:
7602 7864
output:
0
result:
wrong answer 1st numbers differ - expected: '215706', found: '0'
Pretest #8:
score: 0
Wrong Answer
time: 0ms
memory: 3524kb
input:
7959 7735
output:
0
result:
wrong answer 1st numbers differ - expected: '220256', found: '0'
Pretest #9:
score: 0
Wrong Answer
time: 0ms
memory: 3664kb
input:
7878 7863
output:
0
result:
wrong answer 1st numbers differ - expected: '221162', found: '0'
Pretest #10:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
7788 7658
output:
0
result:
wrong answer 1st numbers differ - expected: '215323', found: '0'
Pretest #11:
score: 0
Wrong Answer
time: 0ms
memory: 3620kb
input:
95399 99767
output:
0
result:
wrong answer 1st numbers differ - expected: '8285295', found: '0'
Pretest #12:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
98051 99642
output:
0
result:
wrong answer 1st numbers differ - expected: '8439713', found: '0'
Pretest #13:
score: 0
Wrong Answer
time: 0ms
memory: 3488kb
input:
95624 96007
output:
0
result:
wrong answer 1st numbers differ - expected: '8068127', found: '0'
Pretest #14:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
99208 98047
output:
0
result:
wrong answer 1st numbers differ - expected: '8412610', found: '0'
Pretest #15:
score: 0
Wrong Answer
time: 0ms
memory: 3620kb
input:
997417 967722
output:
0
result:
wrong answer 1st numbers differ - expected: '229917323', found: '0'
Pretest #16:
score: 0
Wrong Answer
time: 0ms
memory: 3676kb
input:
987807 956529
output:
0
result:
wrong answer 1st numbers differ - expected: '226426912', found: '0'
Pretest #17:
score: 0
Wrong Answer
time: 0ms
memory: 3532kb
input:
971654 984345
output:
0
result:
wrong answer 1st numbers differ - expected: '228363805', found: '0'
Pretest #18:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
7892259 7983727
output:
0
result:
wrong answer 1st numbers differ - expected: '4647501224', found: '0'
Pretest #19:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
7937869 29796968
output:
0
result:
wrong answer 1st numbers differ - expected: '15197555613', found: '0'
Pretest #20:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
29717543 29510173
output:
0
result:
wrong answer 1st numbers differ - expected: '30904211576', found: '0'
Final Tests
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3628kb
input:
96 98
output:
0
result:
wrong answer 1st numbers differ - expected: '396', found: '0'
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3600kb
input:
100 99
output:
0
result:
wrong answer 1st numbers differ - expected: '408', found: '0'
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 3528kb
input:
99 99
output:
0
result:
wrong answer 1st numbers differ - expected: '406', found: '0'
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 3528kb
input:
963 951
output:
0
result:
wrong answer 1st numbers differ - expected: '10634', found: '0'
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
958 974
output:
0
result:
wrong answer 1st numbers differ - expected: '10795', found: '0'
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
966 990
output:
0
result:
wrong answer 1st numbers differ - expected: '11003', found: '0'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3596kb
input:
7958 7947
output:
0
result:
wrong answer 1st numbers differ - expected: '224482', found: '0'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
7623 7730
output:
0
result:
wrong answer 1st numbers differ - expected: '213444', found: '0'
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 3684kb
input:
7845 7783
output:
0
result:
wrong answer 1st numbers differ - expected: '218916', found: '0'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 3680kb
input:
7881 7773
output:
0
result:
wrong answer 1st numbers differ - expected: '219451', found: '0'
Test #11:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
99414 98698
output:
0
result:
wrong answer 1st numbers differ - expected: '8465217', found: '0'
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 3624kb
input:
98249 96148
output:
0
result:
wrong answer 1st numbers differ - expected: '8237486', found: '0'
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3684kb
input:
99003 96832
output:
0
result:
wrong answer 1st numbers differ - expected: '8324931', found: '0'
Test #14:
score: 0
Wrong Answer
time: 0ms
memory: 3496kb
input:
98266 96030
output:
0
result:
wrong answer 1st numbers differ - expected: '8231065', found: '0'
Test #15:
score: 0
Wrong Answer
time: 0ms
memory: 3660kb
input:
968207 958885
output:
0
result:
wrong answer 1st numbers differ - expected: '223522215', found: '0'
Test #16:
score: 0
Wrong Answer
time: 0ms
memory: 3676kb
input:
959846 998397
output:
0
result:
wrong answer 1st numbers differ - expected: '228770873', found: '0'
Test #17:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
965821 972280
output:
0
result:
wrong answer 1st numbers differ - expected: '225359210', found: '0'
Test #18:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
7855098 7962479
output:
0
result:
wrong answer 1st numbers differ - expected: '4622947400', found: '0'
Test #19:
score: 0
Wrong Answer
time: 0ms
memory: 3492kb
input:
7841076 29648718
output:
0
result:
wrong answer 1st numbers differ - expected: '15040798710', found: '0'
Test #20:
score: 0
Wrong Answer
time: 0ms
memory: 3620kb
input:
29365129 29012208
output:
0
result:
wrong answer 1st numbers differ - expected: '30267839959', found: '0'