diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1a4446c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "queue": "cpp" + } +} \ No newline at end of file diff --git "a/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/1431.cpp" "b/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/1431.cpp" new file mode 100644 index 0000000..2acc3f3 --- /dev/null +++ "b/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/1431.cpp" @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace std; + +bool cmp(const string &s1, const string &s2){ + if(s1.size()!=s2.size()){ + return s1.size()> n; + + vector arr(n); + for(int i=0;i> arr[i]; + } + + sort(arr.begin(), arr.end(), cmp); + + for(int i=0;i +#include +#include + +using namespace std; + +int main(){ + + ios_base::sync_with_stdio(false); + cin.tie(NULL); + + int n, m, num; + string stm; + + cin >> n >> m; + + vector arr(n); + for(int i=0;i> arr[i]; + } + sort(arr.begin(), arr.end()); + + for(int i=0;i> stm; + if(binary_search(arr.begin(), arr.end(), stm)){ + num++; + } + } + + cout << num; + + return 0; +} \ No newline at end of file diff --git "a/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/19636.cpp" "b/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/19636.cpp" new file mode 100644 index 0000000..e50c1a6 --- /dev/null +++ "b/01_\354\240\225\353\240\254_\353\247\265_\354\205\213/19636.cpp" @@ -0,0 +1,46 @@ +#include +#include + +using namespace std; + +int main(){ + int w1, day_eat, diet_eat, diet_ex, n, tr; + + cin >> w1 >> day_eat >> tr; + cin >> n >> diet_eat >> diet_ex; + + int day_life=day_eat; + int diet_life=day_life; + int w0=w1; + int tr_w; + + for(int i=0;itr){ + diet_life+=floor(tr_w/2.0); + } + w0+=diet_eat - day_life - diet_ex; + } + + if(w0<=0){ + cout<<"Danger Diet" << '\n'; + } + else{ + cout << w0 << ' ' << day_life << '\n'; + } + + if(diet_life<=0 || w1<=0){ + cout << "Danger Diet" << '\n'; + } + else{ + if(day_life > diet_life){ + cout << w1 << ' ' << diet_life << ' ' << "YOYO" << '\n'; + } + else{ + cout << w1 << ' ' << diet_life << ' ' << "NO" << '\n'; + } + } + + return 0; +} \ No newline at end of file diff --git "a/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/10757.cpp" "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/10757.cpp" new file mode 100644 index 0000000..85070df --- /dev/null +++ "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/10757.cpp" @@ -0,0 +1,54 @@ +/****************************************************************************** + +Welcome to GDB Online. +GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, +C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. +Code, Compile, Run and Debug online from anywhere in world. + +*******************************************************************************/ +#include +#include + +using namespace std; + +int main() +{ + string a, b, ab_total; + int a_digit, b_digit, a_b, ab_over=0; + char ab_char; + + cin >> a >> b; + + int a_size=a.size(); + int b_size=b.size(); + + while (a_size>0||b_size>0){ + if(a_size>0){ + a_digit=a[--a_size]-'0'; + } + else{ + a_digit=0; + } + if(b_size>0){ + b_digit=b[--b_size]-'0'; + } + else{ + b_digit=0; + } + a_b=a_digit+b_digit+ab_over; + ab_over=a_b/10; + a_b%=10; + ab_char=a_b+'0'; + ab_total+=ab_char; + } + if(ab_over!=0){ + ab_char=ab_over+'0'; + ab_total+=ab_char; + } + + for(int i=ab_total.length()-1;i>=0;i--){ + cout << ab_total[i]; + } + + return 0; +} \ No newline at end of file diff --git "a/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/1158.cpp" "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/1158.cpp" new file mode 100644 index 0000000..ecfd03f --- /dev/null +++ "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/1158.cpp" @@ -0,0 +1,35 @@ +#include +#include + +using namespace std; + +int main(){ + + int n, k; + + cin >> n >> k; + queue q; + + for(int i=1;i<=n;i++){ + q.push(i); + } + + cout << "<"; + + while(!q.empty()){ + for(int i=1;i"; + q.pop(); + } + } + + return 0; +} \ No newline at end of file diff --git "a/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/4949.cpp" "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/4949.cpp" new file mode 100644 index 0000000..6555d74 --- /dev/null +++ "b/02_\354\212\244\355\203\235_\355\201\220_\353\215\261/4949.cpp" @@ -0,0 +1,57 @@ +#include +#include +#include + +using namespace std; + +int main(){ + + ios_base::sync_with_stdio(false); + cin.tie(NULL); + + while(true){ + + string str; + stack s; + bool result=true; + + getline(cin, str); + + if(str[0]=='.'){ + break; + } + + for(int i=0;i