제출 #238026

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2380262020-06-09 18:50:01MrRobot_28Garaža (COCI17_garaza)C++17
160 / 160
589 ms40568 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
vector <vector <pair <int, int> > > treeleft, treeright;
vector <ll> treeans;
bool cmp(pair <int, int> a, pair <int, int> b)
{
return a.second < b.second;
}
void update(int v, int l, int r, int ind, int val)
{
if(l == r)
{
if(val == 1)
{
treeans[v] = 0;
}
else
{
treeans[v] = 1;
}
treeleft[v].clear();
treeright[v].clear();
if(val != 1)
{
treeleft[v].push_back({l, val});
treeright[v].push_back({r, val});
}
return;
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

garaza.cpp: In function 'void update(int, int, int, int, int)':
garaza.cpp:45:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeleft[v * 2].size() - 1; i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:49:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeleft[v * 2 + 1].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:55:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(i < treeleft[v * 2 + 1].size() -1 && __gcd(treeleft[v * 2 + 1][i + 1].second, a) == d)
       ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:65:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeleft[v * 2].size(); i++){
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:68:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i< treeleft[v * 2 + 1].size(); i++)
                  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:74:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(i < treeleft[v * 2 + 1].size() - 1 && __gcd(treeleft[v * 2 + 1][i + 1].second, a) == d)
       ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:83:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeleft[v * 2].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:92:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeright[v * 2 + 1].size() - 1; i ++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:96:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeright[v * 2].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:103:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(i < treeright[v * 2].size() - 1 && __gcd(treeright[v * 2][i + 1].second, a) == d)
       ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:113:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeright[v * 2 + 1].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:117:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeright[v * 2].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:124:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(i < treeright[v * 2].size() - 1 && __gcd(treeright[v * 2][i + 1].second, a) == d)
       ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:133:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < treeright[v * 2 + 1].size(); i++)
                  ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp:142:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while(j + 1 < treeleft[v * 2 + 1].size() && __gcd(treeleft[v * 2 + 1][j + 1].second, treeright[v * 2][i].second) != 1)
          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
garaza.cpp: In function 'long long int ans(int, int, int, int, int)':
garaza.cpp:173:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while(j + 1 < treeleft[v * 2 + 1].size() && __gcd(treeleft[v * 2 + 1][j + 1].second, treeright[v * 2][i].second) != 1)
          ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...