#include<iostream>#include<algorithm>#include<cmath>#include<iomanip>#include<string>using
namespace std;int
main(){ longlong
c[10003]; for(long
long i = 1; i <= 10002; i++) c[i] = i*i*i; longlong
s; while(cin >> s) { boolp = 0; for(int
i = 1; i <= 10000; i++) { longlong
sum = c[i] + s; if(c[i + 1] > sum)
break; intx = i + 1, y = 10002; while(x < y) { intt = (x + y) / 2; if(c[t] >= sum) y = t; elsex = t + 1; } if(c[x] == sum) { cout << i <<' '
<< x << endl; p = 1;break; } } if(p == 0) cout <<
"-1" << endl; } return0;}#include<iostream>#include<algorithm>#include<cstdio>#include<math.h>using
namespace std;int
main(){ intn,m,x,y; while(scanf("%d%d%d%d",&n,&m,&x,&y)!=EOF) { if(n>m) swap(n,m); if(x>y) swap(x,y); if(x==0) { cout<<'0'<<endl;continue; } ints1,s2=999999999; if(x<n) s1=x+1; elseif(x%n==0) s1=n; elses1=n+1; inta=sqrt(x); if(a<n) { if(a*a==x) s2=2*a; elseif(x-a*a<=a) s2=2*a+1; elses2=2*a+2; } cout<<min(s1,s2)<<endl; } return0;}#include<iostream>#include<cstdio>#include<algorithm>#include<math.h>using
namespace std;int
main(){ intll, r, s; while(scanf("%d%d%d",
&ll, &r, &s) != EOF) { intstart = ll, end = r,u=r;
intsum = 0; while(u) { sum = sum + u % 10; u = u / 10; } if(end - sum < s) { printf("%d\n", end - start + 1);continue; } while(ll < r) { intp = (ll + r) / 2, q = p; intS = 0; while(p) { S = S + p % 10; p = p / 10; } if(q - S < s) ll = q + 1; elser = q; } if(ll <= start)
printf("%c\n",'0'); elseif
(ll > end) { printf("%d\n", end - start + 1); } else { printf("%d\n", ll - start); } } return0;}#include<iostream>#include<algorithm>#include<cmath>#include<iomanip>#include<string>using
namespace std;int
main(){ string xx;int
k; while(cin >> xx >> k) { intlen1 = xx.length();
inty = k;
char x[222]; int
tt = 0; for(int
i = 0; i < len1; i++) { if(xx[i] !=
'0' || ((i+1<len1)&&(xx[i] ==
'0'&&xx[i + 1] =='.'))) { for(int
j = i; j < len1; j++) { x[tt] = xx[j]; tt++; } break; } } intlen = tt; if(x[0] !=
'0') { for(int
i = 0; i < y; i++) { if(i == 1) cout <<
'.'; if(i >= len) { cout <<'0';
continue; } if(x[i] ==
'.') { y++;continue; } cout << x[i]; } cout <<'e'; intt = 0; for(int
i = 0; i < len; i++) { if(x[i] ==
'.')break; t++; } cout << t - 1; } else { intt = 0; for(int
i = 0; i < len; i++) { if(x[i] !=
'0'&&x[i] !='.') { cout << x[i]; if(k > 1) { cout <<'.'; if(i + k <= len) { for(int
j = i + 1; j < i + k; j++) cout << x[j]; } else { for(int
j = i + 1; j < len; j++) cout << x[j]; for(int
j = 1; j <= k - len + i; j++) cout <<'0'; } } break; } } intp; for(p = 0; p < len; p++) { if(x[p] !='0'&&x[p]!='.')break; } cout <<'e'
<< '-'<< p - 1; } cout << endl; } return0;}#include<iostream>#include<algorithm>#include<cmath>using
namespace std;int
main(){ inta, b, c; while(cin >> a >> b >> c) { doublee =
sqrt(3) / 4 * a*a; doublef =
acos(-1.0)*b*b; doubleg = c*c; if(e > f&&e > g) cout <<
"triangle"; elseif
(f > e&&f > g) cout <<"circle"; elsecout <<
"square"; cout << endl; } return0;}#include<iostream>#include<algorithm>#include<cmath>using
namespace std;int
main(){ intx1, y1, x2, y2, x3, y3, x4, y4; while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4) { x1 = x1 + 100; x2 = x2 + 100; x3 = x3 + 100; x4 = x4 + 100; y1 = y1 + 100; y2 = y2 + 100; y3 = y3 + 100; y4 = y4 + 100; intt; if(x1 > x2) swap(x1, x2); if(y1 > y2) swap(y1, y2); if(x3 > x4) swap(x3, x4); if(y3 > y4) swap(y3, y4); boola[202][202]; for(int
i = 0; i <= 201; i++) for(int
j = 0; j <= 201; j++) { if(i >= x1&&i <= x2&&j >= y1&&j <= y2&&i >= x3&&i <= x4&&j >= y3&&j <= y4) a[i][j] = 1; elsea[i][j] = 0; } intx = 0, y;
int mm; for(int
i = 0; i <= 201; i++) { y = 0; for(int
j = 0; j <= 201; j++) { if(a[i][j] == 1) y++, mm = y; } if(y != 0) x++; } if(x > 1 && mm > 1) cout <<(x-1)*(mm-1) ; elsecout <<
'0'; cout << endl; } return0;}#include<iostream>using
namespace std;int
main(){ intn; while(cin >> n) { if(n <= 2) { cout <<'0'
<< endl; continue; } if(n % 2 == 0) n = n - 1; cout << (int)(250 - 250.00 / n + 0.5) << endl; } return0;}
1514

被折叠的 条评论
为什么被折叠?



