QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#787581 | #9750. 拼图 | fatesrl# | WA | 2ms | 3612kb | C++20 | 1.2kb | 2024-11-27 13:10:50 | 2024-11-27 13:11:09 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a<4){
cout<<0<<'\n';
return;
}
int ans=4;
for(int i=1;i<=min(d,min(b,c));i++){
int tx=d/i;
int tb=b-i;
int tc=c-i;
tx=min(tx,min(tb,tc));
ans=max(ans,tx*i+2*tx+2*i+4);
}
cout<<ans<<'\n';
// int ttb=b/2,ttc=c/2;
// for(int i=1;i<=ttb;i++){
// int tb=ttb-i;//剩余b
// int x=2*i-1;
// int ct=i-1;
// int tc=ttc-ct;//剩余c
// if(tc<1) break;
// int tx=d/x;
// if(tx==0) break;
// if(tx%2==0) tx--;
//
// tx=min(tx,min(2*tb+1,2*tc-1));
// ans=max(ans,tx*x+4+2*tx+2*x);
// }
// for(int i=1;i<=ttc;i++){
// int tc=ttc-i;//剩余c
// int x=2*i-1;
// int bt=i-1;
// int tb=ttb-bt;//剩余b
// if(tb<1) break;
// int tx=d/x;
// if(tx==0) break;
// if(tx%2==0) tx--;
//
// tx=min(tx,min(2*tc+1,2*tb-1));
// ans=max(ans,tx*x+4+2*tx+2*x);
// }
// for(int i=1;2*i<=min(b,c);i++){
// int x=2*i;
// int tb=b-x;
// int tc=c-x;
// int tx=d/x;
//// tx=min(tx,)
// }
// cout<<ans<<'\n';
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int ins=1;
cin>>ins;
while(ins--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3568kb
input:
2 4 0 0 0 4 4 4 4
output:
4 16
result:
ok 2 lines
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3612kb
input:
10000 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 6 0 0 0 7 0 0 0 8 0 0 0 9 0 0 1 0 0 0 1 1 0 0 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 2 0 0 0 2 1 0 0 2 2 0 0 2 3 0 0 2 4 0 0 2 5 0 0 2 6 0 0 2 7 0 0 2 8 0 0 2 9 0 0 3 0 0 0 3 1 0 0 3 2 0 0 3 3 0 0 3 4 0 0 3 5 0 0 3 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer 4111th lines differ - expected: '6', found: '4'