Submission #172188

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1721882019-12-31 14:31:29HellAngelBitaro’s Party (JOI18_bitaro)C++14
0 / 100
24 ms17528 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 7;
const int magic = 320;
int n, m, q, dp[maxn], block[maxn];
vector<int> qr;
vector<int> vt[maxn], vt2[maxn];
vector<pair<int, int>> graph[maxn];
void Merge(int x, int y)
{
int cntx = 0;
int cnty = 0;
vector<pair<int, int>> newvt = {};
while(cntx < graph[x].size() || cnty < graph[y].size())
{
if(newvt.size() == magic) break;
if(cntx == graph[x].size()) newvt.push_back({graph[y][cnty].first + 1, graph[y][cnty].second}), cnty++;
else if(cnty == graph[y].size()) newvt.push_back(graph[x][cntx++]);
else
{
if(graph[y][cnty].first + 1 > graph[x][cntx].first)
{
newvt.push_back({graph[y][cnty].first + 1, graph[y][cnty].second});
cnty++;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'void Merge(long long int, long long int)':
bitaro.cpp:19:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(cntx < graph[x].size() || cnty < graph[y].size())
           ~~~~~^~~~~~~~~~~~~~~~~
bitaro.cpp:19:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(cntx < graph[x].size() || cnty < graph[y].size())
                                     ~~~~~^~~~~~~~~~~~~~~~~
bitaro.cpp:22:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(cntx == graph[x].size()) newvt.push_back({graph[y][cnty].first + 1, graph[y][cnty].second}), cnty++;
            ~~~~~^~~~~~~~~~~~~~~~~~
bitaro.cpp:23:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         else if(cnty == graph[y].size()) newvt.push_back(graph[x][cntx++]);
                 ~~~~~^~~~~~~~~~~~~~~~~~
bitaro.cpp: In function 'int32_t main()':
bitaro.cpp:72:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int j = 0; j < graph[u].size(); j++)
                            ~~^~~~~~~~~~~~~~~~~
bitaro.cpp:41:63: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     if(fopen("test.inp", "r")) freopen("test.inp", "r", stdin), freopen("test.out", "w", stdout);
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bitaro.cpp:41:63: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...