Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7002 - Гурвалжин

Өгөгдсөн гурвалжны периметрийг ол.

Input

Гурвалжны талууд бүхэл тоогоор нэг мөрөнд зайгаар тусгаарлагдан өгөгдөнө.

Output

Гурвалжны периметр.

Example

Input:
3 4 5

Output:
12


Нэмсэн:Bataa
Огноо:2011-01-15
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-03-28 03:25:33
ttfgyh

Last edit: 2024-03-28 03:40:50
2024-03-28 03:25:25
A

Last edit: 2024-03-28 03:40:35
2024-03-28 03:25:11
A

Last edit: 2024-03-28 03:40:42
2024-03-21 02:47:08
A

Last edit: 2024-03-28 03:44:35
2024-03-20 02:57:53
#include<iostream>
using namespace std;
string solve(string s){
string s1;
int k = 0;
for(int i = 0; i < s.size() -1; i++){
if(s[i] == s[i + 1]){
k++;
}
else{
if(k == 0) s1 += s[i];
k = 0;
}
}
if(k == 0) s1 += s[s.size() - 1];
return s1;
}
int main(){
string s, str[1000];
int index = 0;
cin>>s;
int l = 1;
s = solve(s);
str[index] = s;
while(l == 1){
index++;
s = solve(s);
str[index] = s;
for(int i = 0; i < index - 1; i++)
if(str[index - 1] == str[i]) l = 0;
}
cout << s;
}
2024-03-20 02:30:57
#include <iostream>
using namespace std;
int nemeh(int n[] ,int s){
cout<<"too oruulna uu"<<endl;
cin>>n[s];
return n[s];
}
int hasah(int n[], int s){
cout<<"top too hasagdlaa"<<endl;
n[s]=-10;
return n[s];
}
void hevleh(int n[], int s){
cout<<"Tanii buteesn matrix:"<<endl;
for(int i=0; i<s; i++)
cout<<n[i]<<" ";
}
int main() {
int k[100000];
int b=100, p=0;
while (b!=3){
cout<<"too oruulah bol 1 hasah bol 2 matrixiig hevleh bol 3 gj ilgeene uu"<<endl;
cin>>b;
if(b==1){
nemeh(k, p);
p++;
}
if(b==2){
hasah(k, p);
p--;
}
if(b==3){
hevleh(k, p);
}
}
return 0;
}
2024-03-20 02:02:06
#include <stack>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define MAX 10
string bush(char x){
string ci;
return ci;
}
void zurag(int too, int mx){
for(int j = mx;j >= 1;j--){
if(j<=too){
cout <<'|';
for(int i =5;i>=1;i--){
cout <<"-";
}
cout <<'|'<<endl;
}
else{
cout <<'|';
for(int i =5;i>=1;i--){
cout <<" ";
}
cout <<'|'<<endl;
}
}
for(int i=7;i>=1;i--){
cout <<'_';
}

}

int main() {
int size, s= 0;
stack <string> chips;
char key ,def;
cout <<" hemjee: ";
cin >> size;
while(cin >> key)
switch(key){
case '1':
if(s == 0){
s++;
}
cin >> def;
chips.push(bush(def));
break;
case '2':
cout << chips.size()<<endl;
break;
case '3':
cout << size - chips.size()<<endl;
break;
case '4':
cout << chips.top()<<endl;
break;
case '5':
zurag(chips.size(),size);
break;
case '6':
chips.pop();
break;
default:
cout <<"Error";
}

}
2024-03-19 04:55:54
yr ni bl amidrl gyshde amdrh ghr sahntrd shantrh gher hetsu hetsu gj bdhr hetsu bdg hetsu gj bdhgu bvl yr nil gy shde hahahahahahahahahahahahahahahahahahahah yuc yrcu hahahhahahahaahahhhahhahaahahhhahahahhahahaehahaahhaeaeh
2024-03-14 01:15:03
you're getting touched tonight.
2024-03-13 03:29:05
#include <stack>
#include <iostream>
#include <vector>
#include <algorithm>
#include <vector>

using namespace std;

#define MAX 10
string bush(char x){
string ci;
if(x == 'l') ci = "Lays";
if(x == 'd') ci = "Doritos";
if(x == 't') ci = "Takes";
if(x == 'k') ci = "khan_chips";
return ci;
}
void zurag(int too, int mx){
for(int j = mx;j >= 1;j--){
if(j<=too){
cout <<'#';
for(int i =5;i>=1;i--){
cout <<"*";
}
cout <<'#'<<endl;
}
else{
cout <<'#';
for(int i =5;i>=1;i--){
cout <<" ";
}
cout <<'#'<<endl;
}
}
for(int i=7;i>=1;i--){
cout <<'=';
}

}

int main() {
int size, s= 0;
stack <string> chips;
char key ,def;
cout <<" chipsnii hemjee : ";
cin >> size;

cout <<" chips nemeh bol '1'"<<endl;
cout <<" chips hemjee shalgah bol '2'"<<endl;
cout <<" chips dhd hediig nemhiig shalgah bol '3'"<<endl;
cout <<" suulin chips ymr gedgig shalgah bol '4'"<<endl;
cout <<" zurgar harah bol '5'"<<endl;
cout <<" delete hiih bol '6'"<<endl;
while(cin >> key)
switch(key){
case '1':
if(s == 0){
cout <<"//////////////////////////////////////"<<endl;
cout <<"l : Lays"<<endl;
cout <<"d : Doritos"<<endl;
cout <<"t : Takes" <<endl;
cout <<"k : khan_chips"<<endl;
cout <<"//////////////////////////////////////"<<endl;
s++;
}
cout <<"chips avhiig huleej bna :"<<endl;
cin >> def;
chips.push(bush(def));
break;
case '2':
cout << chips.size()<<endl;
break;
case '3':
cout << size - chips.size()<<endl;
break;
case '4':
cout << chips.top()<<endl;
break;
case '5':
zurag(chips.size(),size);
break;
case '6':
chips.pop();
break;
default:
cout <<"Error";
}

}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.