{"id":20720100,"url":"https://github.com/archismankarmakar/c-_template_ak","last_synced_at":"2025-08-25T00:11:47.324Z","repository":{"id":179366605,"uuid":"663378487","full_name":"ArchismanKarmakar/C-_template_AK","owner":"ArchismanKarmakar","description":"C++ template \u0026 snippet by Archisman Karmakar for CP.","archived":false,"fork":false,"pushed_at":"2023-07-07T09:12:45.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T22:42:23.092Z","etag":null,"topics":["codechef","codeforces","competitive-programming","computer-programming","cpp","cpp-all","cpp17","cpp20","leetcode","programming","programming-language","snippets","technology","template"],"latest_commit_sha":null,"homepage":"https://www.archisman.org","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArchismanKarmakar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T06:55:15.000Z","updated_at":"2023-07-18T09:35:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"157f75e2-bb72-41ce-bf21-a4ef808863c8","html_url":"https://github.com/ArchismanKarmakar/C-_template_AK","commit_stats":null,"previous_names":["archismankarmakar/c-_template_ak"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchismanKarmakar%2FC-_template_AK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchismanKarmakar%2FC-_template_AK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchismanKarmakar%2FC-_template_AK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArchismanKarmakar%2FC-_template_AK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArchismanKarmakar","download_url":"https://codeload.github.com/ArchismanKarmakar/C-_template_AK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242995884,"owners_count":20218815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codechef","codeforces","competitive-programming","computer-programming","cpp","cpp-all","cpp17","cpp20","leetcode","programming","programming-language","snippets","technology","template"],"created_at":"2024-11-17T03:19:20.341Z","updated_at":"2025-03-11T07:52:24.154Z","avatar_url":"https://github.com/ArchismanKarmakar.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C-_template_AK\n\n## C++ template \u0026 snippet by Archisman Karmakar for CP.\n#\n#\n```cpp\n#include \u003ciostream\u003e\n#include \u003ccstdlib\u003e\n#include \u003cvector\u003e\n#include \u003calgorithm\u003e\n#include \u003ccmath\u003e\n#include \u003carray\u003e\n#include \u003cset\u003e\n#include \u003cmap\u003e\n#include \u003ccstring\u003e\n#include \u003cqueue\u003e\n#include \u003cstack\u003e\n#include \u003cchrono\u003e\n#include \u003crandom\u003e\n#include \u003cfunctional\u003e\n#include \u003climits\u003e\n\nusing namespace std;\n\n#define ll long long\n#define gc getchar_unlocked\n#define fo(i, n) for (i = 0; i \u003c n; i++)\n#define Fo(i, k, n) for (i = k; k \u003c n ? i \u003c n : i \u003e n; k \u003c n ? i += 1 : i -= 1)\n#define si(x) scanf(\"%d\", \u0026x)\n#define sl(x) scanf(\"%lld\", \u0026x)\n#define ss(s) scanf(\"%s\", s)\n#define pi(x) printf(\"%d\\n\", x)\n#define pl(x) printf(\"%lld\\n\", x)\n#define ps(s) printf(\"%s\\n\", s)\n#define deb(x) cout \u003c\u003c #x \u003c\u003c \"=\" \u003c\u003c x \u003c\u003c endl\n#define deb2(x, y) cout \u003c\u003c #x \u003c\u003c \"=\" \u003c\u003c x \u003c\u003c \",\" \u003c\u003c #y \u003c\u003c \"=\" \u003c\u003c y \u003c\u003c endl\n#define pb push_back\n#define mp make_pair\n#define F first\n#define S second\n#define all(x) x.begin(), x.end()\n#define clr(x) memset(x, 0, sizeof(x))\n#define sortall(x) sort(all(x))\n#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)\n#define PI 3.1415926535897932384626\ntypedef pair\u003cint, int\u003e pii;\ntypedef pair\u003cll, ll\u003e pl;\ntypedef vector\u003cint\u003e vi;\ntypedef vector\u003cll\u003e vl;\ntypedef vector\u003cpii\u003e vpii;\ntypedef vector\u003cpl\u003e vpl;\ntypedef vector\u003cvi\u003e vvi;\ntypedef vector\u003cvl\u003e vvl;\nmt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());\nint rng(int lim)\n{\n    uniform_int_distribution\u003cint\u003e uid(0, lim - 1);\n    return uid(rang);\n}\nint mpow(int base, int exp);\nvoid ipgraph(int n, int m);\nvoid dfs(int u, int par);\n\nconst int mod = 1'000'000'007;\nconst int N = 3e5, M = N;\n//=======================\n\nvi g[N];\nint a[N];\n\nint mpow(int base, int exp)\n{\n    base %= mod;\n    int result = 1;\n    while (exp \u003e 0)\n    {\n        if (exp \u0026 1)\n            result = ((ll)result * base) % mod;\n        base = ((ll)base * base) % mod;\n        exp \u003e\u003e= 1;\n    }\n    return result;\n}\n\nvoid ipgraph(int n, int m)\n{\n    int i, u, v;\n    while (m--)\n    {\n        cin \u003e\u003e u \u003e\u003e v;\n        u--, v--;\n        g[u].pb(v);\n        g[v].pb(u);\n    }\n}\n\nvoid dfs(int u, int par)\n{\n    for (int v : g[u])\n    {\n        if (v == par)\n            continue;\n        dfs(v, u);\n    }\n}\n\nvoid selfDestruct(char *argv)\n{\n    char *process_name = argv;\n    char command[256] = \"rm \";\n    strcat(command, process_name);\n    system(command);\n}\n\nint main(int argc, char *argv[])\n{\n    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);\n#ifndef ONLINE_JUDGE\n    freopen(\"input.txt\", \"r\", stdin);   // input.txt\n    freopen(\"output.txt\", \"w\", stdout); // output.txt\n#endif\n\n    // Your Code Goes Here.\n\n    selfDestruct(argv[0]);\n\n    return 0;\n}\n```\n\n#\n#\n#### Without Online Sync and IO in text file:\n```cpp\n#include \u003ciostream\u003e\n#include \u003ccstdlib\u003e\n#include \u003cvector\u003e\n#include \u003calgorithm\u003e\n#include \u003ccmath\u003e\n#include \u003carray\u003e\n#include \u003cset\u003e\n#include \u003cmap\u003e\n#include \u003ccstring\u003e\n#include \u003cqueue\u003e\n#include \u003cstack\u003e\n#include \u003cchrono\u003e\n#include \u003crandom\u003e\n#include \u003cfunctional\u003e\n#include \u003climits\u003e\n\nusing namespace std;\n\n#define ll long long\n#define gc getchar_unlocked\n#define fo(i, n) for (i = 0; i \u003c n; i++)\n#define Fo(i, k, n) for (i = k; k \u003c n ? i \u003c n : i \u003e n; k \u003c n ? i += 1 : i -= 1)\n#define si(x) scanf(\"%d\", \u0026x)\n#define sl(x) scanf(\"%lld\", \u0026x)\n#define ss(s) scanf(\"%s\", s)\n#define pi(x) printf(\"%d\\n\", x)\n#define pl(x) printf(\"%lld\\n\", x)\n#define ps(s) printf(\"%s\\n\", s)\n#define deb(x) cout \u003c\u003c #x \u003c\u003c \"=\" \u003c\u003c x \u003c\u003c endl\n#define deb2(x, y) cout \u003c\u003c #x \u003c\u003c \"=\" \u003c\u003c x \u003c\u003c \",\" \u003c\u003c #y \u003c\u003c \"=\" \u003c\u003c y \u003c\u003c endl\n#define pb push_back\n#define mp make_pair\n#define F first\n#define S second\n#define all(x) x.begin(), x.end()\n#define clr(x) memset(x, 0, sizeof(x))\n#define sortall(x) sort(all(x))\n#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)\n#define PI 3.1415926535897932384626\ntypedef pair\u003cint, int\u003e pii;\ntypedef pair\u003cll, ll\u003e pl;\ntypedef vector\u003cint\u003e vi;\ntypedef vector\u003cll\u003e vl;\ntypedef vector\u003cpii\u003e vpii;\ntypedef vector\u003cpl\u003e vpl;\ntypedef vector\u003cvi\u003e vvi;\ntypedef vector\u003cvl\u003e vvl;\nmt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());\nint rng(int lim)\n{\n    uniform_int_distribution\u003cint\u003e uid(0, lim - 1);\n    return uid(rang);\n}\nint mpow(int base, int exp);\nvoid ipgraph(int n, int m);\nvoid dfs(int u, int par);\n\nconst int mod = 1'000'000'007;\nconst int N = 3e5, M = N;\n//=======================\n\nvi g[N];\nint a[N];\n\nint mpow(int base, int exp)\n{\n    base %= mod;\n    int result = 1;\n    while (exp \u003e 0)\n    {\n        if (exp \u0026 1)\n            result = ((ll)result * base) % mod;\n        base = ((ll)base * base) % mod;\n        exp \u003e\u003e= 1;\n    }\n    return result;\n}\n\nvoid ipgraph(int n, int m)\n{\n    int i, u, v;\n    while (m--)\n    {\n        cin \u003e\u003e u \u003e\u003e v;\n        u--, v--;\n        g[u].pb(v);\n        g[v].pb(u);\n    }\n}\n\nvoid dfs(int u, int par)\n{\n    for (int v : g[u])\n    {\n        if (v == par)\n            continue;\n        dfs(v, u);\n    }\n}\n\nvoid selfDestruct(char *argv)\n{\n    char *process_name = argv;\n    char command[256] = \"rm \";\n    strcat(command, process_name);\n    system(command);\n}\n\nint main(int argc, char *argv[])\n{\n\n    // Your Code Goes Here.\n\n    selfDestruct(argv[0]);\n\n    return 0;\n}\n```\n\n#\n#\n#### Credit: [Archisman Karmakar](https://github.com/ArchismanKarmakar/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchismankarmakar%2Fc-_template_ak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchismankarmakar%2Fc-_template_ak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchismankarmakar%2Fc-_template_ak/lists"}