본문 바로가기
백준 문제 해설

백준 18398 HOMWRK

by toomanysegtrees 2022. 11. 16.

뭐랄까 풀기 싫다고나 할까

https://www.acmicpc.net/problem/18398

 

18398번: HOMWRK

In one of the beautiful cities of Afghanistan two sisters are going to program a simple game to help them solve their mathematics homework. Their homework asks them to calculate the sum and multiplication of two numbers. Your task is to help them to build

www.acmicpc.net

풀이

합과 곱을 출력해주면 되는 문제이다.

 

시간 복잡도 : $O(N*T)$

아쉬운 점 : 없다

전체적인 감상 : 없다.

/* basic setup {{{ */
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define compress(x) sort(all(x)), x.erase(unique(all(x)), x.end())
#define fast_io ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef const int ci;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
/*}}}*/

int main(){
	fast_io;
	int t;
	cin>>t;
	while(t--){
		int n, a, b;
		cin>>n;
		while(n--){
			cin>>a>>b;
			cout<<a+b<<' '<<a*b<<'\n';
		}
	}
}

'백준 문제 해설' 카테고리의 다른 글

백준 4354 문자열 제곱  (2) 2022.11.20
백준 25591 푸앙이와 종윤이  (0) 2022.11.19
백준 25703 포인터 공부  (0) 2022.11.18
백준 8558 Silnia  (0) 2022.11.17
백준 13623 Zero or One  (0) 2022.11.15
백준 24860 Counting Antibodies  (0) 2022.11.14
백준 4714 Lunacy  (0) 2022.11.13
백준 16099 Large Sport Facility  (0) 2022.11.12