제출 #1132596

#제출 시각아이디문제언어결과실행 시간메모리
1132596djsksbrbfTable Tennis (info1cup20_tabletennis)C++20
0 / 100
20 ms4280 KiB
/* ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡤⢶⡺⠛⢓⡶⢤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡟⠀⠀⢀⡗⠀⠸⡇⠀⠈⢻⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣼⠁⠀⢀⡞⠀⣀⠀⢳⡀⠀⠈⣧⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⠴⠶⢿⣉⢡⡷⠦⠤⠬⠴⠊⣍⡳⣮⡷⠤⣴⢿⣏⣹⠷⠶⠤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠠⣶⣶⣛⡉⠁⣀⣀⣀⣀⣈⣿⠲⠦⣤⣀⡴⣊⣭⡑⢬⣻⣷⠷⠖⣿⠤⠤⣤⣤⣀⣀⣉⣉⣻⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠙⠯⣟⡻⠿⣯⣤⣠⠤⠟⠓⢲⡦⣬⣷⣝⣶⣻⣾⣥⣴⣶⡛⠛⠧⢄⣀⣠⡴⠾⠛⣋⡽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⢶⣤⣉⠙⠿⣶⣞⡁⠀⠀⢸⠋⠛⢹⡇⠀⠀⠀⢉⣽⠶⠛⠉⣁⣴⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠷⣦⣈⠙⢿⣦⣀⣸⡇⠀⠈⡇⢀⣤⡾⠛⢁⣠⠖⣫⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣨⡽⠳⢦⡈⠛⢿⣇⣀⣠⡿⠟⢅⣤⠖⠋⣠⡴⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠻⣇⠀⠸⣿⣷⣄⡉⠛⢋⣠⣾⣿⠗⠀⢠⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠀⠈⠢⡀⠈⠳⠽⠟⠒⠋⠻⠟⠁⠀⢴⠟⣡⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⣀⡈⠓⠦⡄⠀⠀⠀⠀⢀⣠⠞⢁⠔⠹⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠋⠀⣰⣷⣭⣲⡤⠀⠀⠀⠀⠀⠉⠀⠒⠁⠀⠀⢯⠳⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡞⠳⢦⣠⣿⠃⣹⠀⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠷⠿⠙⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⢀⣠⢶⣫⣿⣿⢿⣦⣀⡿⢿⣰⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⡋⠉⢳⡀⢀⢠⣾⣿⣶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢀⣠⠖⣫⣵⢿⣽⡿⢿⡽⢻⣏⣀⠴⣻⢳⠦⢤⣤⣤⣤⣤⠴⠖⣛⣧⡙⢟⢦⡀⠙⣟⣿⡺⣾⣝⡿⣯⣗⢤⣀⠀⠀⠀⠀⠀⠀ ⠀⠀⣴⣟⣿⣟⣯⣾⢟⣫⣾⡿⠞⠁⢨⠏⡴⣱⠯⠶⠒⠚⣉⣩⠤⠖⠋⠁⠀⠙⣎⢳⡘⣟⠋⠲⣝⣾⣝⣿⣾⣝⠿⣮⣗⣤⣤⡀⠀⠀ ⠀⣠⣿⢿⣷⣿⣮⣵⢟⡽⠋⠀⠀⢀⡞⢰⣳⠃⡴⠖⠚⠉⠉⠀⠀⠀⠀⠀⣠⠞⢈⣧⣳⡘⣆⠀⠀⠑⢯⣳⣮⡛⢿⣮⡟⣻⣿⣧⡀⠀ ⢘⣿⣷⡞⠻⣿⣟⡵⠋⠀⠀⠀⠀⣼⢀⣧⡏⣸⠃⠀⠀⠀⠀⠀⠀⠀⠀⡴⠁⣠⠞⠈⢧⢧⠸⡄⠀⠀⠀⠉⠫⡻⢿⢟⣾⣿⡙⠻⢷⣄ ⠋⠀⠙⠿⣦⣽⣿⣿⡀⠀⠀⠀⢀⡇⢸⣼⢀⡏⠀⠀⠀⠀⠀⠀⠀⢀⡞⠀⡴⠁⠀⠀⠘⡟⡆⢻⠀⠀⠀⠀⠀⢘⣦⣞⡞⢀⣿⣶⣿⣿ ⡇⠀⢀⠔⢻⡘⡟⣟⣷⡀⠀⠀⢸⡇⣿⡇⣸⠁⠀⠀⠀⠀⠀⠀⢠⠞⢀⠞⠀⠀⠀⠀⠀⢻⣷⠘⡇⠀⠀⠀⢀⣾⢯⣾⠶⣷⠋⠁⠀⠀ ⡟⠛⠁⠀⠘⡇⣧⠘⣿⣷⡄⠀⢸⡇⣿⣇⣿⠀⠀⠀⠀⠀⠀⢀⡎⢠⠏⠀⠀⠀⠀⠀⠀⠸⣿⡄⣇⠀⠀⢀⣾⢏⡞⣼⢸⠇⠉⠲⠤⣀ ⡇⠀⠀⠀⠀⣷⢻⠀⠘⢿⣿⠶⠾⢧⡟⢿⡇⠀⠀⠀⠀⠀⠀⡼⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⣿⠀⢀⣾⢯⡞⠀⡟⣸⠀⠀⠀⠀⠀ ⣧⠀⠀⠀⠀⢻⢸⠀⠀⠘⣿⢦⠀⠀⣷⡿⡇⠀⠀⠀⠀⢀⠼⢁⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡟⠉⠉⢹⣯⠏⠀⠀⡇⣿⠀⠀⠀⠀⠀ ⢸⡀⠀⠀⠀⢸⣾⡇⠀⠀⣇⠹⣿⠿⠿⠷⡙⢆⢀⡠⠞⣁⠴⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⠤⠴⡿⣿⠀⠀⠀⡇⡿⠀⠀⠀⠀⠀ ⠀⢷⡀⠀⣠⢞⡽⠁⠀⢀⡏⣠⠏⠀⠀⠀⠈⢪⡉⣤⠚⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠙⣏⠁⣿⠀⠀⢠⡇⣇⠀⠀⠀⠀⢰ ⠀⢺⣍⠉⠹⠊⠀⠀⠀⢸⡛⠁⠀⠀⠀⠀⠀⠘⡇⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⣸⡄⠀⠀⠓⠈⠢⣀⣠⠔⢳ ⠀⢠⡏⠀⠀⠀⠀⠀⠀⠈⣳⠀⠀⠀⠀⠀⠀⠀⡇⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⠀⠀⠀⠀⠀⠀⠀⢠⠏ ⠀⠀⡇⠀⠀⠀⠀⠀⠀⢸⣟⣇⠀⠀⠀⠀⠀⠀⣷⢸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⠀⠀⠀⠀⠀⠀⠀⢸⠀ */ // made by djsksbrbf, 2025 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef pair <int, int> pii; #define pb push_back #define fi first #define se second const int MOD = 1e9 + 7; const int MAX = 2e5 + 5; int a[MAX]; int n, k, nk; vector <int> v; bool check(int l, int r){ int sum = a[l] + a[r]; l++; r--; v.clear(); v.pb(a[l]); v.pb(a[r]); int cnt = 1; while(l <= r){ if(cnt + (r - l + 1) / 2 < cnt)return 0; while(a[l] + a[r] > sum)r--; if(a[l] + a[r] == sum){ v.pb(a[l]); v.pb(a[r]); cnt ++; r--; } l++; } return cnt >= (n / 2); } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> k; /* _ _ _ _ _ _ x y z y x */ nk = n + k; for(int i = 1 ; i <= nk ; i++)cin >> a[i]; for(int l = 1 ; l <= k + 1 ; l++){ for(int r = nk ; nk -r + l - 1 <= k ; r--){ if(check(l, r)){ sort(v.begin(), v.end()); for(auto it : v)cout << it<< ' '; cout << endl; return 0; } } } cout << "wa" << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...