top of page

소스 코드 제출

공개·회원 52명

2025.5.9

/*#include <stdio.h>


int main()

{

int n, q, i, j, a, l, r, t, temp;

int x[200000]={}, cnt[1000]={};

scanf("%d%d", &n, &q);

for(i=0; i<n; i++){

scanf("%d", &x[i]);

}


for(i=0; i<q; i++){

scanf("%d%d", &l, &r);

a=0;

for(j=0; j<n; j++){

if(x[j]>=l&&x[j]<=r){


for(t=0; t<n; t++){

if(x[t]>=l&&x[t]<=r){

if(j>=t){

cnt[a]+=(x[j]-x[t]);

}

else{

cnt[a]+=(x[t]-x[j]);

}

}

}

a++;

}

if(x[j]>r){

break;

}

}

for(j=0; j<a; j++){

int max=j;

for(t=j+1; t<=n; t++){

if(cnt[t]>cnt[max]){

max=t;

}

}

temp = cnt[j];

cnt[j] = cnt[max];

cnt[max] = temp;

}

a=0;

j=0;

while(cnt[j+1]!=0){

a+=cnt[j]-cnt[j+1];

cnt[j]=0;

j++;

}

cnt[j]=0;

printf("%d\n", a);


}

return 0;

}


*/


#include<stdio.h>


int main()

{

int n, i, j;

int a[100000]={}, b[100000]={};

scanf("%d", &n);

for(i=0; i<n; i++){

scanf("%d%d", &a[i], &b[i]);

}

}

1회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page