| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1346468 | msb.83 | Kutije (COCI21_kutije) | C++20 | 242 ms | 589824 KiB |
//Rahman ve Rahim olan Allah'ın adıyla
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mid ((st+end)/2)
#define fi first
#define se second
const int INF=1e15+5;
const int E16=1e6;
const int ONE=1;
const int TWO=2;
const int ZERO=0;
const int MOD=1e9+7;//(x+MOD)%MOD
//el.erase(unique(el.begin(),el.end()),el.end());
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int n,m,qry,a;cin>>n>>m>>qry;vector<vector<bool>>vis(n,vector<bool>(n,false));
while(m--){
for(int i=0;i<n;i++){
cin>>a;a--;if(a==i) continue;
vis[a][i]=true;
}
}
for(int j=0;j<n;j++){
for(int i=0;i<n;i++){
for(int k=0;k<n;k++){
if(vis[i][j]&&vis[j][k]){vis[i][k]=true;}
}
}
}int b;
while(qry--){
cin>>a>>b;a--;b--;
if(vis[a][b]){
cout<<"DA\n";
}else{
cout<<"NE\n";
}
}
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
