Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

*.exe
*.vcxproj
24 changes: 24 additions & 0 deletions 10808_알파벳개수.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

string str;
int arr[26];

int main()
{
cin >> str;
for(char a : str)
{
arr[a - 'a']++ ;
}

for (int i = 0; i < 26; i++)
{
cout << arr[i] << " ";
}

return 0;
}
35 changes: 35 additions & 0 deletions 10988_팰린드롬확인하기.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <bits/stdc++.h>

using namespace std;

// string s;
// int cnt;

// int main()
// {
// cin >> s;

// for(int i = 0; i < s.length()/2 ; i++)
// {
// if(s[i] != s[s.length() - 1 - i])
// {
// cnt += 1;
// }
// }

// if(cnt == 0) cout << 1;
// else cout << 0;

// return 0;
// }

string s, tmp;
int main()
{
cin >> s;
tmp = s;
reverse(tmp.begin(), tmp.end());
if(tmp == s) cout << 1<< "\n";
else cout << 0 << "\n";
return 0;
}
29 changes: 29 additions & 0 deletions 1159_농구경기.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <bits/stdc++.h>

using namespace std;

int n, cnt[26];
string name, tmp;

int main()
{
cin >> n;

for (int i = 0; i < n; i++)
{
cin >> name;
cnt[name[0] - 'a'] ++;
}

for(int i=0; i < 26; i++)
{
if(cnt[i] >= 5)
{
tmp += (i + 'a');
}
}
if(tmp.size() != 0) cout << tmp << "\n";
else cout << "PREDAJA" << "\n";

return 0;
}
35 changes: 35 additions & 0 deletions 2309_일곱난쟁이.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <bits/stdc++.h>

using namespace std;

int a[10];

int main()
{
int sum = 0;

for(int i= 0; i < 9 ; i++){
cin >> a[i];
sum += a[i];
}

sort(a, a+9);

for (int i = 0; i < 9; i++)
{
for (int j = i + 1; j < 9; j++)
{
if ((sum - (a[i] + a[j])) == 100)
{
for (int k = 0; k < 9; k++)
{
if (i == k || j == k)
continue;
cout << a[k] << "\n";
}
return 0;
}
}
}
return 0;
}
26 changes: 26 additions & 0 deletions 2559_수열.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, k, tmp, psum[100001], ret = -10000004;

int main()
{
cin >> n >> k;
for(int i = 1; i <= n; i++)
{
cin >> tmp;
psum[i] = psum[i - 1] + tmp;
}

for(int i = k; i <= n; i++)
{
ret = max(ret, psum[i] - psum[i - k]);
}

cout << ret << "\n";

return 0;
}
31 changes: 31 additions & 0 deletions 2979_트럭주차.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <bits/stdc++.h>

using namespace std;

int a, b, c, ans = 0;
int arr[101];

int main()
{
cin >> a >> b >> c;
for (int i = 0; i < 3; i++)
{
int start, end;
cin >> start >> end;
for(int j = start ; j < end; j ++)
{
arr[j] += 1;
}
}

for(int i = 1; i <= 100; i ++)
{
if(arr[i] == 1) ans += arr[i] * a;
else if(arr[i] == 2) ans += arr[i] * b;
else ans += arr[i] * c;
}

cout << ans;
return 0;
}

33 changes: 33 additions & 0 deletions 9375_패션왕 신해빈.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <bits/stdc++.h>

using namespace std;

int t, n;
string a,b;

int main()
{
cin >> t;
while (t--)
{
map<string, int> wear;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a >> b;
wear[b] ++;
}

long long tmp = 1;

for (auto w : wear)
{
tmp *= ((long long)w.second + 1);
}

tmp -= 1;

cout << tmp << "\n";

}
}
37 changes: 37 additions & 0 deletions 9996_한국이그리울땐(다시).cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <bits/stdc++.h>

using namespace std;

int n;
string file, pattern, pre, suf;
int main()
{
cin >> n;
cin >> pattern;

int pos = pattern.find("*");
pre = pattern.substr(0, pos);
suf = pattern.substr(pos + 1);

for (int i = 0; i < n; i++)
{
cin >> file;
if(pre.size() + suf.size() > file.size())
{
cout << "NE" <<"\n";
}
else
{
if(pre == file.substr(0, pre.size()) && suf == file.substr(file.size() - suf.size()))
{
cout << "DA" << "\n";
}
else
{
cout << "NE" << "\n";
}
}
}

return 0;
}
47 changes: 47 additions & 0 deletions 9996_한국이그리울땐.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <bits/stdc++.h>

using namespace std;

int main()
{
int n;
string pattern;
vector<string> files, answer;

cin >> n;
cin >> pattern;
for(int i = 0; i < n; i++)
{
string s;
cin >> s;
files.push_back(s);
}

char start, end;
start = pattern[0];
end = pattern[pattern.length() - 1];

for(int i = 0; i < n - 1; i++)
{

if(files[i][0] == start && files[i][files[i].length() - 1] == end)
{
cout << "DA\n";
}
else
{
cout << "NE\n";
}
}

if(files[n-1][0] == start && files[n-1][files[n-1].length() - 1] == end)
{
cout << "DA";
}
else
{
cout << "NE";
}

return 0;
}
Loading