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
2019-10-11 10:01:30

#include <bits/stdc++.h>
using namespace std;

long long dp[1000045], mod = 1e9 + 7;

int main (){
int j, n, m, w[145];
cin >> n>> m;
for (int i = 1;i <= n;i++)
cin >> w[i];
dp[0] = 1;
for(j = 1; j <= n; j ++){
for(int i = 1; i <= m; i ++){

if( w[j] <= i ) {
dp[i] = (dp[i] + dp[i - w[j]] ) ;
dp[i] -= dp[i] >= mod ? mod : 0;
}
}
}
cout << dp[m];
}
2019-10-09 06:05:14
#include<bits/stdc++.h>
using namespace std;
int main (){
int a, b, c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
return 0;
}

2019-09-28 07:44:57
#include <bits/stdc++.h>
using namespace std;

long long dp[1000045], mod = 1e9 + 7;

int main (){
int j, n, m, w[145];
cin >> n>> m;
for (int i = 1;i <= n;i++)
cin >> w[i];
dp[0] = 1;
for(j = 1; j <= n; j ++){
for(int i = 1; i <= m; i ++){

if( w[j] <= i ) {
dp[i] = (dp[i] + dp[i - w[j]] ) ;
dp[i] -= dp[i] >= mod ? mod : 0;
}
}
}
cout << dp[m];
}
2019-09-27 08:16:11
please4 u do nigga wadddaf]



Last edit: 2019-09-27 08:16:31
2019-09-23 11:21:16
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans=INT_MAX,s=0,a,b,c[123456],sum1,d,e,i,j,n;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cin>>n;
for(i=1;i<=n;i++){
if(i==1){
cout<<0<<endl;continue;
}
if(i==2){
cout<<6<<endl;continue;
}
if(i==3){
cout<<28<<endl;continue;
}
if(i==4){
cout<<96<<endl;continue;
}
a=i*i*(i*i-1);
cout<<(a-8*(i-4)*(i-4)+112-40*i)/2<<endl;
}
}
2019-09-16 06:13:40
95170271 ohidoo zalgaarai
2019-09-11 04:54:43
nadaa hamaagu
2019-07-23 08:32:05
#include<bits/stdc++.h>

using namespace std;

int main () {
int i,n,s,k,p;
char x;
char a[1000];
// freopen("Text hashilt.in","r",stdin);
// freopen("Text hashilt.out","w",stdout);
n=1;
while (scanf("%c",&x)!=EOF) {
a[n]=x;
n++;
}
for(i=1;i<=n;i++) {
if(a[i]=='"'){
if (p==2) {
a[i]='}';
p=1;
}
else {
a[i]='{';
p=2;
}
}
}
for(i=1;i<n;i++) {
cout<<a[i];
}

return 0;

}
2019-07-04 17:23:47
https://sg.acolytefight.io/?party=p32-eda2

Last edit: 2019-07-05 09:32:12
2019-04-06 11:53:50
#include<bits/stdc++.h>
using namespace std;
long long k=1,ans,a[123],b[123],d,e,i,j,n,c;
string s,s1;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cin>>s;
a[0]=0;
b[0]=0;
for(i=0;i<s.size();i++){

if(s[i]=='A'){
a[k]=a[k-1]+1;
b[k]=b[k-1];
}
else{
b[k]=b[k-1]+1;
a[k]=a[k-1];
}
k++;
}
for(i=0;i<=s.size();i++){
for(j=i+1;j<=s.size();j++){
if(a[j]-a[i]==b[j]-b[i]){
ans++;
//cout<<i<<" "<<j<<endl;
}
}
}
cout<<ans;
}
ABAB
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.