# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1041735 |
2024-08-02T07:35:46 Z |
vjudge1 |
Izlet (COI19_izlet) |
C++17 |
|
638 ms |
35668 KB |
#include<bits/stdc++.h>
using namespace std;
const int N = 3000 + 10;
int c[N][N], n;
void subtask1()
{
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n; j ++)
c[i][j]--;
int dist[n + 1], par[n + 1];
for(int i = 1; i <= n; i ++)
dist[i] = n + 10, par[i] = -1;
dist[1] = 0;
deque<int> Q;
Q.push_back(1);
while(Q.size())
{
int v = Q.front();
Q.pop_front();
for(int u = 1; u <= n; u++)
{
if(u == v) continue;
if(dist[v] + c[u][v] < dist[u])
{
par[u] = v;
dist[u] = dist[v] + c[u][v];
Q.push_back(u);
}
else if(dist[u] == dist[v] && !c[u][v] && par[v] != u)
par[u] = v;
}
}
for(int i = 1; i <= n; i ++)
cout << dist[i] % 2 + 1 << ' ';
cout << endl;
for(int i = 2; i <= n; i++)
cout << i << ' ' << par[i] << endl;
}
void subtask2()
{
}
int main()
{
int t;
cin >> t >> n;
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n; j ++)
cin >> c[i][j];
// if(t == 1)
//subtask1();
//else
for(int i = 1; i <= n; i ++)
cout << c[1][i] << ' ';
cout << endl;
for(int i = 1; i + 1 < n ; i++)
cout << i << ' ' << i + 1 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
638 ms |
35668 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |