Submission #132144

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1321442019-07-18 10:51:17stefdascaUzastopni (COCI15_uzastopni)C++14
160 / 160
105 ms25720 KiB
#include<bits/stdc++.h>
using namespace std;
int n, val[10002];
vector<int> v[10002], q[112];
bitset<112>s[10002][112];
vector<pair<int, int> >r[10002];
void dfs(int nod)
{
for(int i = 0; i < v[nod].size(); ++i)
{
int vecin = v[nod][i];
dfs(vecin);
}
for(int i = 0; i < 101; ++i)
q[i].clear();
for(int i = 0; i < v[nod].size(); ++i)
{
int x = v[nod][i];
for(int j = 0; j < r[x].size(); ++j)
{
pair<int, int> ox = r[x][j];
q[ox.first].push_back(ox.second);
}
}
for(int i = 102; i >= 1; --i)
{
if(i == val[nod])
{
s[nod][i] |= s[nod][i + 1];
s[nod][i].set(i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

uzastopni.cpp: In function 'void dfs(int)':
uzastopni.cpp:9:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < v[nod].size(); ++i)
                    ~~^~~~~~~~~~~~~~~
uzastopni.cpp:16:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < v[nod].size(); ++i)
                    ~~^~~~~~~~~~~~~~~
uzastopni.cpp:19:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < r[x].size(); ++j)
                        ~~^~~~~~~~~~~~~
uzastopni.cpp:34:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int orz = 0; orz < q[i].size(); orz++)
                              ~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...