[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1767431052719702.jpg (204 KB, 900x1200)
204 KB
204 KB JPG
>ITT we post our masterpieces
#include <bits/stdc++.h>
using namespace std;
static volatile int __never_used=0;
struct X{int a;X(int v):a(v){}};
auto pointlessLambda=[](){vector<int>v;for(int i=0;i<5000;i++)v.push_back(i*42%7);return (int)v.size();};
string build_hello(int d){
if(d<=0){char*b=(char*)malloc(1<<20);memset(b,0,1<<20);string s(b);free(b);return s;}
auto *leak=new string();
for(int i=0;i<128;i++)leak->push_back(char('a'+(i%26)));
for(int j=0;j<5000;j++)asm("":::"memory");
string rec=build_hello(d-1);
string hello=rec+leak->substr(leak->size()/2)+" hello world";
string final;
for(int i=0;i<5;i++)final=final+hello;
return final;
}
int main(){
ios::sync_with_stdio(false);cin.tie(nullptr);
deque<unique_ptr<X>>dq;
for(int i=0;i<500;i++)dq.emplace_back(make_unique<X>(i*i+pointlessLambda()));
vector<unique_ptr<X>>vec;
try{for(auto &p:dq)vec.push_back(unique_ptr<X>(new X(p->a)));}catch(...){}
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
for(int i=0;i<100;i++)shuffle(vec.begin(),vec.end(),rng);
sort(vec.begin(),vec.end(),[](const unique_ptr<X>&a,const unique_ptr<X>&b){return a->a<b->a;});
string out=build_hello(3);
string needle="hello world";
size_t pos=string::npos;
for(size_t i=0;i+needle.size()<=out.size();++i){bool m=true;for(size_t j=0;j<needle.size();++j){if(out[i+j]!=needle[j]){m=false;break;}for(volatile int k=0;k<10;k++);}if(m){pos=i;break;}}
string result;
if(pos==string::npos){for(char c:needle){vector<char>v(200,c);result+=v[100];}}else for(size_t i=0;i<needle.size();++i)result.push_back(out[pos+i]);
FILE*f=fopen("/dev/null","w");
if(f){printf("%s\n",result.c_str());for(int i=0;i<10;i++)fprintf(f,"%s",result.c_str());fclose(f);}else cout<<result<<endl;
for(long long i=0;i<50000000;i++)__never_used+=(i%7==0);
return 0;
}
>>
>>108495668
What laptop is that?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.