![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
我的OI之路
蔗蓝
OIer
展开
-
Codeforces Round #734 (Div. 3)
A. Polycarp and Coin#include <iostream>using namespace std;int main() { int t, n; cin >> t; while (t--) { cin >> n; switch (n % 3) { case 0: cout << n / 3 << ' ' << n /原创 2021-07-24 00:45:07 · 216 阅读 · 0 评论 -
CodeForces - Harbour.Space Scholarship Contest 2021-2022 (Div. 1 + Div. 2)
A. Digits Sum找规律题,没想到看样例直接蒙对……#include <iostream>using namespace std;int main() { int t, n; cin >> t; while (t--) { cin >> n; cout << (n + 1) / 10 << endl; } return 0;}B. Reverse Stri原创 2021-07-23 01:18:48 · 292 阅读 · 0 评论 -
想出OI题?用最简洁的C/C++测试数据生成工具——makedata.h库
我一直觉得出OI题是件快乐的事,但造数据、敲std是件麻烦的事。于是,我写下了这样一段代码……#include<bits/stdc++.h>using namespace std;ofstream infile,outfile;string filename="data";int testtimes=10;int make(int tp);void file(int tp){ char*inname=new char[filename.length()+6]; infile.原创 2020-12-12 16:59:33 · 7141 阅读 · 7 评论 -
一个初一蒟蒻的NOIP2020游记
NOIP2020将于12月5日举行……我连深搜dfs都还没有掌握啊!!!说明:没有Day0!Day -122020.11.23(周一)CSP复赛成绩出来了。我:J组S组同班的另一个选手CMW:J组S组S组T1能拿45就神奇。。。Day -72020.11.28(周六)洛谷11月月赛II正好在考前一周举行。于是,我果断地报名参加了Div.2的比赛。第一题我用getchar搞了半天,突然记起入门书籍里讲过scanf/printf有个%X的格式控制符,一查,正是十六进制……#原创 2020-11-30 17:48:55 · 508 阅读 · 2 评论 -
C/C++中最快、最简洁的read()快读(卡常数)方法
别人的方法遇到数据较多的OI题时,用scanf或者cin肯定是不够快的。于是,有人发明了像这样的快速读入函数:inline void read(int& a){ int s = 0, w = 1; char ch = getchar(); while (ch < '0' || ch>'9') { if (ch == '-') w = -1; ch = getchar(); } while (ch >= '0' && ch <=原创 2020-11-28 18:42:04 · 19574 阅读 · 11 评论