QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#290094 | #7796. Axis-Aligned Area | wavesourav | AC ✓ | 0ms | 3740kb | C++14 | 2.4kb | 2023-12-24 13:12:20 | 2023-12-24 13:12:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define mx 20000
int spf[mx];
int val[mx];
void sieve()
{
spf[1]=1;
for(int i=3;i<mx;i+=2)
{
spf[i]=i;
}
for(int i=2;i<mx;i+=2)
{
spf[i]=2;
}
for(int i=3;i<mx;i++)
{
if(spf[i]==i)
{
for(int j=i*i;j<mx;j+=i)
{
if(spf[j]==j)
{
spf[j]=i;
}
}
}
}
val[1]=0;
for(int i=2;i<mx;i++)
{
if(spf[i/spf[i]]!=spf[i])
{
val[i]=1+val[i/spf[i]];
}
else
{
val[i]=val[i/spf[i]];
}
}
}
vector<vector<int>>g;
int n,k;
vector<int>sz;
int ans;
long long binpow(long long a, long long b) {
if (b == 0)
return 1;
long long res = binpow(a, b / 2);
if (b % 2)
return (( (res * a)%mod) * res)%mod;
else
return (res * res)%mod;
}
int inv(int p)
{
return (binpow(p,mod-2));
}
void dfs(int node,int p)
{
sz[node]=1;
for(auto i:g[node])
{
if(i!=p)
{
dfs(i,node);
sz[node]=(sz[node]+sz[i]);
}
}
}
int dfs1(int node,int p)
{
int ans=0,c=0;
int u=0,v=0;
for(auto i:g[node])
{
if(i!=p)
{
c++;
if(c==1)
{
u=i;
}
if(c==2)
{
v=i;
}
}
}
if(c==0)
{
return 0;
}
if(c==1)
{
return sz[u]-1;
}
return max( sz[u]-1+dfs1(v,node),sz[v]-1+dfs1(u,node));
}
int lcm(int x,int y)
{
int temp= x*y;
temp/=(__gcd(x,y));
return temp;
}
int reverseDigits(int num) {
int rev_num = 0;
while (num > 0) {
rev_num = rev_num * 10 + num % 10;
num = num / 10;
}
return rev_num;
}
bool isP(int n) {
int rev_n = reverseDigits(n);
return (rev_n == n);
}
void solve()
{
int a[4];
for(int i=0;i<4;i++)
{
cin>>a[i];
}
sort(a,a+4);
cout<<a[0]*a[2]<<endl;
}
signed main()
{
// sieve();
int t=1;
while(t--)
{
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
input:
2 2 4 7
output:
8
result:
ok 1 number(s): "8"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
10 10 10 10
output:
100
result:
ok 1 number(s): "100"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
1 1 1 1
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
1 1 2 2
output:
2
result:
ok 1 number(s): "2"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
4 5 5 5
output:
20
result:
ok 1 number(s): "20"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
7 10 12 12
output:
84
result:
ok 1 number(s): "84"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
13 22 32 34
output:
416
result:
ok 1 number(s): "416"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
9 41 75 93
output:
675
result:
ok 1 number(s): "675"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
31 59 97 98
output:
3007
result:
ok 1 number(s): "3007"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
16 33 48 52
output:
768
result:
ok 1 number(s): "768"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
14 49 52 73
output:
728
result:
ok 1 number(s): "728"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
50 88 90 94
output:
4500
result:
ok 1 number(s): "4500"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
65 85 94 98
output:
6110
result:
ok 1 number(s): "6110"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
86 86 89 95
output:
7654
result:
ok 1 number(s): "7654"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
95 97 97 100
output:
9215
result:
ok 1 number(s): "9215"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
98 99 99 99
output:
9702
result:
ok 1 number(s): "9702"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
99 100 100 100
output:
9900
result:
ok 1 number(s): "9900"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
100 100 100 100
output:
10000
result:
ok 1 number(s): "10000"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
99 99 99 100
output:
9801
result:
ok 1 number(s): "9801"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
99 99 100 100
output:
9900
result:
ok 1 number(s): "9900"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
1 100 100 100
output:
100
result:
ok 1 number(s): "100"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
1 1 100 100
output:
100
result:
ok 1 number(s): "100"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
1 1 1 100
output:
1
result:
ok 1 number(s): "1"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
2 100 100 100
output:
200
result:
ok 1 number(s): "200"
Test #25:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
2 2 100 100
output:
200
result:
ok 1 number(s): "200"
Test #26:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
2 2 2 100
output:
4
result:
ok 1 number(s): "4"
Test #27:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
15 16 23 42
output:
345
result:
ok 1 number(s): "345"
Test #28:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
91 93 95 97
output:
8645
result:
ok 1 number(s): "8645"
Test #29:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
9 13 82 86
output:
738
result:
ok 1 number(s): "738"
Test #30:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
9 73 82 86
output:
738
result:
ok 1 number(s): "738"
Test #31:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
9 13 22 86
output:
198
result:
ok 1 number(s): "198"
Test #32:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
2 3 5 100
output:
10
result:
ok 1 number(s): "10"
Test #33:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
5 5 5 100
output:
25
result:
ok 1 number(s): "25"
Extra Test:
score: 0
Extra Test Passed