0% found this document useful (0 votes)
4 views

cses

Uploaded by

sunny950775
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

cses

Uploaded by

sunny950775
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

/*#include <bits/stdc++.

h>
using namespace std;
int main() {
long long n; cin >> n;
long long sum = 0;
for(long long i=0; i<n-1; i++){
long long x; cin >> x;
sum += x;
}
long long total = (n*(n+1))/2;
cout <<total - sum <<endl;

return 0;
}

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

int main() {
int n;
cin >> n;
vector<int> A(n);

for (int i = 0; i < n; i++) {


cin >> A[i];
}

long long moves = 0;

for (int i = 1; i < n; i++) {


if (A[i] < A[i - 1]) {
moves += A[i - 1] - A[i];
A[i] = A[i - 1]; // Update current element
}
}

cout << moves << endl;

return 0;
}

#include <iostream>
using namespace std;

int main() {
int t;
cin >> t;

while(t--) {
long long y, x;
cin >> y >> x;
long long n = max(y, x);
long long maxNum = n * n;

// Determine the number based on odd/even layers


if (n % 2 == 0) {
// Even layer
if (x == n) {
// Rightmost column
cout << maxNum - (y - 1) << endl;
} else {
// Bottom row
cout << maxNum - (n - 1) + (x - n) << endl;
}
} else {
// Odd layer
if (y == n) {
// Bottom row
cout << maxNum - (x - 1) << endl;
} else {
// Leftmost column
cout << maxNum - (n - 1) + (y - n) << endl;
}
}
}

return 0;
}

#include<iostream>

using namespace std;

int main(void)
{
long long t;cin>>t;

while (t--)
{
long long x, y;
cin >> y >> x;

long long maxi = max(x,y);


long long square = (maxi - 1) * (maxi - 1);
if (maxi % 2 == 0)
{
if (x > y)
{
cout << square + y << endl;
}
else
{
cout << (maxi * maxi) - x + 1 << endl;
}
}
else
{
if (x > y)
{
cout << (maxi * maxi) - y + 1 << endl;
}
else
{
cout << square + x << endl;
}
}
}
return (0);
}

*/

#include <iostream>
using namespace std;

int main()
{
int N;
cin >> N;
int ans = 0;
while(N > 0){
N/=5; ans += N;
}
cout << ans << "\n";
return 0;
}

**************************
*
29453 *
*
*
**************************

sustainable cities and communities - Building sustainable cities : best practices


and innovations give me points to speak this topic have a group discussion

You might also like