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
36 changes: 36 additions & 0 deletions 11월16일/초중급/1116_2246.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int solution(int n, vector<pair<int, int>> &condo_loc, vector<pair<int, int>> &condo_cost){
int cnt=0;

for(int i=0; i<n ; i++){
int x = condo_loc[i].second;
int x_loc = condo_loc[i].first;
int x_cost =
}

return cnt;
}

int main(){
//입력
int n;
cin >> n;
vector<pair<int, int>> condo_loc; //거리
vector<pair<int, int>> condo_cost; //가격
for(int i=0 ; i<n ; i++){
condo_loc[i].second = i;
condo_cost[i].second = i;
cin >> condo_loc[i].first>> condo_cost[i].first;
}

sort(condo_loc.begin(), condo_loc.end());
sort(condo_cost.begin(), condo_cost.end());
cout << solution(n , condo_loc, condo_cost);

return 0;
}
34 changes: 34 additions & 0 deletions 11월16일/초중급/1116_4436.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <iostream>
#include <vector>

using namespace std;

int solution(int n){
vector<int> num(10,1);
int k=1;
long long arr=0;
while(true){
arr += n;
long long temp = arr;
while(temp != 0){
long long temp2 = arr%10;
if(num[temp2]==1) num.erase(num.begin()+temp2);
temp /= 10;
}
if(num.empty()) break;
k++;
}
return k;
}

int main(){

while(true){
int n;
cin >> n;
if (cin.eof()) break;
cout << solution(n)<<'\n';
}

return 0;
}