| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 783909 | tolbi | Game (IOI14_game) | C++17 | 1058 ms | 7216 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
#define author tolbi
#include<bits/stdc++.h>
using namespace std;
template<typename X, typename Y> ostream& operator<<(ostream& os, pair<X,Y> pr){return os<<pr.first<<" "<<pr.second;}
ostream& operator<<(ostream& os, bool bl){return os<<(int32_t)bl;}
template<typename X> ostream& operator<<(ostream& os, vector<X> v){for(auto &it : v) os<<it<<" ";return os;}
template<typename X, size_t Y> ostream& operator<<(ostream& os, array<X,Y> v){for(auto &it : v) os<<it<<" ";return os;}
#define deci(x) int x;cin>>x;
#define endl '\n'
#define decstr(x) string x;cin>>x;
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define rev(x) reverse(x.begin(), x.end())
#define tol(bi) (1LL<<((int)(bi)))
typedef long long ll;
const ll INF = INT_MAX;
const int MOD = 1e9+7;
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
#include "game.h"
vector<vector<int>> ara;
vector<int> par;
vector<int> sz;
int find_par(int node){
if (par[node]==node) return node;
return par[node]=find_par(par[node]);
}
void initialize(int n) {
ara.resize(n,vector<int>(n,0));
par.resize(n);
iota(par.begin(), par.end(), 0);
sz.resize(n,1);
}
int hasEdge(int u, int v) {
if (find_par(u)==find_par(v)){
return 0;
}
u=find_par(u);
v=find_par(v);
int arada = 0;
for (int i = 0; i < par.size(); i++){
if (find_par(i)!=v) continue;
arada+=ara[u][i];
}
if (arada==sz[u]*sz[v]-1){
par[v]=u;
sz[u]+=sz[v];
sz[v]=0;
for (int i = 0; i < par.size(); ++i)
{
if (find_par(i)==u) continue;
ara[u][i]+=ara[v][i];
ara[v][i]=0;
}
return 1;
}
else {
ara[u][v]++;
ara[v][u]++;
return 0;
}
}컴파일 시 표준 에러 (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... | ||||
