제출 #1054277

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10542772024-08-12 08:20:47manhlinh1501Bitaro’s Party (JOI18_bitaro)C++17
0 / 100
4 ms11356 KiB
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using i64 = long long;
const int MAXN = 2e5 + 5;
const int BLOCK_SIZE = 200;
#define ALL(a) (a).begin(), (a).end()
int N, M, Q;
vector<int> adj[MAXN];
bool is_deleted[MAXN];
vector<pii> dp[MAXN];
int dist[MAXN];
bool vis[MAXN];
vector<pii> merge_vector(vector<pii> a, vector<pii> b) {
int x = 0, y = 0;
for(auto &[x, y] : b)
x++;
vector<pii> ans;
while(x < a.size() and y < b.size() and ans.size() < BLOCK_SIZE) {
while(x < a.size() and vis[a[x].second]) x++;
while(y < b.size() and vis[b[y].second]) y++;
if(x == a.size() or y == b.size()) break;
if(a[x].first > b[y].first) {
vis[a[x].second] = true;
ans.emplace_back(a[x++]);
} else {
vis[b[y].second] = true;
ans.emplace_back(b[y++]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

bitaro.cpp: In function 'std::vector<std::pair<int, int> > merge_vector(std::vector<std::pair<int, int> >, std::vector<std::pair<int, int> >)':
bitaro.cpp:20:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     while(x < a.size() and y < b.size() and ans.size() < BLOCK_SIZE) {
      |           ~~^~~~~~~~~~
bitaro.cpp:20:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     while(x < a.size() and y < b.size() and ans.size() < BLOCK_SIZE) {
      |                            ~~^~~~~~~~~~
bitaro.cpp:21:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         while(x < a.size() and vis[a[x].second]) x++;
      |               ~~^~~~~~~~~~
bitaro.cpp:22:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |         while(y < b.size() and vis[b[y].second]) y++;
      |               ~~^~~~~~~~~~
bitaro.cpp:23:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         if(x == a.size() or y == b.size()) break;
      |            ~~^~~~~~~~~~~
bitaro.cpp:23:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         if(x == a.size() or y == b.size()) break;
      |                             ~~^~~~~~~~~~~
bitaro.cpp:32:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     while(x < a.size() and ans.size() < BLOCK_SIZE)
      |           ~~^~~~~~~~~~
bitaro.cpp:34:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |     while(y < b.size() and ans.size() < BLOCK_SIZE)
      |           ~~^~~~~~~~~~
bitaro.cpp: In function 'int main()':
bitaro.cpp:72:17: warning: unused variable 'ans' [-Wunused-variable]
   72 |             int ans = -1;
      |                 ^~~
bitaro.cpp:44:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 |         freopen(TASK ".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
bitaro.cpp:45:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |         freopen(TASK ".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...