Q

@qazsxc2

1406 에디터

C++
4 months ago
#include <iostream> #include <list> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string str; cin >> str; list<char> L;

10808

C++
4 months ago
#include <iostream> #include <string> using namespace std; int alp[26]; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s;

18870

C++
4 months ago
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { // 1. 입출력 가속 (필수!) ios_base::sync_with_stdio(false); cin.tie(NULL);

2295 세 수의 합

C
4 months ago
#include <stdio.h> #include <stdlib.h> int compare(const void *a,const void *b) { long long A=*(long long*)a; long long B=*(long long*)b; if(A>B) return 1; else if (A<B) return-1; else return 0; }

18870 좌표 압축

C
4 months ago
#include <stdio.h> #include <stdlib.h> #include <string.h> long long num_sort[1000001]; long long num1[1000001]; int binary(long long target,int size){ int start=0; int end=size-1;

1822 차집합

C
4 months ago
#include <stdio.h> #include <stdlib.h> 정렬 int compare(const void *a,const void *b) { long long A=*(long long*)a; long long B=*(long long*)b; if(A>B) return 1; else return -1; }

2110 공유기 설치

C
4 months ago
#include <stdio.h> #include <stdlib.h> int compare(const void *a, const void *b) { if(*(long long *)a >*(long long *)b) return 1; else return -1; } long long num[200001]; int main() {

11662 민호와 강호

C
4 months ago
#include <stdio.h> #include <math.h> typedef struct point { double x; double y; } Point; //거리함수 double get_dist(double time,Point a,Point b,Point c,Point d) { //민호

2805 나무 자르기

C
4 months ago
#include <stdio.h> #include <stdlib.h> //나무 길이 long long tree_list[1000001]; int compare(const void *a, const void *b) { long long A=*(long long *)a; long long B=*(long long *)b; if (A>B) return 1; else return -1;

10816 숫자 카드 2

C
4 months ago
#include <stdio.h> #include <stdlib.h> int compare(const void *a,const void *b) { return *(int *)a-*(int *)b; } int num[500001]; int find_l(int target,int start, int end) { while(start<=end) { int mid=(start+end)/2;

10816 숫자 카드 2

C
4 months ago
#include <stdio.h> #include <stdlib.h> int compare(const void *a,const void *b) { return *(int *)a-*(int *)b; } int num[500001]; int find_l(int target,int start, int end) { if(start>end) return start; int mid=(start+end)/2;

10815 숫자카드

C
4 months ago
#include <stdio.h> #include <stdlib.h> int num[500001]; int compare(const void *a,const void *b) { return *(int *)a-*(int *)b; } int binary(int target,int start,int end) { while(start<=end) { int mid=(start+end)/2;

10815 숫자 카드

C
4 months ago
#include <stdio.h> #include <stdlib.h> //정렬해야하는 배열 int num[500001]; //비교함수 int compare(const void *a,const void *b) { return *(int *)a-*(int *)b; } //이분탐색 int binary(int target,int start,int end) {

11656 접미사 배열

C
4 months ago
#include <stdio.h> #include <string.h> #include <stdlib.h> int compare(const void *a,const void *b) { return strcmp((char *)a, (char *)b); } char str1[1001][1005]; int main() { char str[1005]; scanf("%s",str);

11655 ROT13

C
4 months ago
#include <stdio.h> int main() { char str[105]; fgets(str,sizeof(str),stdin); for(int i=0; str[i]; i++) { if((str[i]>='a' && str[i]<='m') || (str[i]>='A' && str[i]<='M')) { str[i]+=13; } else if ((str[i]>='n'

10820 문자열 분석

C
4 months ago
#include <stdio.h> #include <ctype.h> int main() { char str[105]; // 입력받을게 없을떄까지 반복 한줄씩 입력받음 while(fgets(str,sizeof(str),stdin)!=NULL) { int s=0,l=0,num=0,space=0; for(int i=0; str[i]; i++) { if(islower(str[i

6588 골드바흐의 추측

C
4 months ago
#include <stdio.h> // 0 1 2 3 4 5 // 1 1 0 0 1 0 ...0이면 소수 int num[1000001]={1,1,0}; //무슨 체 int main() { //소수인 수 찾기, i가 소수면 i배수 다 지움 for(int i=2; i*i<=1000000; i++) { if(num[i]==0) { for(int j=2; i*j<=1000000; j++) {

1850 최대공약수

C
4 months ago
#include <stdio.h> long long gcd(long long a,long long b) { if(a<b) { long long tmp=a; a=b; b=tmp; } long long r=a%b; while(r>0) { a=b;

2004 조합 0의 개수

C
4 months ago
#include <stdio.h> long long count(long long n,int k) { long long cnt=0; while(n>=k) { cnt+=n/k; //k*=k; n/=k; } return cnt; }

2089 -2진수

C
4 months ago
#include <stdio.h> int num[1000]; int main() { int n,i=0; int r; scanf("%d",&n); if(n==0) { printf("0"); return 0; }