| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 789161 | DavidAA007 | Stone Arranging 2 (JOI23_ho_t1) | C++14 | 170 ms | 15156 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define mod 1000000007
//#define inf 0x3f3f3f3f
//#define int long long
#define bit(x,i)(((x)>>(i))&1)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
ifstream fin("cablaj.in");
ofstream fout("cablaj.out");
//typedef long long ll;
//const long long int mare=1LL*1000000000000000000;
const int mare=2e9+5;
const int nmax=3e3+5;
int T,n,m,k,x,y,c,i,j,t;
int suma,maxx,numar,minn,poz,contor,st,dr;
vector<pair<int,int>> v;
map<int,int>mp;
int main()
{
FAST
cin>>n;
for(i=0;i<n;i++) {
cin >> x;
if(mp[x])
{
while(v.size() && v.back().first!=x)
{
mp[v.back().first]--;
v.pop_back();
}
}
v.push_back({x,i});
mp[x]++;
}
for(i=0;i<v.size()-1;i++)
{
if(v[i].first==v[i+1].first)
for(j=v[i].second;j<v[i+1].second;j++)
cout<<v[i].first<<"\n";
else
cout<<v[i].first<<"\n";
}
cout<<v.back().first<<"\n";
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... | ||||
