| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 148373 | CHT를 사랑하는 모임 (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "unique.h"
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<db,db> pdb;
typedef tuple<int,int,int,int> TP;
typedef vector<vector<ll>> mat;
const int N=1e5+5;
const ll mod=1e9+7;
int n,p1[N],p2[N];
vector<int> ans;
int query(int s,int e)
{
return UniqueCount(s-1,e-1);
}
vector<int> PickUnique(int n_)
{
n=n_;
for(int i=1;i<=n;i++) p1[i]=query(1,i);
for(int i=1;i<=n;i++) p2[i]=query(i,n);
for(int i=1;i<=n;i++){
if(i==1){
if(p2[i]==p2[i+1]+1) ans.push_back(1);
else ans.push_back(0);
}
else if(i==n){
if(p1[i]==p1[i-1]+1) ans.push_back(1);
else ans.push_back(0);
}
else{
if(p1[i]==p1[i-1]+1&&p2[i]==p2[i+1]+1) ans.push_back(1);
else ans.push_back(0);
}
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
