Competitive Programming Solutions
415 subscribers
11 files
33 links
Download Telegram
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
COUNTDOWN SOLUTION CODEFORCES


#include <bits/stdc++.h>
using namespace std;
#define ff(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define int long long int
int32_t main() {
w(t) {
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
ff(i, n) {
if (s[i] != '0') {
ans += int32_t(s[i] - int32_t('0'));
if (i != n - 1) ans++;
}
}
cout << ans << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve();
int main()
{
//@cpsolutions
ios_base::sync_with_stdio(false);
cin.tie(NULL);

#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("error.txt", "w", stderr);
freopen("output.txt", "w", stdout);
#endif

ll int t=1;
/*is Single Test case?*/

cin >> t;

// t=1;

//single test case -= Delete if t testCases =-

while (t--) {
solve();
cout << "\n";
}

cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
int z;
cin>>z;
return 0;
}
void solve()
{
ll n;cin>>n;
if(n%4 == 0) cout<<"NO";
else cout<<"YES";
}
Please open Telegram to view this post
VIEW IN TELEGRAM