Bomb Kirby Running
Cat Life - GT-K
1288번 새로운 불면증 치료법

2023. 4. 16. 22:32SWEA

Problem Solving - Level 2 - 새로운 불면증 치료법

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=2&contestProbId=AV18_yw6I9MCFAZN&categoryId=AV18_yw6I9MCFAZN&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=2&pageSize=10&pageIndex=3

#include <iostream>
using namespace std;
bool arrayCheck(bool *Arr)
{
	for(int i=0;i<10;i++)
    {
            if(Arr[i]==false)
            {
                return false;
            }
    }
    return true;
}

int main()
{
    int T,N;
    cin>>T;    
      
    for(int i=1;i<=T;i++)
    {
        int temp;        
        bool Arr[10]={false,};
        
        cin>>N;
       	temp=N;
        while(true){
        	string str=to_string(temp);
            
            for(int i=0;i<str.length();i++)
            {
                Arr[str.at(i) - '0']=true;
            }
            
            if(arrayCheck(Arr))
            {
            	break;
            }
            
            temp+=N;
        }
        cout<<"#"<<i<<" "<<temp<<"\n";
        
    }
    return 0;
}

'SWEA' 카테고리의 다른 글

1928번 Base64 Decoder  (0) 2023.04.16
1285번 아름이의 돌 던지기  (0) 2023.04.16
1284번 수도 요금 경쟁  (0) 2023.04.16
1204번 최빈수 구하기  (0) 2023.04.16
2072번 홀수만 더하기  (0) 2023.03.23