Skip to content

Commit

Permalink
BOJ-EX: 5/17/2024, 2:57:02 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
fkdl0048 committed May 17, 2024
1 parent b34b7c6 commit 9ba0b9a
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "C:/mingw64/bin/g++.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
149 changes: 149 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"version": "2.0.0",
"runner": "terminal",
"type": "shell",
"echoCommand": true,
"presentation": {
"reveal": "always"
},
"tasks": [
{
"label": "save and compile for C++",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "save and compile for C",
"command": "gcc",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"group": "build",
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "execute",
"command": "cmd",
"group": {
"kind": "test",
"isDefault": true
},
"args": [
"/C",
"${fileDirname}\\${fileBasenameNoExtension}"
],
"problemMatcher": []
},
{
"type": "cppbuild",
"label": "C/C++: gcc.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "디버거에서 생성된 작업입니다."
},
{
"type": "cppbuild",
"label": "C/C++: g++.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "디버거에서 생성된 작업입니다."
},
{
"type": "cppbuild",
"label": "C/C++: gcc.exe 활성 파일 빌드",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "컴파일러: C:\\MinGW\\bin\\gcc.exe"
},
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "C:\\mingw64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "Task generated by Debugger."
}
]
}
25 changes: 21 additions & 4 deletions 10808번: 알파벳 개수/알파벳 개수.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,33 @@
#include <bits/stdc++.h>
using namespace std;

// int main(){
// map<char, int> a;
// string s;
// cin >> s;

// for (int i = 0; i < s.length(); i++)
// {
// a[s[i]]++;
// }

// for (char i = 'a'; i <= 'z'; i++)
// {
// cout << a[i] << ' ';
// }
// }

int cnt[26];
int main(){
string s;
cin >> s;
vector<int> v(26);
for (char c : s)
for (int i= 0; i < s.length(); i++)
{
v[c - 'a']++;
cnt[s[i] - 'a']++;
}

for (int i = 0; i < 26; i++)
{
cout << v[i] << ' ';
cout << cnt[i] << ' ';
}
}
Binary file added 10808번: 알파벳 개수/알파벳 개수.exe
Binary file not shown.
4 changes: 3 additions & 1 deletion 2024/CodingTest/SummaryNote.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@

누적합에 관한 내용, 배열을 써서 쉽게 품.

### 1-A
### 개수를 세는 문제

대부분의 개수를 세는 문제는 배열이나 맵을 사용하여 풀 수 있다.

0 comments on commit 9ba0b9a

Please sign in to comment.