竞赛
考级
Jason-JHT
刷题练习 题目大意 小Jerry每天最多做 333 道题,要求你计算出至少多少天可以完成 xxx 道题。 题意分析 需要求最少天数,所以小Jerry每天需要尽可能多的去完成题目,即每天完成 333 题。 解题思路 考虑如果每天完成 333 题能够恰好完成,输出 x/3x/3x/3 ,否则需要额外增加一天,输出 x/3+1x/3+1x/3+1 。 时间复杂度解析 本题执行时间不受输入影响,因此时间复杂度为 O(1)O(1)O(1) 代码演示
AC君
#include<bits/stdc++.h> using namespace std; int main(){ double x; cin>>x; cout<<ceil(x/3); return 0; }
6
#include <bits/stdc++.h> using namespace std; int main() { int x; cin>>x; int y=0; y=x/3; if(x%3!=0){ y++; } cout<<y; return 0; }
小冰果XIAO BING GUO
太简单了!!!! 蛋仔都会做: 第一·不余数不等0;计数+1; 第二:加入m/3 程序{ #include<iostream> using namespace std; int main(){ int m,l = 0; cin >> m; if(m%3!=0){ l+=1; } l+=m/3; cout << l; } }
新某一
#include<bits/stdc++.h> using namespace std; int main(){ long long x;cin>>x; if(x%3==0){ cout<<x/3; } else{ cout<<x/3+1; } return 0; }
AC神
#include<bits/stdc++.h> using namespace std; int main(){ int a,sum=0; cin>>a; if(a%3==0) sum+=a/3; else if(a%3!=0) sum+=a/3+1; cout<<sum; }
魏敬平
霸气侧漏张涛威猛无敌666
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%3==0){ cout<<n/3; } else{ cout<<n/3+1; } }
亻尔女子,手戈是周奕氵函
Python代码题解
189****0370
#include<iostream> using namespace std; int main(){ int a,b; cin>>a; b=(a-1)/3+1; cout<<b; return 0; }
135****3716
TN Hacker
黑客_天之神_ZDZL_zsy
有事找大号