7 条题解
-
1
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define int long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int a, ans; char c; signed main() { scanf("%lld ", &a); c = getchar();//字符专用输入方式 if(a < 1001)//判断重量是否在1000以内 ans = 8; else ans = 8 + ((a - 1000) / 500 + 1) * 4; if(c == 'y')//判断是否加急 ans += 5; printf("%lld\n", ans); return 0; }
纯享版:
#include <stdio.h> int a, ans; char c; signed main() { scanf("%lld ", &a); c = getchar(); if(a < 1001) ans = 8; else ans = 8 + ((a - 1000) / 500 + 1) * 4; if(c == 'y') ans += 5; printf("%lld\n", ans); return 0; }
- 1
信息
- ID
- 2910
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 5
- 标签
- 递交数
- 267
- 已通过
- 88
- 上传者