QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#166856 | #1260. Hardcore String Counting 2 | ucup-team1600# | AC ✓ | 1ms | 3360kb | C++20 | 5.1kb | 2023-09-06 19:31:18 | 2023-09-06 19:31:19 |
Judging History
answer
//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")
#ifdef __APPLE__
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <cstdint>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <map>
#include <queue>
#include <ctime>
#include <stack>
#include <set>
#include <list>
#include <random>
#include <deque>
#include <functional>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <complex>
#include <numeric>
#include <cassert>
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <thread>
#else
#include <bits/stdc++.h>
#endif
#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
template<typename T>
bool umin(T &a, T b) {
if (b < a) {
a = b;
return true;
}
return false;
}
template<typename T>
bool umax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
#if __APPLE__
#define D for (bool _FLAG = true; _FLAG; _FLAG = false)
#define LOG(...) print(#__VA_ARGS__" ::", __VA_ARGS__) << endl
template<class ...Ts>
auto &print(Ts ...ts) { return ((cerr << ts << " "), ...); }
#else
#define D while (false)
#define LOG(...)
#endif
const int max_n = 121, inf = 1000111222;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//https://arxiv.org/pdf/2012.03926.pdf huh
string ans[max_n];
void solve() {
ans[1]="3";
ans[2]="6";
ans[3]="12";
ans[4]="18";
ans[5]="30";
ans[6]="42";
ans[7]="60";
ans[8]="78";
ans[9]="108";
ans[10]="144";
ans[11]="204";
ans[12]="264";
ans[13]="342";
ans[14]="456";
ans[15]="618";
ans[16]="798";
ans[17]="1044";
ans[18]="1392";
ans[19]="1830";
ans[20]="2388";
ans[21]="3180";
ans[22]="4146";
ans[23]="5418";
ans[24]="7032";
ans[25]="9198";
ans[26]="11892";
ans[27]="15486";
ans[28]="20220";
ans[29]="26424";
ans[30]="34422";
ans[31]="44862";
ans[32]="58446";
ans[33]="76122";
ans[34]="99276";
ans[35]="129516";
ans[36]="168546";
ans[37]="219516";
ans[38]="285750";
ans[39]="372204";
ans[40]="484446";
ans[41]="630666";
ans[42]="821154";
ans[43]="1069512";
ans[44]="1392270";
ans[45]="1812876";
ans[46]="2359710";
ans[47]="3072486";
ans[48]="4000002";
ans[49]="5207706";
ans[50]="6778926";
ans[51]="8824956";
ans[52]="11488392";
ans[53]="14956584";
ans[54]="19470384";
ans[55]="25346550";
ans[56]="32996442";
ans[57]="42957300";
ans[58]="55921896";
ans[59]="72798942";
ans[60]="94766136";
ans[61]="123368406";
ans[62]="160596120";
ans[63]="209059806";
ans[64]="272143380";
ans[65]="354271314";
ans[66]="461181036";
ans[67]="600356406";
ans[68]="781520994";
ans[69]="1017362166";
ans[70]="1324371090";
ans[71]="1724034504";
ans[72]="2244278358";
ans[73]="2921521164";
ans[74]="3803130042";
ans[75]="4950798954";
ans[76]="6444761514";
ans[77]="8389549680";
ans[78]="10921197582";
ans[79]="14216853012";
ans[80]="18506985300";
ans[81]="24091726728";
ans[82]="31361678988";
ans[83]="40825520274";
ans[84]="53145145482";
ans[85]="69182396616";
ans[86]="90058945560";
ans[87]="117235364616";
ans[88]="152612592438";
ans[89]="198665414208";
ans[90]="258615015792";
ans[91]="336655224582";
ans[92]="438245025942";
ans[93]="570491023872";
ans[94]="742643501460";
ans[95]="966745068408";
ans[96]="1258471821174";
ans[97]="1638231187596";
ans[98]="2132586986466";
ans[99]="2776120525176";
ans[100]="3613847436684";
ans[101]="4704369434772";
ans[102]="6123969129810";
ans[103]="7971950000520";
ans[104]="10377579748374";
ans[105]="13509138183162";
ans[106]="17585681474148";
ans[107]="22892370891330";
ans[108]="29800413809730";
ans[109]="38793041799498";
ans[110]="50499301907904";
ans[111]="65738067298920";
ans[112]="85575306401886";
ans[113]="111398667487824";
ans[114]="145014533047950";
ans[115]="188774390188008";
ans[116]="245739297342390";
ans[117]="319894038598554";
ans[118]="416425845608070";
ans[119]="542087279517756";
ans[120]="705668533667544";
int n;
cin >> n;
for(int i = 1; i <= n; i++) cout << ans[i] << '\n';
}
signed main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
//cin >> t;
while (t--) solve();
}
/*
KIVI
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3352kb
input:
10
output:
3 6 12 18 30 42 60 78 108 144
result:
ok 10 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 3360kb
input:
120
output:
3 6 12 18 30 42 60 78 108 144 204 264 342 456 618 798 1044 1392 1830 2388 3180 4146 5418 7032 9198 11892 15486 20220 26424 34422 44862 58446 76122 99276 129516 168546 219516 285750 372204 484446 630666 821154 1069512 1392270 1812876 2359710 3072486 4000002 5207706 6778926 8824956 11488392 14956584 1...
result:
ok 120 numbers