buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
N = str(input()) lists = [int(x) for x in N] if a % 9 == 0: print('Yes') else: print('No')
N = str(input()) lists = [int(x) for x in N] a = sum(lists) if a % 9 == 0: print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
41
#include <iostream> using namespace std; int main() { long long n, sum = 0, i, temp; string s; cin >> s; int k = s.length(); for (i = 0; i < k; i++) { n = s[i] - '0'; temp = n % 10; sum = sum + temp; } if (sum % 9 == 0) cout << "YES\n"; else cout << "NO\n"; return 0; }
#include <iostream> using namespace std; int main() { long long n, sum = 0, i, temp; string s; cin >> s; int k = s.length(); for (i = 0; i < k; i++) { n = s[i] - '0'; temp = n % 10; sum = sum + temp; } if (sum % 9 == 0) cout << "Yes\n"; else cout << "No\n"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
104
n==int(input()) a==int(n%9) if a==0: print("Yes") else: print("No")
n=int(input()) a=int(n%9) if a==0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]]
5
35
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.ti...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.ti...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
100
#include <iostream> using namespace std; int main() { char temp; int sum = 0; while (cin >> temp) sum += temp - '0'; if (!(sum % 9) && sum != 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <iostream> using namespace std; int main() { char temp; int sum = 0; while (cin >> temp) sum += temp - '0'; if (!(sum % 9)) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
67
/*Author : Harsh AKA Codula*/ #include <iostream> using namespace std; #define ll long long #define inp freopen("input.txt", "r", stdin) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) // ...
/*Author : Harsh AKA Codula*/ #include <iostream> using namespace std; #define ll long long #define inp freopen("input.txt", "r", stdin) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) // ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
127
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { string n; cin >> n; int sum = 0, a; for (int i = 0; i < n.size(); i++) { char c = n[i]; a = (int)c - 48; sum += a; } // cout<<sum<<endl; if (sum % 9 == 0) { cout << "YES" << endl; } else { cout << ...
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { string n; cin >> n; int sum = 0, a; for (int i = 0; i < n.size(); i++) { char c = n[i]; a = (int)c - 48; sum += a; } // cout<<sum<<endl; if (sum % 9 == 0) { cout << "Yes" << endl; } else { cout << ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
100
strList = list(input()) intList = [int(s) for s in strList] if sum(intList)%9 == 0: print(Yes) else: print(No)
strList = list(input()) intList = [int(s) for s in strList] if sum(intList)%9 == 0: print("Yes") else: print("No")
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
40
from functools import reduce N = reduce(lambda x,y:int(x)+int(y), "0"+input()) if not N%9: print("Yes") else: print("False")
from functools import reduce N = reduce(lambda x,y:int(x)+int(y), "0"+input()) if not N%9: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
51
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define maxn 1000010 #define maxm 1000010 #define ls x << 1 #define rs x << 1 | 1 #define inf 10000000000 #define inc(i) (++(i)) #define dec(i) (--(i)) #define mid ((l + r) >> 1) #define int long long #defin...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define maxn 1000010 #define maxm 1000010 #define ls x << 1 #define rs x << 1 | 1 #define inf 10000000000 #define inc(i) (++(i)) #define dec(i) (--(i)) #define mid ((l + r) >> 1) #define int long long #defin...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47]]
1
324
n=input() n=str(n) Sum=0 for i in range(len(n)): Sum=Sum+int(n[i]) if Sum%9==0: print("yes") else: print("no")
n=input() n=str(n) Sum=0 for i in range(len(n)): Sum=Sum+int(n[i]) if Sum%9==0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
57
#include <bits/stdc++.h> #define endl "\n" #define ff first #define ss second #define PB push_back #define MP make_pair #define ll long long #define llu unsigned long long #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(X) ((X) < 0 ? -(X) : (X)) #define LCM(X, Y) (((X...
#include <bits/stdc++.h> #define endl "\n" #define ff first #define ss second #define PB push_back #define MP make_pair #define ll long long #define llu unsigned long long #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(X) ((X) < 0 ? -(X) : (X)) #define LCM(X, Y) (((X...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
371
// Starting with the name of Allah #include <bits/stdc++.h> #define ll long long #define nl endl #define Nayon \ ios::sync_with_stdio(0); \ cin.tie(0); ...
// Starting with the name of Allah #include <bits/stdc++.h> #define ll long long #define nl endl #define Nayon \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
163
#include <bits/stdc++.h> using namespace std; int main() { long long int sum = 0; string s; cin >> s; for (int i = 0; i < s.size(); i++) { sum = sum + (s[i] - '0'); } if (sum % 9 == 0) cout << "YES"; else cout << "NO"; }
#include <bits/stdc++.h> using namespace std; int main() { long long int sum = 0; string s; cin >> s; for (int i = 0; i < s.size(); i++) { sum = sum + (s[i] - '0'); } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
82
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, t, y, i; string s; cin >> s; n = s.length(); y = 0; for (i = 0; i < n; i++) { y = y + s[i] - '0'; } if (y % 9 == 0) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, x, t, y, i; string s; cin >> s; n = s.length(); y = 0; for (i = 0; i < n; i++) { y = y + s[i] - '0'; } if (y % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
95
N=str(input()) List=[int(N[i]) for i in range(len(N))] if sum(List)%9==0: print("YES") else: print("NO")
N=str(input()) List=[int(N[i]) for i in range(len(N))] if sum(List)%9==0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
53
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string N; cin >> N; int sum = 0, count = N.size(); for (int i = 0; i < count; i++) { sum += N[count - i - 1]; } if (sum % 9 == 0) cout << "Yes" << endl; else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string N; cin >> N; int sum = 0, count = N.size(); for (int i = 0; i < count; i++) { sum = sum + N[count - i - 1] - 48; } if (sum % 9 == 0) cout << "Yes" << endl; else { cout << "No" << endl; } return 0; }
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
92
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; int sum = 0; for (int i = 0; i < s.length(); i++) { sum = sum + s[i] - 48; } if (sum % 9 == 0) cout << "yes"; else { cout << "No"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; int sum = 0; for (int i = 0; i < s.length(); i++) { sum = sum + s[i] - 48; } if (sum % 9 == 0) cout << "Yes"; else { cout << "No"; } return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
95
// C++ program to find if a number is divisible by // 9 or not #include <bits/stdc++.h> using namespace std; // Function to find that number divisible by 9 or not int check(string str) { // Compute sum of digits int n = str.length(); int digitSum = 0; for (int i = 0; i < n; i++) digitSum += (str[i] - '0');...
// C++ program to find if a number is divisible by // 9 or not #include <bits/stdc++.h> using namespace std; // Function to find that number divisible by 9 or not int check(string str) { // Compute sum of digits int n = str.length(); int digitSum = 0; for (int i = 0; i < n; i++) digitSum += (str[i] - '0');...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
103
#include <bits/stdc++.h> using namespace std; int main() { string n; int sum = 0; cin >> n; for (int i = 0; i < n.size(); i++) { sum += int(n.at(i)); } if (sum % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string n; int sum = 0; cin >> n; for (int i = 0; i < int(n.size()); i++) { sum += int(n.at(i) - '0'); } if (sum % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["+", 8, 9, 0, 7, 15, 16, 12, 2, 63, 40], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 2, 3, 4, 0, 16, 12, 103, 0, 104], ["+", 12, 2, 3, 4, 0, 16, 12, 103, 0, 125]]
1
85
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int sum = 0; string in; cin >> in; for (int i = 0; i < (int)in.length(); i++) { sum += in[0] - '0'; } if ((sum % 9) != 0) { cout << "No" << endl; } else { cout << "Yes" << endl; } }
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { int sum = 0; string in; cin >> in; for (int i = 0; i < (int)in.length(); i++) { sum += in[i] - '0'; } // cout << sum << endl; // cout << sum%9 << endl; if ((sum % 9) != 0) { cout << "No" << endl; } el...
[["-", 0, 11, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22]]
1
93
#include <bits/stdc++.h> #define ll long long using namespace std; // 3 // 4 // 1 2 // 2 3 // 3 4 // 2 // 2 2 // 4 // 3 4 // 1 3 // 3 2 // 2 // 3 2 // 7 // 6 1 // 2 3 // 4 6 // 7 3 // 5 1 // 3 6 // 4 // 7 5 13 3 // 20 12 6 int main() { string s; cin >> s; ll z = 0; for (ll p = 0; p < s.length(); p++) { z +=...
#include <bits/stdc++.h> #define ll long long using namespace std; // 3 // 4 // 1 2 // 2 3 // 3 4 // 2 // 2 2 // 4 // 3 4 // 1 3 // 3 2 // 2 // 3 2 // 7 // 6 1 // 2 3 // 4 6 // 7 3 // 5 1 // 3 6 // 4 // 7 5 13 3 // 20 12 6 int main() { string s; cin >> s; ll z = 0; for (ll p = 0; p < s.length(); p++) { z +=...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
104
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define fo(i, n) for (ll i = 0; i < n; i++) void solve() { string s; cin >> s; ll ans = 0; fo(i, s.length()) ans += (ll)(s[i] - '0'); if (ans % 9 == 0) cout << "YES"; else cout << "NO"; } int main() { ios_base::sync_with_std...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define fo(i, n) for (ll i = 0; i < n; i++) void solve() { string s; cin >> s; ll ans = 0; fo(i, s.length()) ans += (ll)(s[i] - '0'); if (ans % 9 == 0) cout << "Yes"; else cout << "No"; } int main() { ios_base::sync_with_std...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
132
N = input() sum_of_digits = 0 for digit in str(N): sum_of_digits += int(digit) if sum_of_digits % 9 == 0: print("yes") else: print("No")
N = input() sum_of_digits = 0 for digit in str(N): sum_of_digits += int(digit) if sum_of_digits % 9 == 0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
43
n = input() s = str(n) l = len(s) ans = 0 for i in range(l+1): ans += int(s[-i]) p = ans-(int(s[-l])) if p%9 == 0: print("Yes") exit()
n = input() s = str(n) l = len(s) ans = 0 for i in range(l+1): ans += int(s[-i]) p = ans-(int(s[-l])) if p%9 == 0: print("Yes") exit() print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
70
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define loop(i,...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define loop(i,...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
194
#include <bits/stdc++.h> using namespace std; int ctoi(char c) { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; cas...
#include <bits/stdc++.h> using namespace std; int ctoi(char c) { switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; cas...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
189
#include <bits/stdc++.h> #define ull unsigned long long #define charToInt(c) (c - '0') using namespace std; int main() { string s; cin >> s; ull int sum = 0; for (int i = 0; i < s.length(); i++) { sum += charToInt(s[i]); } if (sum % 9 == 0) cout << "Yes"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> #define ull unsigned long long #define charToInt(c) (c - '0') using namespace std; int main() { string s; cin >> s; ull int sum = 0; for (int i = 0; i < s.length(); i++) { sum += charToInt(s[i]); } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
88
#include <iostream> #include <string> int main() { std::string str; std::cin >> str; long long sum = 0; for (char c : str) { sum += c - int('0'); } std::cout << (sum % 9 == 0 ? "YES\n" : "NO\n"); }
#include <iostream> #include <string> int main() { std::string str; std::cin >> str; long long sum = 0; for (char c : str) { sum += c - int('0'); } std::cout << (sum % 9 == 0 ? "Yes\n" : "No\n"); }
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
69
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef vector<ll> vll; typedef vector<char> vc; typedef ve...
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef vector<ll> vll; typedef vector<char> vc; typedef ve...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22]]
1
371
N = int(input()) S = [int(i) for i in str(N)] L = len(S) sum = 0 i = 0 while i < L: sum = sum + int(i) i = i + 1 if (sum % 9) == 0: print("Yes") else: print("No")
N = int(input()) S = [int(i) for i in str(N)] L = len(S) sum = 0 i = 0 while i < L: sum = sum + int(S[i]) i = i + 1 if (sum % 9) == 0: print("Yes") else: print("No")
[["+", 12, 657, 12, 652, 3, 4, 0, 206, 51, 22], ["+", 12, 657, 12, 652, 3, 4, 0, 206, 0, 70], ["+", 12, 657, 12, 652, 3, 4, 0, 206, 0, 73]]
5
76
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); string num; cin >> num; ll sum = 0; ll len = num.length(); for (ll i = 0; i < len; i++) { sum = ((sum * 10) + (num[i] - '0')) % 9; } if (sum == 0) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); string num; cin >> num; ll sum = 0; ll len = num.length(); for (ll i = 0; i < len; i++) { sum = ((sum * 10) + (num[i] - '0')) % 9; } if (sum == 0) ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
121
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int sum = 0; int len = s.length(); for (int i = 0; i < len; i++) { sum += s[i] - 48; } if (sum % 9 == 0) cout << "YES" << endl; else { cout << "NO" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int sum = 0; int len = s.length(); for (int i = 0; i < len; i++) { sum += s[i] - 48; } if (sum % 9 == 0) cout << "Yes" << endl; else { cout << "No" << endl; } return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
88
#include <bits/stdc++.h> using namespace std; #define ld long double #define pb push_back #define mp make_pair #define fi(i, start, end) for (int i = start; i < end; ++i) #define Fastio \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ld long double #define pb push_back #define mp make_pair #define fi(i, start, end) for (int i = start; i < end; ++i) #define Fastio \ ios_base::sync_with_stdio(false); ...
[["-", 0, 16, 12, 23, 0, 16, 31, 69, 28, 22], ["-", 12, 23, 0, 16, 31, 69, 341, 342, 0, 70], ["-", 12, 23, 0, 16, 31, 69, 341, 342, 0, 73]]
1
102
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long int sum = 0; for (int i = 0; i < s.size(); i++) { int x = (int)(s[i] - '0'); sum += x; } if (sum % 9 == 0) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long int sum = 0; for (int i = 0; i < s.size(); i++) { int x = (int)(s[i] - '0'); sum += x; } if (sum % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
95
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9 + 100; int main() { ios::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; int res = 0; for (auto it : s) { res += it - '0'; } if (res % 9 == 0 && res != 0) { cout << "Yes\n"; } else { cout ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 1e9 + 100; int main() { ios::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; int res = 0; for (auto it : s) { res += it - '0'; } if (res % 9 == 0) { cout << "Yes\n"; } else { cout << "No\n"; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
103
#include <bits/stdc++.h> using namespace std; int main() { char s[200000]; cin >> s; int sum = 0, i = 0; while (s[i]) { sum = sum + s[i]; i++; if (sum % 9 == 0) sum = 0; } if (sum % 9 == 0) cout << "Yes\n"; else cout << "No\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s[200000]; cin >> s; int sum = 0, i = 0; while (s[i]) { sum = sum + (int)s[i] - 48; i++; if (sum % 9 == 0) sum = 0; } if (sum % 9 == 0) cout << "Yes\n"; else cout << "No\n"; return 0; }
[["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 24], ["+", 12, 16, 31, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
90
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define hetu \ int t; \ cin >> t; \ whi...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define hetu \ int t; \ cin >> t; \ whi...
[["+", 0, 7, 8, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 8, 1, 0, 11, 12, 23, 0, 16, 12, 13], ["+", 0, 7, 8, 1, 0, 11, 12, 23, 0, 25]]
1
112
line = gets.split('') line = line.map { |x| x.to_i } S = line.sum if S % 9 == 0 p "Yes" else p "No" end
line = gets.split('') line = line.map { |x| x.to_i } S = line.sum if S % 9 == 0 puts "Yes" else puts "No" end
[["-", 0, 493, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 0, 493, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 0, 493, 0, 121, 75, 95, 0, 652, 735, 22], ["+", 0, 493, 0, 121, 75, 95, 0, 652, 735, 22]]
4
43
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { string N; cin >> N; int M = N.size(); int ans = 0; int X; rep(i, M) { X = (N.at(i) - 3) ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { string N; cin >> N; int M = N.size(); int ans = 0; int X; rep(i, M) { X = (N.at(i) - 3) ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
122
N=int(input()) if N//9==0: print('Yes') else: print('No')
N=int(input()) if N%9==0: print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109]]
5
29
import itertools N = input() asdf = 0 for idx in range(len(N)): asdf += int(N[idx]) if( asdf > 0 and asdf % 9 == 0 ): print('Yes') else: print('No')
N = input() asdf = 0 for idx in range(len(N)): asdf += int(N[idx]) if( asdf % 9 == 0): print('Yes') else: print('No')
[["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 0, 57, 15, 23, 0, 679, 31, 666, 0, 22], ["-", 0, 57, 15, 23, 0, 679, 31, 666, 667, 47], ["-", 0, 57, 15, 23, 0, 679, 31, 666, 0, 612], ["-", 0, 656, 0, 57, 15, 23, 0, 679, 17, 355]]
5
57
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; int l = N.size(); int c = 0; for (int i = 0; i < l; i++) { c += N.at(i); if (c > 1000) c = c % 9; } c = c % 9; if (c == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; int l = N.size(); int c = 0; for (int i = 0; i < l; i++) { c += N.at(i) - '0'; if (c > 1000) c = c % 9; } c = c % 9; if (c == 0) cout << "Yes" << endl; else cout << "No" << endl; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
99
#include <bits/stdc++.h> using namespace std; #define int long unsigned int int32_t main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.length(); i++) { sum += s[i] - 48; } // cout<<sum; if (sum % 9 == 0) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; #define int long unsigned int int32_t main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.length(); i++) { sum += s[i] - 48; } // cout<<sum; if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
81
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define repA(i, a, n) for (int i = a; i <= (n); ++i) #define repD(i, a, n) for (int i = a; i >= (n); --i) #define trav(a, x) for (auto &a : x) #define fix(a) \ ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define repA(i, a, n) for (int i = a; i <= (n); ++i) #define repD(i, a, n) for (int i = a; i >= (n); --i) #define trav(a, x) for (auto &a : x) #define fix(a) \ ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
193
///----> bismillahir rahmanir rahim <---- -- { ^ _ ^ } /// { ^_^ } { ^ _ ^ } #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; /// VECTOR<VECTOR<INT>NAME>NAME 2 typedef vector<vl> vvl; /// LONG LONG typedef pair<int, int> p...
///----> bismillahir rahmanir rahim <---- -- { ^ _ ^ } /// { ^_^ } { ^ _ ^ } #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; /// VECTOR<VECTOR<INT>NAME>NAME 2 typedef vector<vl> vvl; /// LONG LONG typedef pair<int, int> p...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 9, 0, 7, 10, 43, 39, 78], ["+", 0, 9, 0, 7, 10, 43, 39, 86, 0, 87], ["+", 0, 9, 0, 7, 10, 43, 39, 86, 39, 40]]
1
387
n = input() list_n = list(n) list_n = [int(s) for s in list_n] sum_list = 0 for i in list_n: sum_list += list_n[i] if sum_list%9 ==0: print('Yes') else: print('No')
n = input() list_n = list(n) list_n = [int(s) for s in list_n] sum_list = 0 for i in range(len(list_n)): sum_list += list_n[i] if sum_list%9 ==0: print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]]
5
58
#include <bits/stdc++.h> using namespace std; int main() { long long a = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { a += s[i] - 48; } if (a % 9 == 0) { cout << "YES"; } else { cout << "NO"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long a = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { a += s[i] - 48; } if (a % 9 == 0) { cout << "Yes"; } else { cout << "No"; } return 0; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
82
#include <math.h> #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int N = 0; string Number; cin >> Number; for (int i = 0; i < Number.size(); i++) { char X = Number[i]; N += X; if (N % 9 == 0) N = 0; } if (N ...
#include <math.h> #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int N = 0; string Number; cin >> Number; for (int i = 0; i < Number.size(); i++) { char X = Number[i] - 48; N += X; if (N % 9 == 0) N = 0; } i...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
104
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; long long int x; int a; a = 0; for (int i = 0; i < s.length(); i++) { x = s[i] - '0'; a = a + x; } if (a % 9 == 0) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; long long int x; long long int a; a = 0; for (int i = 0; i < s.length(); i++) { x = s[i] - '0'; a = a + x; } if (a % 9 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
102
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; long long int ans = 0; for (long long int i = 0; i < s.size(); ++i) { ans += int(s[i]); } ans % 9 == 0 ? cout << "YES" << endl : cout << "NO" << endl; return 0; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; long long int ans = 0; for (long long int i = 0; i < s.length(); ++i) { ans += int(s[i] - '0'); } ans % 9 == 0 ? cout << "Yes" << endl : cout << "No" << endl; return 0; }
[["-", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 2, 3, 4, 0, 16, 12, 103, 0, 104], ["+", 12, 2, 3, 4, 0, 16, 12, 103, 0, 125], ["-", 0, 41, 64, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 41, 64, 16, 31, 16, 12, 5, 0, 6], ["-", 0, ...
1
85
#include <bits/stdc++.h> #include <math.h> using namespace std; #define looplt(i, x) for (i = 0; i < x; ++i) #define bsrch(v, x) binary_search(v.begin(), v.end(), x) #define vecl vector<long long int> #define pb(x) push_back(x) const long long int MAX_INT = 10e+10; typedef long long int ll; void pvec(vector<ll> &inp) ...
#include <bits/stdc++.h> #include <math.h> using namespace std; #define looplt(i, x) for (i = 0; i < x; ++i) #define bsrch(v, x) binary_search(v.begin(), v.end(), x) #define vecl vector<long long int> #define pb(x) push_back(x) const long long int MAX_INT = 10e+10; typedef long long int ll; void pvec(vector<ll> &inp) ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
339
#include <string.h> #include <algorithm> #include <iostream> using namespace std; int ctoi(char c); int main(void) { string str; cin >> str; long long sum = 0; long long i = 0; while (str[i] != '\0') { int l = ctoi(str[i]); sum += l; i++; } if (sum % 9 == 0) { cout << "yes" << endl;...
#include <string.h> #include <algorithm> #include <iostream> using namespace std; int ctoi(char c); int main(void) { string str; cin >> str; long long sum = 0; long long i = 0; while (str[i] != '\0') { int l = ctoi(str[i]); sum += l; i++; } if (sum % 9 == 0) { cout << "Yes" << endl;...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
140
#include <bits/stdc++.h> using namespace std; int main() { string N; long ans = 0; getline(cin, N); for (char c : N) switch (c) { case '1': ans += 1; break; case '2': ans += 2; break; case '3': ans += 3; break; case '4': ans += 4; break; ...
#include <bits/stdc++.h> using namespace std; int main() { string N; long ans = 0; getline(cin, N); for (char c : N) switch (c) { case '1': ans += 1; break; case '2': ans += 2; break; case '3': ans += 3; break; case '4': ans += 4; break; ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
168
a=0 n=input() n=list(n) n=list(map(int,n)) a=sum(n) if a%9==0: print("YES") else: print("No")
a=0 n=input() n=list(n) n=list(map(int,n)) a=sum(n) if a%9==0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
52
import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class Main { void solve(Scanner sc, PrintWriter pw) { String s = sc.next(); int total = 0; for (int i = 0; i < s.length(); i++) { total += (s.charAt(i) - '1'); } String result = (total % 9) == 0 ? "Yes" : ...
import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class Main { void solve(Scanner sc, PrintWriter pw) { String s = sc.next(); int total = 0; for (int i = 0; i < s.length(); i++) { total += (s.charAt(i) - '0'); } String result = (total % 9) == 0 ? "Yes" : ...
[["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 252], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 12, 252]]
3
174
#include <bits/stdc++.h> using namespace std; #define rep(index, num) for (int index = 0; index < num; index++) #define rep1(index, num) for (int index = 1; index <= num; index++) #define brep(index, num) for (int index = num - 1; index >= 0; index--) #define brep1(index, num) for (int index = num; index > 0; index--) ...
#include <bits/stdc++.h> using namespace std; #define rep(index, num) for (int index = 0; index < num; index++) #define rep1(index, num) for (int index = 1; index <= num; index++) #define brep(index, num) for (int index = num - 1; index >= 0; index--) #define brep1(index, num) for (int index = num; index > 0; index--) ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
627
#include <bits/stdc++.h> using namespace std; int main() { long long int test; // cin>>test; test = 1; while (test--) { string str; int sum = 0; cin >> str; for (long long int i = 0; i < str.length(); i++) { sum += str[i] - '0'; sum = sum % 9; } if (sum) cout << "NO"; ...
#include <bits/stdc++.h> using namespace std; int main() { long long int test; // cin>>test; test = 1; while (test--) { string str; int sum = 0; cin >> str; for (long long int i = 0; i < str.length(); i++) { sum += str[i] - '0'; sum = sum % 9; } if (sum) cout << "No"; ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
97
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define sp " " #define endl "\n" #define MAX 10e9 #define MAXN 100001 #define inf_int 2e9 #define inf_ll 2e18 #define e 1e-9 #define vi vector<int> #define vl vector<ll> #define vc vector<char> #define vs vector<string> #define vpl vector<pair<ll, ll>> #define vpc ve...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define sp " " #define endl "\n" #define MAX 10e9 #define MAXN 100001 #define inf_int 2e9 #define inf_ll 2e18 #define e 1e-9 #define vi vector<int> #define vl vector<ll> #define vc vector<char> #define vs vector<string> #define vpl vector<pair<ll, ll>> #define vpc ve...
[["-", 0, 7, 8, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 11, 12, 2, 3, 4, 0, 66, 17, 67], ["+", 8, 1, 0, 11, 12, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 104], ["+", 0, 11, 12, 23, 0, 16, 12, 103, 0, 125]]
1
353
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); String st = s.next(); long sum = 0; for (int i = 0; i < st.length(); i++) { sum += Integer.parseInt("" + st.charAt(i)); } if (sum % 9 == 0) System.out.println("YES")...
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); String st = s.next(); long sum = 0; for (int i = 0; i < st.length(); i++) { sum += Integer.parseInt("" + st.charAt(i)); } if (sum % 9 == 0) System.out.println("Yes")...
[["-", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
117
#include <bits/stdc++.h> using namespace std; #define read(a) cin >> a #define out(a) cout << a #define ull unsigned long long #define ll long long #define FOR(i, l, r) for (ll i = l; i <= r; i++) #define FOD(i, l, r) for (ll i = l; i >= r; i--) #define fast ios_base::sync_with_stdio(false); #define mod 1000000007 #de...
#include <bits/stdc++.h> using namespace std; #define read(a) cin >> a #define out(a) cout << a #define ull unsigned long long #define ll long long #define FOR(i, l, r) for (ll i = l; i <= r; i++) #define FOD(i, l, r) for (ll i = l; i >= r; i--) #define fast ios_base::sync_with_stdio(false); #define mod 1000000007 #de...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
118
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string S; cin >> S; int N = S.size(); ll cnt = 0; rep(i, N) cnt += S[i]; if (cnt % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string S; cin >> S; int N = S.size(); ll cnt = 0; rep(i, N) cnt += S[i] - '0'; if (cnt % 9 == 0) cout << "Yes" << endl; else cout << "No" << e...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
95
#include <bits/stdc++.h> using namespace std; int main() { string num; cin >> num; long long x = 0; char ch1; for (int i = 0; i < num.length(); i++) { ch1 = num[i] - '0'; x += ch1; } if (x % 9 == 0) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string num; cin >> num; long long x = 0; char ch1; for (int i = 0; i < num.length(); i++) { ch1 = num[i] - '0'; x += ch1; } if (x % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
87
n=int(input()) if(n==0): print("YES") elif(n%9==0): print("YES") else: print("NO")
n=int(input()) if(n==0): print("Yes") elif(n%9==0): print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
44
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> vi; typedef vector<vector<int>> vvi; int main() { string x; cin >> x; ll n = x.size(); ll y = 0; rep(i, n) { y += x[i]; } string ans = "No"; if (...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> vi; typedef vector<vector<int>> vvi; int main() { string x; cin >> x; ll n = x.size(); ll y = 0; rep(i, n) { y += x[i] - '0'; } string ans = "No"; ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
115
#include <bits/stdc++.h> #include <string> using namespace std; const int mod = 1e9 + 7; const long long INF = 1e18; #define PI 3.141592653589793 #define REP(i, n) for (long long i = 0; i < n; i++) long long H, W, K, N, D, X, T; int main() { string S; cin >> S; int ans = 0; REP(i, S.size()) { ans += S[i] - '0...
#include <bits/stdc++.h> #include <string> using namespace std; const int mod = 1e9 + 7; const long long INF = 1e18; #define PI 3.141592653589793 #define REP(i, n) for (long long i = 0; i < n; i++) long long H, W, K, N, D, X, T; int main() { string S; cin >> S; int ans = 0; REP(i, S.size()) { ans += S[i] - '0...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 70], ["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 13], ["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 73]]
1
123
#include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned long long int uint64; typedef long long int int64; #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define ABS(a) ((a) > (0) ? (a) : -(a)) void get_N(int64 *n) { ...
#include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef unsigned long long int uint64; typedef long long int int64; #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define ABS(a) ((a) > (0) ? (a) : -(a)) void get_N(int64 *n) { ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
0
958
N=list(input()) N_2=list(map(int,N)) print(N_2) print('YNeos'[sum(N_2)%9!=0::2])
N=list(input()) N_2=list(map(int,N)) print('YNeos'[sum(N_2)%9!=0::2])
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
42
n = int(input()) if (n//9): print("Yes") else: print("No")
n = int(input()) if (n % 9 == 0): print("Yes") else: print("No")
[["-", 0, 656, 0, 57, 15, 23, 0, 657, 17, 676], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 109], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 0, 612]]
5
29
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; int sum = 0; for (int i = 0; i < n.length(); i++) { sum += int(n[i]); } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; int sum = 0; for (int i = 0; i < n.length(); i++) { sum += (int)n[i] - 48; } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 40], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 1, 0, 11, 12, 16, 31, 74, 0, 25], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
78
N = input() num = 0 for n in N: num += int(n) if num % 9 == 0: print("yes") else: print("no")
N = input() num = 0 for n in N: num += int(n) if num % 9 == 0: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
40
N=int(input()) result=sum(list(map(int, str(N)))) if result==9: print("Yes") else: print("No")
N=int(input()) result=sum(list(map(int, str(N)))) if result%9==0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
44
#include <bits/stdc++.h> using namespace std; #define ll long long // #define rep(i,n) for(int i=0;i<n;i++) void solve() { string s; cin >> s; ll sum = 0; for (int i = 0; i < (int)s.size(); i++) { sum += (s[i] - '0'); } if (sum % 9 == 0) cout << "YES"; else cout << "NO"; } int main() { int ...
#include <bits/stdc++.h> using namespace std; #define ll long long // #define rep(i,n) for(int i=0;i<n;i++) void solve() { string s; cin >> s; ll sum = 0; for (int i = 0; i < (int)s.size(); i++) { sum += (s[i] - '0'); } if (sum % 9 == 0) cout << "Yes"; else cout << "No"; } int main() { int ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
111
N = list(input()) sum_N = 0 for i in range(len(N)): sum_N += int(N[i]) if sum_N%9 == 0: print('yes') else: print('no')
N = list(input()) sum_N = 0 for i in range(len(N)): sum_N += int(N[i]) if sum_N%9 == 0: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
52
#include <bits/stdc++.h> using namespace std; char n[2000005]; long long len, sum = 0; int main() { scanf("%s", n); len = strlen(n); if (n[0] == '0') { printf("Yes"); return 0; } for (long long i = 0; i < len; i++) { sum += n[i] - '0' + 1; } if (sum % 9) { printf("No"); } else { pr...
#include <bits/stdc++.h> using namespace std; char n[2000005]; long long len, sum = 0; int main() { scanf("%s", n); len = strlen(n); if (n[0] == '0') { printf("Yes"); return 0; } for (long long i = 0; i < len; i++) { sum += n[i] - '0'; } if (sum % 9) { printf("No"); } else { printf...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
123
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string n; cin >> n; ll sum = 0; rep(i, n.size()) { sum += n.at(i); } if (sum % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string n; cin >> n; ll sum = 0; rep(i, n.size()) { sum += n.at(i) + 0 - '0'; } if (sum % 9 == 0) cout << "Yes" << endl; else cout << "No" << end...
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
95
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); int sum = 0; for (int i = 0; i < N.length(); i++) { sum = Integer.parseInt(N.substring(i, i + 1)); sum = sum % 9; } if (sum == 0) { System.out...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); int sum = 0; for (int i = 0; i < N.length(); i++) { sum += Integer.parseInt(N.substring(i, i + 1)); sum = sum % 9; } if (sum == 0) { System.ou...
[["-", 0, 7, 8, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 17, 107]]
3
125
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define ll long ...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define ll long ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
279
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const int MAX_N = 1e5 + 5; const int MAX_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const int MAX_N = 1e5 + 5; const int MAX_...
[["-", 12, 74, 51, 23, 0, 16, 12, 103, 0, 125], ["+", 12, 74, 51, 23, 0, 16, 12, 103, 0, 125]]
1
341
#include <iostream> using namespace std; int main() { // your code goes here string s; cin >> s; int sum = 0; for (char c : s) { sum = (sum + (c - '0')) % 9; } if (sum == 0) cout << "YES"; else cout << "NO"; return 0; }
#include <iostream> using namespace std; int main() { // your code goes here string s; cin >> s; int sum = 0; for (char c : s) { sum = (sum + (c - '0')) % 9; } if (sum == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
72
#include <bits/stdc++.h> #define f(i, n) for (long int i = 0; i < (long int)n; i++) #define testcase \ ll tt; \ cin >> tt; ...
#include <bits/stdc++.h> #define f(i, n) for (long int i = 0; i < (long int)n; i++) #define testcase \ ll tt; \ cin >> tt; ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
94
N = str(input()) k = len(N) - 1 ans = 0 for i in range (k): n = int (N[i]) ans = ans + n if ans % 9 == 0: print ("Yes") else: print ("No")
N = str(input()) k = len(N) ans = 0 for i in range (k): n = int (N[i]) ans = ans + n if ans % 9 == 0: print ("Yes") else: print ("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
62
N=input() l=len(N) tot=0 for i in range(l): tot=int(N[i]) if tot%9==0: print("Yes") else: print('No')
N=input() l=len(N) tot=0 for i in range(l): tot+=int(N[i]) if tot%9==0: print("Yes") else: print('No')
[["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107]]
5
52
#include <stdio.h> int main(int argc, char *argv[]) { char a[8000000]; long long i, sum = 0; scanf("%s", a); for (i = 0; a[i]; i++) sum += (a[i] - 48); if (!(sum % 9)) printf("YES\n"); else printf("NO\n"); }
#include <stdio.h> int main(int argc, char *argv[]) { char a[8000000]; long long i, sum = 0; scanf("%s", a); for (i = 0; a[i]; i++) sum += (a[i] - 48); if (!(sum % 9)) printf("Yes\n"); else printf("No\n"); }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
90
#include <iostream> typedef long long ll; using namespace std; int main(void) { string S; ll total = 0; int i = 0; cin >> S; while (S[i]) { total += S[i] - '0'; i++; } if (total % 9 == 0) cout << "yes"; else cout << "no"; return 0; }
#include <iostream> typedef long long ll; using namespace std; int main(void) { string S; ll total = 0; int i = 0; cin >> S; while (S[i]) { total += S[i] - '0'; i++; } if (total % 9 == 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
82
#cout<< (ll)(((2LL%mod * (n )%mod)%mod - 1%mod)%mod * k%mod)%mod <<'\n'; import sys # input=sys.stdin.readline # t = int(input()) # for i in range(t): # n,k=map(int,input().split()) # res = (((2**n)%1000000007-1%1000000007)%1000000007 * k%1000000007)%1000000007 # print(res) n = int(input()) if n%9==0: print("Yes"...
#cout<< (ll)(((2LL%mod * (n )%mod)%mod - 1%mod)%mod * k%mod)%mod <<'\n'; import sys # input=sys.stdin.readline # t = int(input()) # for i in range(t): # n,k=map(int,input().split()) # res = (((2**n)%1000000007-1%1000000007)%1000000007 * k%1000000007)%1000000007 # print(res) n = int(input()) if n%9==0: print("Yes"...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
38
#include <bits/stdc++.h> #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define M 10000...
#include <bits/stdc++.h> #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define M 10000...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
92
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int sum = 0; while (S.size() > 0) { int tmp; tmp = stoi(S.substr(S.size() - 1)); S.erase(S.size() - 1); sum += tmp; if (tmp % 9 == 0) { sum = 0; } } if (sum % 9 == 0) { cout << "Yes" << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int sum = 0; while (S.size() > 0) { int tmp; tmp = stoi(S.substr(S.size() - 1)); S.erase(S.size() - 1); sum += tmp; if (sum % 9 == 0) { sum = 0; } // cout << S <<endl; } if (sum % 9 == 0) { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
117
N = input() digits = list(N) sum = 0 for i in range(len(digits)): sum += int(digits[i]) if(sum%9 == 0): print("YES") else: print("NO")
N = input() digits = list(N) sum = 0 for i in range(len(digits)): sum += int(digits[i]) if(sum%9 == 0): print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
57
#include <bits/stdc++.h> using namespace std; #define int long long int signed main() { // code string s; cin >> s; int sum = 0; for (int i = 0; i < s.size(); i++) { sum += s[i]; sum %= 9; } if (sum == 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; #define int long long int signed main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.size(); i++) { sum += s[i] - '0'; sum %= 9; } if (sum == 0) cout << "Yes"; else cout << "No"; return 0; }
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
81
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); int sum = 0; for (char each : a.toCharArray()) { sum += each - '0'; } String res = sum % 9 == 0 ? "YES" : "NO"; System.out.println(res);...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); int sum = 0; for (char each : a.toCharArray()) { sum += each - '0'; } String res = sum % 9 == 0 ? "Yes" : "No"; System.out.println(res);...
[["-", 0, 503, 49, 200, 51, 510, 64, 5, 0, 491], ["+", 0, 503, 49, 200, 51, 510, 64, 5, 0, 491], ["-", 0, 503, 49, 200, 51, 510, 75, 5, 0, 491], ["+", 0, 503, 49, 200, 51, 510, 75, 5, 0, 491]]
3
94
N = input() sum = 0 for i in N: sum = sum + int(i) if (sum%9): print('NO') else: print('YES')
N = input() sum = 0 for i in N: sum = sum + int(i) if (sum%9): print('No') else: print('Yes')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
42
n = int(input()) if(n%9==0): print("YES") else: print("NO")
n = int(input()) if(n%9==0): print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
31
s=int(input()) for i in s: ans+=int(i) if ans%9==0: print("Yes") else: print("No")
s=str(input()) ans=0 for i in s: ans+=int(i) if ans%9==0: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
40
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <unordered_map> #include <vector> using namespace std; #define inf LLONG_MAX const int N = 20...
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <unordered_map> #include <vector> using namespace std; #define inf LLONG_MAX const int N = 20...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
115
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.size(); i++) { int x = s.at(i); sum += x; } if (sum % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.size(); i++) { int x = s.at(i) - 48; sum += x; } if (sum % 9 == 0) cout << "Yes" << endl; else cout << "No" << endl; }
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
83
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3 + 10; const int mod = 1e9 + 7; map<ll, ll> mp, flag; ll a[N], cnt[N], b[N]; int k; string s; int main() { ; // freopen("../in.in", "r", stdin); // freopen("../out.out","w",stdout); ios::sync_with_stdio(false); int t, i,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3 + 10; const int mod = 1e9 + 7; map<ll, ll> mp, flag; ll a[N], cnt[N], b[N]; int k; string s; int main() { ; // freopen("../in.in", "r", stdin); // freopen("../out.out","w",stdout); ios::sync_with_stdio(false); int t, i, j...
[["+", 0, 7, 8, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 7, 8, 1, 0, 11, 12, 23, 0, 25], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
156
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; typedef long double ld; const int inf = 1e9; const int mod = 1e9 + 7; const int maxn = 1e6 + 3; #define pb push_back #define mp make_pair #define ff first #define ss second #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; typedef long double ld; const int inf = 1e9; const int mod = 1e9 + 7; const int maxn = 1e6 + 3; #define pb push_back #define mp make_pair #define ff first #define ss second #define...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
223
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); // int n,t,k; cin >> n >> t >> k; // int cnt = t; int time = k; // // if (cnt > n) cout << k; // if (t == 1){ // cout << n*k; // return 1; // } // while (cnt <= n) // { // cnt...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); // int n,t,k; cin >> n >> t >> k; // int cnt = t; int time = k; // // if (cnt > n) cout << k; // if (t == 1){ // cout << n*k; // return 1; // } // while (cnt <= n) // { // cnt...
[["-", 0, 1, 0, 11, 12, 16, 31, 103, 0, 104], ["-", 0, 1, 0, 11, 12, 16, 31, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 16, 31, 69, 28, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 104]]
1
103
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; int main() { string N; ll sum = 0; for (auto digit : N) { sum += (digit - '0'); } cout << ((sum % 9 == 0) ? "Yes" : "No"); }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; int main() { string N; cin >> N; ll sum = 0; for (auto digit : N) { sum += (digit - '0'); } cout << ((sum % 9 == 0) ? "Yes" : "No"); }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
69