提出 #64133935


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
inline int read(){
    char ch=getchar(); while(!isdigit(ch) && ch!='-') ch=getchar();
    int x=0,ff=1; if(ch=='-') ff=-1,ch=getchar();
    while(isdigit(ch)) x=(x<<3) + (x<<1) + (ch^48),ch=getchar();
    return x*ff;
}
const int N=2e3+5;
int n,a[N],b[N]; map<int,int> mp1,mp2,mp3;
int main(){
    n=read(); int c1=0,c2=0,z=0;
    for(int i=1;i<=n;i++) a[i]=read(),c1+=(a[i]==-1),z=max(z,a[i]);
    for(int i=1;i<=n;i++) b[i]=read(),c2+=(b[i]==-1),z=max(z,b[i]);
    for(int i=1;i<=n;i++) if(~a[i]) ++mp1[a[i]];
    for(int i=1;i<=n;i++) if(~b[i]) ++mp2[b[i]];
    for(auto [x,y]:mp1) for(auto [xx,yy]:mp2) mp3[x+xx]+=min(y,yy);
    int mx=0;
    for(auto [x,y]:mp3) if(x>=z) mx=max(mx,y);
    if(c1+c2>=n-mx) puts("Yes");
    else puts("No");
    return 0;
}

提出情報

提出日時
問題 B - Uniform Sum
ユーザ llloserqz
言語 C++ 20 (gcc 12.2)
得点 500
コード長 850 Byte
結果 AC
実行時間 2361 ms
メモリ 190596 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 3
AC × 63
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 03_medium_01.txt, 03_medium_02.txt, 03_medium_03.txt, 03_medium_04.txt, 03_medium_05.txt, 04_large_01.txt, 04_large_02.txt, 04_large_03.txt, 04_large_04.txt, 04_large_05.txt, 05_max_01.txt, 05_max_02.txt, 05_max_03.txt, 05_max_04.txt, 05_max_05.txt, 05_max_06.txt, 05_max_07.txt, 05_max_08.txt, 05_max_09.txt, 05_max_10.txt, 06_all_distinct_yes_01.txt, 06_all_distinct_yes_02.txt, 06_all_distinct_yes_03.txt, 06_all_distinct_yes_04.txt, 06_all_distinct_yes_05.txt, 07_all_distinct_no_01.txt, 07_all_distinct_no_02.txt, 07_all_distinct_no_03.txt, 07_all_distinct_no_04.txt, 07_all_distinct_no_05.txt, 08_negative_killer_01.txt, 08_negative_killer_02.txt, 08_negative_killer_03.txt, 08_negative_killer_04.txt, 08_negative_killer_05.txt, 09_random_z_killer_01.txt, 09_random_z_killer_02.txt, 09_random_z_killer_03.txt, 09_random_z_killer_04.txt, 09_random_z_killer_05.txt, 09_random_z_killer_06.txt, 09_random_z_killer_07.txt, 09_random_z_killer_08.txt, 09_random_z_killer_09.txt, 09_random_z_killer_10.txt, 10_sort_z_killer_01.txt, 10_sort_z_killer_02.txt, 10_sort_z_killer_03.txt, 10_sort_z_killer_04.txt, 10_sort_z_killer_05.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 3536 KiB
00_sample_02.txt AC 1 ms 3452 KiB
00_sample_03.txt AC 1 ms 3476 KiB
01_handmade_01.txt AC 1 ms 3532 KiB
01_handmade_02.txt AC 1 ms 3464 KiB
01_handmade_03.txt AC 1 ms 3536 KiB
01_handmade_04.txt AC 1 ms 3416 KiB
01_handmade_05.txt AC 223 ms 3912 KiB
02_small_01.txt AC 1 ms 3496 KiB
02_small_02.txt AC 1 ms 3608 KiB
02_small_03.txt AC 1 ms 3496 KiB
02_small_04.txt AC 1 ms 3496 KiB
02_small_05.txt AC 1 ms 3500 KiB
03_medium_01.txt AC 1 ms 3588 KiB
03_medium_02.txt AC 1 ms 3588 KiB
03_medium_03.txt AC 1 ms 3576 KiB
03_medium_04.txt AC 1 ms 3500 KiB
03_medium_05.txt AC 1 ms 3544 KiB
04_large_01.txt AC 6 ms 4888 KiB
04_large_02.txt AC 2 ms 3980 KiB
04_large_03.txt AC 2 ms 3892 KiB
04_large_04.txt AC 78 ms 17420 KiB
04_large_05.txt AC 14 ms 6456 KiB
05_max_01.txt AC 302 ms 43044 KiB
05_max_02.txt AC 80 ms 17068 KiB
05_max_03.txt AC 46 ms 12524 KiB
05_max_04.txt AC 2 ms 3772 KiB
05_max_05.txt AC 12 ms 5980 KiB
05_max_06.txt AC 1 ms 3496 KiB
05_max_07.txt AC 5 ms 4844 KiB
05_max_08.txt AC 171 ms 28284 KiB
05_max_09.txt AC 67 ms 15892 KiB
05_max_10.txt AC 263 ms 38512 KiB
06_all_distinct_yes_01.txt AC 2361 ms 190568 KiB
06_all_distinct_yes_02.txt AC 2304 ms 190252 KiB
06_all_distinct_yes_03.txt AC 2306 ms 189936 KiB
06_all_distinct_yes_04.txt AC 2312 ms 190548 KiB
06_all_distinct_yes_05.txt AC 2311 ms 190576 KiB
07_all_distinct_no_01.txt AC 2284 ms 186568 KiB
07_all_distinct_no_02.txt AC 2290 ms 190596 KiB
07_all_distinct_no_03.txt AC 2314 ms 190256 KiB
07_all_distinct_no_04.txt AC 2270 ms 185908 KiB
07_all_distinct_no_05.txt AC 2293 ms 190224 KiB
08_negative_killer_01.txt AC 304 ms 42708 KiB
08_negative_killer_02.txt AC 297 ms 43772 KiB
08_negative_killer_03.txt AC 288 ms 43012 KiB
08_negative_killer_04.txt AC 267 ms 38344 KiB
08_negative_killer_05.txt AC 104 ms 20380 KiB
09_random_z_killer_01.txt AC 368 ms 50520 KiB
09_random_z_killer_02.txt AC 366 ms 50620 KiB
09_random_z_killer_03.txt AC 370 ms 50576 KiB
09_random_z_killer_04.txt AC 370 ms 50536 KiB
09_random_z_killer_05.txt AC 374 ms 50624 KiB
09_random_z_killer_06.txt AC 379 ms 50576 KiB
09_random_z_killer_07.txt AC 367 ms 50772 KiB
09_random_z_killer_08.txt AC 388 ms 50708 KiB
09_random_z_killer_09.txt AC 369 ms 50536 KiB
09_random_z_killer_10.txt AC 366 ms 50660 KiB
10_sort_z_killer_01.txt AC 2309 ms 190336 KiB
10_sort_z_killer_02.txt AC 2285 ms 189176 KiB
10_sort_z_killer_03.txt AC 2289 ms 189432 KiB
10_sort_z_killer_04.txt AC 2259 ms 187608 KiB
10_sort_z_killer_05.txt AC 2276 ms 189860 KiB