#include #include #include #include using namespace std; struct Pair{ int x; int y; }; void check(Pair p); Pair makePair(int x, int y); int bfs(); int a, b; bool picture[501][501]; bool visited[501][501]; queue que; int main(){ freopen("input.txt","r",stdin); ios::sync_with_stdio(false); cin.tie(0); memset(picture, false, sizeof(picture)); memset(visited, false, sizeof(visited)); while( !que.emp..
#include #include #include using namespace std; int main(){ freopen("input.txt","r",stdin); string str1; string str2; cin>>str1; cin>>str2; int delete_cnt =0; for(int i=0; i
#include #include #include #include using namespace std; int main(){ freopen("input.txt","r",stdin); ios::sync_with_stdio(false); cin.tie(0); int n; string str1; string temp; cin>>n; list str_list; list::iterator cursor; for(int t=0; t>str1; cursor= str_list.begin(); for(int i=0; i
Strfry 성공 영어 시간 제한메모리 제한제출정답맞은 사람정답 비율 2 초 256 MB 227 127 117 55.981% 문제 In the C programming language, strings are not a native data type. In fact, they are just an array of characters, with a sentinel NULL value used to denote the end of the string. Since working with strings is a very important thing to do in programming languages, the C standard library has several very useful functions for ..
에디터 실패 한국어 시간 제한메모리 제한제출정답맞은 사람정답 비율 0.3 초 (하단 참고) 512 MB 19105 4559 3050 25.749% 문제 한 줄로 된 간단한 에디터를 구현하려고 한다. 이 편집기는 영어 소문자만을 기록할 수 있는 편집기로, 최대 600,000글자까지 입력할 수 있다. 이 편집기에는 '커서'라는 것이 있는데, 커서는 문장의 맨 앞(첫 번째 문자의 왼쪽), 문장의 맨 뒤(마지막 문자의 오른쪽), 또는 문장 중간 임의의 곳(모든 연속된 두 문자 사이)에 위치할 수 있다. 즉 길이가 L인 문자열이 현재 편집기에 입력되어 있으면, 커서가 위치할 수 있는 곳은 L+1가지 경우가 있다. 이 편집기가 지원하는 명령어는 다음과 같다. LDBP $ 커서를 왼쪽으로 한 칸 옮김 (커서가 문장의..
예를 들어 아래배열이 있다고 치면 int a[20]; 아래와 같이 a의 배열의 모든 요소를 65로 초기화 시켜줄 수 있다. memset(a, 65, sizeof(a)); for 문 대신 memset을 사용하는 이유는 특정위치의 배열에 연속된 값을 넣을때 for문보다 속도가 빠르다는 것 때문이다. 아래는 증거 https://www.quora.com/What-makes-memset-so-fast https://stackoverflow.com/questions/7367677/is-memset-more-efficient-than-for-loop-in-c
https://stackoverflow.com/questions/18429021/why-is-infinity-0x3f3f3f3f Why is infinity = 0x3f3f3f3f? In some situations, one generally uses a large enough integer value to represent infinity. I usually use the largest representable positive/negative integer. That usually yields more code, since yo... stackoverflow.com 코드에서 정의된 무한대값은 무엇일까? 정답은 0x3f3f3f3f이다. 이진수로는 00111111001111110011111100111111..