QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#177539 | #7119. Longest Trip | triple321# | 0 | 1ms | 3876kb | C++20 | 1.3kb | 2023-09-13 02:09:07 | 2023-09-13 02:09:08 |
Judging History
answer
#include "longesttrip.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
#define lg long long
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
vector<lg> adj[257];
vector<int> ans, cur;
lg vis[257], bo = 0;
void dfs(lg src)
{
vis[src] = true;
cur.push_back(src);
if(cur.size() > (lg)ans.size()) ans = cur;
if(bo) reverse(adj[src].begin(), adj[src].end());
for(auto it : adj[src])
{
if(vis[it]) continue;
dfs(it);
}
cur.pop_back();
return;
}
std::vector<int> longest_trip(int n, int d)
{
for(int i = 0; i < n; i++)
{
for(int j = i+1; j < n; j++)
{
bool b = are_connected({i}, {j});
if(b)
{
adj[i].push_back(j);
adj[j].push_back(i);
}
}
}
for(int i = 0; i < n; i++)
{
dfs(i);
memset(vis, 0, sizeof(vis));
}
bo = 1;
for(int i = 0; i < n; i++)
{
dfs(i);
memset(vis, 0, sizeof(vis));
}
bo = 0;
for(int i = 0; i < n; i++) adj[i].clear();
ans.clear();
return ans;
}
/*
1
5 1
1
1 1
0 0 1
0 0 0 1
*/
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3804kb
input:
341 3 3 1 1 1
output:
3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 1 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 1 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 1 0
result:
wrong answer
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3824kb
input:
341 3 2 1 1 1
output:
3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 1 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 1 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 1 0
result:
wrong answer
Subtask #3:
score: 0
Wrong Answer
Test #19:
score: 0
Wrong Answer
time: 1ms
memory: 3876kb
input:
341 3 1 1 1 1
output:
3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 1 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 1 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 1 0
result:
wrong answer
Subtask #4:
score: 0
Wrong Answer
Test #83:
score: 0
Wrong Answer
time: 1ms
memory: 3828kb
input:
341 3 1 1 1 1
output:
3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 1 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 0 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 0 1 1 1 2 3kC2Ia2048BfyJVGojMUKKtilctlZKcB 1 0
result:
wrong answer