문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T;
    int days[12= {312831303130313130313031};
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int a[2], b[2];
        int answer;
        cin >> a[0>> a[1>> b[0>> b[1];
 
        if(a[0== b[0]) {
            answer = b[1- a[1+ 1;
        } else {
            answer = days[a[0]-1- a[1+ 1;
            a[0]++;
            while(a[0!= b[0]) {
                answer += days[a[0]-1];
                a[0]++;
            }
            answer += b[1];
        }
 
        cout << "#" << t_case+1 << " " << answer << "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1945 - 간단한 소인수분해  (0) 2018.04.28
SWEA 1946 - 간단한 압축 풀기  (0) 2018.04.28
SWEA 1954 - 달팽이 숫자  (0) 2018.04.28
SWEA 1959 - 두 개의 숫자열  (0) 2018.04.28
SWEA 1961 - 숫자 배열 회전  (0) 2018.04.28

https://dev-repository.tistory.com/70

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1946 - 간단한 압축 풀기  (0) 2018.04.28
SWEA 1948 - 날짜 계산기  (0) 2018.04.28
SWEA 1959 - 두 개의 숫자열  (0) 2018.04.28
SWEA 1961 - 숫자 배열 회전  (0) 2018.04.28
SWEA 1970 - 쉬운 거스름돈  (0) 2018.04.28

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PpoFaAS4DFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, N, M, sum, max;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        cin >> N >> M;
        int a[N], b[M];
        int *A, *B;
 
        for(int i=0; i<N; i++)
            cin >> a[i];
        for(int i=0; i<M; i++)
            cin >> b[i];
 
        if(N == M) {
            max = 0;
            for(int i=0; i<N; i++)
                max += A[i]*B[i];
        } else {
            if(N <= M) {
                A = a;
                B = b;
            } else {
                A = b;
                B = a;
                int temp = M;
                M = N;
                N = temp;
            }
 
            max = -2147483648;
            for(int i=0; i<=M-N; i++) {
                sum = 0;
                for(int j=i; j<N+i; j++) {
                    sum += A[j-i]*B[j];
                }
                if(max < sum)
                    max = sum;
            }
        }
 
 
 
        cout << "#" << t_case+1 << " " << max << "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1948 - 날짜 계산기  (0) 2018.04.28
SWEA 1954 - 달팽이 숫자  (0) 2018.04.28
SWEA 1961 - 숫자 배열 회전  (0) 2018.04.28
SWEA 1970 - 쉬운 거스름돈  (0) 2018.04.28
SWEA 1974 - 스도쿠 검증  (0) 2018.04.28

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pq-OKAVYDFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int N;
        cin >> N;
        int array[N][N];
        string line[N];
 
        for(int i=0; i<N; i++)
            line[i] = "";
        
        for(int i=0; i<N; i++)
            for(int j=0; j<N; j++)
                cin >> array[i][j];
 
        for(int j=N-1; j>=0; j--) {
            for(int i=N-1; i>=0; i--) {
                line[j] += to_string(array[i][j]);
            }
        }
 
        for(int i=0; i<N; i++)
            line[i] += " ";
 
        for(int i=N-1; i>=0 ; i--) {
            for(int j=N-1; j>=0; j--) {
                line[N-i-1+= to_string(array[i][j]);
            }
        }
 
        for(int i=0; i<N; i++)
            line[i] += " ";
 
        for(int j=N-1; j>=0; j--) {
            for(int i=0; i<N; i++) {
                line[N-j-1+= to_string(array[i][j]);
            }
        }
 
        cout << "#" << t_case+1 << "\n";
 
        for(int i=0; i<N; i++)
            cout << line[i] << "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1954 - 달팽이 숫자  (0) 2018.04.28
SWEA 1959 - 두 개의 숫자열  (0) 2018.04.28
SWEA 1970 - 쉬운 거스름돈  (0) 2018.04.28
SWEA 1974 - 스도쿠 검증  (0) 2018.04.28
SWEA 1976 - 시각 덧셈  (0) 2018.04.27

문제 링크 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PsIl6AXIDFAUq


문제의 저작권은 SW Expert Academy에 있습니다.



#include <iostream>
 
using namespace std;
 
int main(void) {
    int T, cnt;
    cin >> T;
 
    for(int t_case=0; t_case<T; t_case++) {
        int money;
        cin >> money;
        cout << "#" << t_case+1 << "\n";
 
        cout << money/50000 << " ";
        money = money%50000;
        cout << money/10000 << " ";
        money = money%10000;
        cout << money/5000 << " ";
        money = money%5000;
        cout << money/1000 << " ";
        money = money%1000;
        cout << money/500 << " ";
        money = money%500;
        cout << money/100 << " ";
        money = money%100;
        cout << money/50 << " ";
        money = money%50;
        cout << money/10 << "\n";
    }
 
    return 0;
}
cs

'C & C++ > SW Expert Academy' 카테고리의 다른 글

SWEA 1959 - 두 개의 숫자열  (0) 2018.04.28
SWEA 1961 - 숫자 배열 회전  (0) 2018.04.28
SWEA 1974 - 스도쿠 검증  (0) 2018.04.28
SWEA 1976 - 시각 덧셈  (0) 2018.04.27
SWEA 1545 - 거꾸로 출력해 보아요  (0) 2018.04.27

+ Recent posts