Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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
|
||||||||||||||
2023-01-07 07:16:04
#include<bits/stdc++.h> using namespace std; int main () { //freopen ("input.txt","r",stdin); //freopen ("output.txt","w",stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); long long n, m, t, i, r, X, Y, x, j,z, y, s, ans, p; //cin >> t; cin >> n >> m; long long Sum[1002][1002] = {0}; ans = 0; for ( i = 1; i <= n; i ++) { for ( j = 1; j <= m; j++) { cin >> x; Sum[i][j] = Sum[i - 1][j] + Sum[i][j - 1] - Sum[i - 1][j - 1]; Sum[i][j] += x; } } cin >> t; while ( t --) { cin >> x >>y >> X >> Y; s = Sum[X][Y] - Sum[x - 1][Y] - Sum[X][y - 1] + Sum[x - 1][y - 1]; cout << s << "\n"; } } |
||||||||||||||
2022-12-24 16:02:12
#include <iostream> using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; cout << a + b + c; } Huul2 |
||||||||||||||
2022-12-09 07:23:26
#include<stdio.h> int main(){ int n,a,b; scanf("%d",&n); a=100; b=a*n; printf("%d",b); return 0; } |
||||||||||||||
2022-12-07 03:34:28
#include<iostream> using namespace std; int main(){ int a,b,c,d,e; cin>>a>>b; c=(a*b)/2; cout<<c<<endl; } |
||||||||||||||
2022-12-07 03:32:51
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,i; cin>>a>>b>>c>>d; if((a+b)%2==(c+d)%2) cout<<"YES"<<endl; else cout<<"NO"<<endl; } |
||||||||||||||
2022-12-07 03:32:18
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; scanf("%d%d%d%d",&a, &b, &c, &d); if ((a+b)%2==0 ^ (c+d)%2!=0) printf("YES"); else printf("NO"); } |
||||||||||||||
2022-12-07 03:31:16
#include<iostream> using namespace std; int main(){ int a,b,c,d,e; cin>>a>>b; c=(a*b)/2; cout<<c<<endl; } |
||||||||||||||
2022-12-07 03:30:16
#include<bits/stdc++.h> using namespace std; int main (){ long a,b,c,d; scanf("%d%d%d%d",&a, &b, &c, &d); if ((a+b)%2==0 ^ (c+d)%2!=0) printf("YES"); else printf("NO"); } |
||||||||||||||
2022-12-07 03:28:53
#include<bits/stdc++.h> using namespace std; int main (){ int r1,s,r2; cin>>r1>>s; r2=(s*2)-r1; cout<<r2<<endl; } |
||||||||||||||
2022-12-07 03:22:45
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b; c=2*b-a; cout<<c<<endl; } |