Codeforce Round #227 Div2 C
→ Practice
You are registered for practice. You can solve problems unofficially. Results can be found in the contest status and in the bottom of standings.
→ Submit?
→ Last submissions
| Submission | Time | Verdict |
|---|---|---|
| 5930214 | 02/10/2014 02:44AM | Accepted |
| 5930209 | 02/10/2014 02:41AM | Accepted |
| 5930199 | 02/10/2014 02:37AM | Wrong answer on test 1 |
| 5930198 | 02/10/2014 02:36AM | Wrong answer on test 1 |
| 5930193 | 02/10/2014 02:35AM | Wrong answer on test 1 |
| 5849911 | 01/30/2014 09:26PM | Wrong answer on pretest 10 |
→ Problem tags
No tag edit access
1 #pragma comment(linker,"/STACK:102400000,102400000") 2 #include <cstdio> 3 #include <vector> 4 #include <cmath> 5 #include <queue> 6 #include <set> 7 #include <cstring> 8 #include <iostream> 9 #include <algorithm> 10 using namespace std; 11 #define INF 0x7fffffff 12 #define mod 1000000007 13 #define ll long long 14 #define maxn 1000005 15 #define pi acos(-1.0) 16 #define dis(a, b) sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)) 17 ll gcd(ll n, ll m){ return m ? gcd(m, n%m) : n; } 18 int n, m, k, c, a, b, x, y; 19 struct node{int a, b;}p[maxn]; 20 bool cmp(node a, node b){ return (a.a < b.a || a.a == b.a&&a.b < b.b); } 21 char s[maxn]; 22 int main(){ 23 scanf("%s", s); 24 n = strlen(s); 25 for (int i = n - 1; i >= 0; i--){ 26 x++; 27 if (s[i] == '0')continue; 28 if (x < i || x == i&&s[i] <= s[0])x=0, k++; 29 } 30 k++; 31 printf("%d\n", k); 32 return 0; 33 }




浙公网安备 33010602011771号