# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1112455 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 1745 ms | 3664 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a;
int b;
long long int toplam=0;
scanf("%d",&a);
if(a==1){
printf("1");
return 0;
}
vector<int> c(a);
map<int,int> v;
for(int i=0;i<a;i++){
scanf("%d",&c[i]);
}
int eleman;
int sayac=a;
int kontrol=1;
while(kontrol){
kontrol=0;
for(int i=0;i<a;i++){
if(c[i]!=0){
eleman=i;
kontrol=1;
break;
}}
int ar=1;
for(int i=eleman+1;i<a;i++){
if((c[i]+ar)==c[eleman]){
sayac=sayac-1;
ar=ar+1;
c[i]=0;
}
}
c[eleman]=0;
}
printf("%d",sayac);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |