码迷,mamicode.com
首页 >  
搜索关键字:cin getline    ( 8174个结果
1077 Kuchiguse (20 分)
一眼二分。 注意点: 在读入n之后要使用getchar接收后面的换行符,否则会使for循环内的getline读入这个换行符,导致第一个字符串读取错误。 最后输出答案前要先check一遍 const int N=110; string a[N]; string suffix; int n; bool ...
分类:其他好文   时间:2021-02-17 14:18:36    阅读次数:0
多项式重工业基地
未完待续……(只是给自己存个板子) 快速傅里叶变换 #include <bits/stdc++.h> using namespace std; const int maxn = 2e6 + 1e2; struct Cp { double x, y; inline Cp operator +(cons ...
分类:其他好文   时间:2021-02-17 14:03:19    阅读次数:0
AtCoder Beginner Contest 120
A - Favorite Sound #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ int a, b, c; cin >> a >> b >> ...
分类:其他好文   时间:2021-02-16 12:44:42    阅读次数:0
1006 换个格式输出整数 (15 分)
水题~。 int n; int main() { cin>>n; string res; int t=n/100; for(int i=0;i<t;i++) res+='B'; t=n%100/10; for(int i=0;i<t;i++) res+='S'; t=n%100%10; for(in ...
分类:其他好文   时间:2021-02-16 12:32:36    阅读次数:0
1013 数素数 (20 分)
考虑到不知道第$104$个素数有多大,可以先用程序测试下第$104$个素数是多少。 const int N=2e5+10; int primes[N],cnt; bool vis[N]; void init(int n) { for(int i=2;i<=n;i++) if(!vis[i]) { p ...
分类:其他好文   时间:2021-02-16 12:14:01    阅读次数:0
1010 一元多项式求导 (25 分)
如果求导之后没有任何非零项,需要输出0 0。 int main() { string line; getline(cin,line); stringstream ss(line); int a,b; bool first=true; while(ss>>a>>b) { a*=b; b--; if(b ...
分类:其他好文   时间:2021-02-16 11:53:11    阅读次数:0
1026 程序运行时间 (15 分)
水题~,就简单转换下时间。 int a,b; int main() { cin>>a>>b; int tim=round((b-a)/100.0); int hh=tim/3600,mm=tim%3600/60,ss=tim%3600%60; printf("%02d:%02d:%02d\n",hh ...
分类:其他好文   时间:2021-02-15 12:25:04    阅读次数:0
1069 The Black Hole of Numbers (20 分)
注意不满$4$位的话要补成$4$位。 string s; set<int> S; int main() { cin>>s; while(s.size()<4) s='0'+s; while(true) { sort(s.begin(),s.end(),greater<char>()); string ...
分类:其他好文   时间:2021-02-15 12:21:49    阅读次数:0
Educational Codeforces Round 102 (Rated for Div. 2)E题(分层图、最短路)
https://codeforces.com/contest/1473/problem/E vector存图: 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::sync_with_stdio(0),cin.tie(0 ...
分类:其他好文   时间:2021-02-15 12:17:20    阅读次数:0
单源最短路 : 多起点
https://www.acwing.com/problem/content/1139/ #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie ...
分类:其他好文   时间:2021-02-15 11:53:52    阅读次数:0
8174条   上一页 1 ... 9 10 11 12 13 ... 818 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!