| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1363368 | BigBadBully | Voltage 2 (JOI26_voltage) | C++20 | 23 ms | 680 KiB |
#include <bits/stdc++.h>
#include "voltage.h"
#define pii pair<int,int>
#define ff first
#define ss second
using namespace std;
bool solve(int n, int m) {
vector<int> vis(n,0);
vector<pii> edg;
while(edg.size()<m)
{
int mini = 0;
int eq = 1;
while(vis[mini])mini++;
for(int i = mini+1; i < n ;i++)
if(!vis[i])
{
vector<int> a = vis;
auto b = a;
a[mini] = 1;
b[i] = 1;
int res = query(a,b);
if(res<0)
mini = i;
if(res!=0)eq = 0;
}
if(eq)return false;
vis[mini]=1;
for(int i = 0;i < n; i++)
if(!vis[i])
{
auto a = vis,b = vis;
a[mini]=0;
a[i]=1;
b[i]=1;
int res = query(a,b);
if(res>0)return false;
if(res)
edg.push_back({i,mini});
}
}
for(pii x:edg)
answer(x.ff,x.ss);
return true;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
