QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#34750 | #4251. Game | willy108# | 0 | 1ms | 4060kb | C++20 | 1.7kb | 2022-06-12 06:50:31 | 2024-05-26 00:55:31 |
Judging History
answer
#include "game.h"
//apio 2022 game
//misaka will carry me to master
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <cassert>
#include <algorithm>
#include <vector>
#include <functional>
#include <numeric>
#include <set>
#include <map>
#include <bitset>
#define ll long long
#define lb long double
#define sz(vec) ((int)(vec.size()))
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define kill(x, s) {int COND = x; if(COND){ cout << s << "\n"; return ; }}
const lb eps = 1e-9;
const ll mod = 1e9 + 7, ll_max = 1e18;
//const ll mod = (1 << (23)) * 119 +1, ll_max = 1e18;
const int MX = 1e3+10, int_max = 0x3f3f3f3f;
struct {
template<class T>
operator T() {
T x; std::cin >> x; return x;
}
} in;
using namespace std;
int n, k;
bitset<MX> reach[MX];
bitset<MX> qq;
//hi is the largest node that can reach u
//lo is the smallest node u can reach
//if hi[u] >= lo[u] there is a cycle
void init(int _n, int _k){
n = _n, k = _k;
for(int i = k-2; i>=0; i--){
reach[k][k+1] = 1;
reach[k] |= reach[k+1];
}
}
int add_teleporter(int a, int b){
reach[a][b] = 1;
reach[a] |= reach[b];
for(int i = 0; i<n; i++){
if(reach[i][b]) reach[i] |= reach[a];
}
qq.reset();
for(int i = 0; i<k; i++){
if((qq&reach[i]).count()) return 1;
qq[i] = 1;
}
return 0;
}
/**
void solve(){
int n = in, m = in, k = in;
init(n, k);
for(int i = 1; i<=m; i++){
int a = in, b = in;
if(add_teleporter(a, b)) exit(0);
}
}
int main(){
cin.tie(0) -> sync_with_stdio(0);
int T = 1;
//cin >> T;
for(int i = 1; i<=T; i++){
solve();
}
return 0;
}
**/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 4060kb
input:
1 1 1 893123 893123 -1
output:
1
result:
wrong answer Wrong Answer [1]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%