Algospot : ENCRYPT

Programming/Judge 2014.12.15 20:00

Algospot : ENCRYPT


https://algospot.com/judge/problem/read/ENCRYPT


<결과>



<코드>

#include<iostream>
#include<string>

using namespace std;

int main(void)
{
	int num_cases = 0;
	cin >> num_cases;

	for (int n = 0; n < num_cases; ++n)
	{
		string str;
		cin >> str;

		string left_str, right_str;

		for (int i = 0; i < str.size(); ++i)
		{
			if (i % 2 == 0)
				left_str += str.at(i);
			else
				right_str += str.at(i);
		}
		cout << left_str << right_str << endl;
	}
	return 0;
}


'Programming > Judge' 카테고리의 다른 글

Codeforces Problem 495A : Digital Counter  (0) 2014.12.18
ACMICPC 1157 : 단어 공부  (0) 2014.12.16
ACMICPC 1920 : 수 찾기  (0) 2014.12.16
Algospot : ENCRYPT  (0) 2014.12.15
ACMICPC 1003 : 피보나치 함수  (0) 2014.12.15
ACMICPC 1008 : A/B  (0) 2014.12.15
ACMICPC 1205 : 등수 구하기  (0) 2014.12.13
ACMICPC 1002 : 터렛  (0) 2014.12.12
ACMICPC 1000 : A+B  (0) 2014.12.12
Algospot : LECTURE  (0) 2014.12.12
Algospot : DRAWRECT  (0) 2014.12.11
posted by deviAk

Algospot : LECTURE

Programming/Judge 2014.12.12 19:00


https://algospot.com/judge/problem/read/LECTURE


<결과>


<코드>

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main(void) 
{	
	int num_cases = 0;
	cin >> num_cases;
	
	for (int i = 0; i < num_cases; ++i)
	{
		vector<string> vec_string;
		string in_str, str_result;
		cin >> in_str;

		int half_size = in_str.length() / 2;
		for (int j = 0; j < half_size; ++j) 
		{
			vec_string.push_back(in_str.substr(j * 2, 2));
		}
		
		sort(vec_string.begin(), vec_string.end());

		for (int j = 0; j < vec_string.size(); ++j)
		{
			str_result += vec_string[j];
		}
		
		cout << str_result << endl;
		vec_string.clear();
	}
	return 0;
}


'Programming > Judge' 카테고리의 다른 글

Algospot : ENCRYPT  (0) 2014.12.15
ACMICPC 1003 : 피보나치 함수  (0) 2014.12.15
ACMICPC 1008 : A/B  (0) 2014.12.15
ACMICPC 1205 : 등수 구하기  (0) 2014.12.13
ACMICPC 1002 : 터렛  (0) 2014.12.12
ACMICPC 1000 : A+B  (0) 2014.12.12
Algospot : LECTURE  (0) 2014.12.12
Algospot : DRAWRECT  (0) 2014.12.11
Algospot : ENDIANS  (0) 2014.12.11
Algospot : MERCY  (0) 2014.12.11
Algospot : Hello World!  (0) 2014.12.11
posted by deviAk

Algospot : DRAWRECT

Programming/Judge 2014.12.11 21:17


https://algospot.com/judge/problem/read/DRAWRECT


<결과>



<코드>

#include<iostream>

using namespace std;

int GetDifferent(int a, int b, int c)
{
	return (a == b) ? c : (b == c) ? a : b;
}

int main() {

	int num_cases = 0;
	cin >> num_cases;

	for (int i = 0; i < num_cases; ++i)
	{
		int x[3] = { 0, };
		int y[3] = { 0, };

		for (int j = 0; j < 3; ++j)
		{
			cin >> x[j] >> y[j];
		}

		cout << GetDifferent(x[0], x[1], x[2]) << " " << GetDifferent(y[0], y[1], y[2]) << endl;
	}
}


'Programming > Judge' 카테고리의 다른 글

Algospot : ENCRYPT  (0) 2014.12.15
ACMICPC 1003 : 피보나치 함수  (0) 2014.12.15
ACMICPC 1008 : A/B  (0) 2014.12.15
ACMICPC 1205 : 등수 구하기  (0) 2014.12.13
ACMICPC 1002 : 터렛  (0) 2014.12.12
ACMICPC 1000 : A+B  (0) 2014.12.12
Algospot : LECTURE  (0) 2014.12.12
Algospot : DRAWRECT  (0) 2014.12.11
Algospot : ENDIANS  (0) 2014.12.11
Algospot : MERCY  (0) 2014.12.11
Algospot : Hello World!  (0) 2014.12.11
posted by deviAk

Algospot : ENDIANS

Programming/Judge 2014.12.11 19:50


https://algospot.com/judge/problem/read/ENDIANS


<결과>



<코드>

#include<iostream>
#include<vector>

using namespace std;

int main() {

	int num_edian = 0;
	vector<unsigned int> v;

	cin >> num_edian;

	for (int i = 0; i < num_edian; ++i)
	{
		unsigned int i_temp;
		cin >> i_temp;
		v.push_back(i_temp);
	}

	for (auto i = v.begin(); i != v.end(); ++i)
	{
		unsigned char uc_temp;
		uc_temp = *((unsigned char*)&(*i) + 3);
		*((unsigned char*)&(*i) + 3) = *((unsigned char*)&(*i) + 0);
		*((unsigned char*)&(*i) + 0) = uc_temp;

		uc_temp = *((unsigned char*)&(*i) + 2);
		*((unsigned char*)&(*i) + 2)= *((unsigned char*)&(*i) + 1);
		*((unsigned char*)&(*i) + 1) = uc_temp;

		cout << *i << endl;
	}
}


'Programming > Judge' 카테고리의 다른 글

Algospot : ENCRYPT  (0) 2014.12.15
ACMICPC 1003 : 피보나치 함수  (0) 2014.12.15
ACMICPC 1008 : A/B  (0) 2014.12.15
ACMICPC 1205 : 등수 구하기  (0) 2014.12.13
ACMICPC 1002 : 터렛  (0) 2014.12.12
ACMICPC 1000 : A+B  (0) 2014.12.12
Algospot : LECTURE  (0) 2014.12.12
Algospot : DRAWRECT  (0) 2014.12.11
Algospot : ENDIANS  (0) 2014.12.11
Algospot : MERCY  (0) 2014.12.11
Algospot : Hello World!  (0) 2014.12.11
posted by deviAk

Algospot : MERCY

Programming/Judge 2014.12.11 19:18


https://algospot.com/judge/problem/read/MERCY


<결과>



<코드>

#include<iostream>
#include<string>

using namespace std;

int main() {

	int cases;
	cin >> cases;
	if ((0 < cases) && (cases <= 10))
	{
		while (cases--)
		{
			cout << "Hello Algospot!" << endl;
		}
	}
}


'Programming > Judge' 카테고리의 다른 글

Algospot : ENCRYPT  (0) 2014.12.15
ACMICPC 1003 : 피보나치 함수  (0) 2014.12.15
ACMICPC 1008 : A/B  (0) 2014.12.15
ACMICPC 1205 : 등수 구하기  (0) 2014.12.13
ACMICPC 1002 : 터렛  (0) 2014.12.12
ACMICPC 1000 : A+B  (0) 2014.12.12
Algospot : LECTURE  (0) 2014.12.12
Algospot : DRAWRECT  (0) 2014.12.11
Algospot : ENDIANS  (0) 2014.12.11
Algospot : MERCY  (0) 2014.12.11
Algospot : Hello World!  (0) 2014.12.11
posted by deviAk