updated some plugins

This commit is contained in:
Code Lich 2025-03-25 15:58:09 +07:00
parent 611d0d3e95
commit fe1b7ae89e
3 changed files with 51 additions and 2 deletions

View File

@ -3,6 +3,7 @@
-- require("custom.plugins") -- Custom plugins -- require("custom.plugins") -- Custom plugins
require 'custom.snippets.edhliicpp' -- Custom snippets require 'custom.snippets.edhliicpp' -- Custom snippets
require 'custom.snippets.edhliic' -- Custom snippets require 'custom.snippets.edhliic' -- Custom snippets
require 'custom.snippets.testgen'
-- Set some editor options -- Set some editor options
vim.opt.number = true vim.opt.number = true

View File

@ -13,8 +13,8 @@ ls.add_snippets('cpp', {
'using namespace std;', 'using namespace std;',
'typedef long long ll;', 'typedef long long ll;',
'typedef unsigned long long ull;', 'typedef unsigned long long ull;',
'const int N = 1E6 + 3;', 'const int N = 1000006;',
'const ll MOD = 1E9 + 7;', 'const ll MOD = 1000000007;',
'', '',
'int main() {', 'int main() {',
' ios_base::sync_with_stdio(false);', ' ios_base::sync_with_stdio(false);',

View File

@ -0,0 +1,48 @@
local ls = require 'luasnip'
local s = ls.snippet
local t = ls.text_node
ls.add_snippets('cpp', {
s('testgen', {
t {
'#include <bits/stdc++.h>',
'#define NAME "BAI1"',
'using namespace std;',
'typedef long long ll;',
'typedef unsigned long long ull;',
'const int N = 1000006;',
'const ll MOD = 1000000007;',
'',
'const int NTEST = 100;',
'mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());',
'',
'long long Rand(long long l, long long h) {',
' unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();',
' mt19937 gen(seed);',
' uniform_int_distribution<long long> dis(l, h);',
' long long x = dis(gen);',
' return x;',
'}',
'',
'void MakeTest() {',
' ofstream cout(NAME ".INP");',
' cout << "test";',
'}',
'',
'int main() {',
' srand(time(0));',
' for (int iTest = 1; iTest <= NTEST; iTest++) {',
' MakeTest();',
' system("./" NAME "_trau");',
' system("./" NAME);',
' if (system("diff " NAME ".OUT " NAME ".ANS") != 0) {',
' cout << "Test " << iTest << ": WRONG!\\n";',
' return 0;',
' }',
' cout << "Test " << iTest << ": CORRECT!\\n";',
' }',
' return 0;',
'}',
},
}),
})