Compare commits

..

17 Commits

Author SHA1 Message Date
bc1489d320 complete ojuz/KAISTRUN26SPRING_A.cpp 2026-05-08 15:57:19 +09:00
cfb65a4c2d complete jungol/1000.rs 2026-05-06 18:19:34 +09:00
8f0ec6cead hotfix run.py run 2026-05-06 18:11:19 +09:00
be454e4420 Merge branch 'dev' 2026-05-06 18:00:46 +09:00
b4dff1d344 fix StorageManager save, read expression and operation
fix create
fix export; not remove src space
2026-05-06 03:02:05 +09:00
b3cd28471e fix export command to clear space state 2026-05-06 02:53:30 +09:00
b15648a17c fix StateManager to save the state 2026-05-06 02:51:41 +09:00
bfb79e573d fix create 2026-05-06 02:40:41 +09:00
34eac82c7a refactoring stage 8
- minor refactoring
- version
- status
2026-05-06 02:36:37 +09:00
d4aaefa130 refactoring stage 7
- implement StorageManager list_entries
- fix show
- fix find
- fix some minor
2026-05-06 02:22:28 +09:00
7706721eb1 refactoring stage 6
- enhance state command
- enhance init
2026-05-06 00:57:45 +09:00
df8fb68a1d refactoring stage 5
- fix export command
2026-05-05 20:04:07 +09:00
97f1636c57 refactoring stage 4
- modify StateManager to accept Language
- fix load command
- modify create command
2026-05-05 17:42:51 +09:00
843f2ef321 refactoring stage 3
- run command
2026-05-05 15:22:53 +09:00
63ecdae57b refactoring stage 2 2026-05-03 12:40:23 +09:00
21d51e4af9 refactoring stage 1
- add StorageManager StateManager
- use pathlib

Co-authored-by: Copilot <copilot@github.com>
2026-05-03 01:09:31 +09:00
b9a8ea6bad update run.py inorder to ensure there is folder to store file 2026-05-02 07:59:08 +09:00
3 changed files with 843 additions and 989 deletions

1702
run.py

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
use std::io::{read_to_string, stdin};
fn main() {
let temp = read_to_string(stdin()).unwrap();
let mut iter = temp
.split_ascii_whitespace()
.map(|x| x.parse::<usize>().unwrap());
let a = iter.next().unwrap();
let b = iter.next().unwrap();
println!("{}", a + b);
}

View File

@@ -0,0 +1,113 @@
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdint>
#define let auto
#define fn auto
#define usize size_t
using u32 = uint32_t;
using namespace std;
const u32 KX = 123456789;
const u32 KY = 362436069;
const u32 KZ = 521288629;
const u32 KW = 88675123;
fn fastio() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
struct Rand {
u32 x, y, z, w;
static Rand new_seed(u32 seed) {
return {KX ^ seed, KY ^ seed, KZ, KW};
}
u32 rand() {
u32 t = x ^ (x << 11);
x = y;
y = z;
z = w;
w ^= (w >> 19) ^ t ^ (t >> 8);
return w;
}
template<typename T>
void shuffle(vector<T>& a) {
if (a.empty()) return;
usize i = a.size() - 1;
while (i > 0) {
usize j = rand() % (i + 1);
swap(a[i], a[j]);
i--;
}
}
u32 rand_range(u32 a, u32 b) {
u32 m = b - a + 1;
return a + rand() % m;
}
double rand_float() {
return static_cast<double>(rand()) / static_cast<double>((u32)-1);
}
};
fn main() -> int {
fastio();
istreambuf_iterator<char> it(cin), end;
string temp(it, end);
vector<u32> vals;
usize pos = 0;
while (pos < temp.size()) {
while (pos < temp.size() && isspace(temp[pos])) pos++;
if (pos >= temp.size()) break;
usize start = pos;
while (pos < temp.size() && !isspace(temp[pos])) pos++;
vals.push_back(stoul(temp.substr(start, pos - start)));
}
auto it2 = vals.begin();
u32 n = *it2++;
u32 m = *it2++;
vector<tuple<u32, u32, u32, u32, u32>> requests;
for (u32 i = 0; i < m; i++) {
u32 w = *it2++ - 1;
u32 x = *it2++ - 1;
u32 y = *it2++ - 1;
u32 z = *it2++ - 1;
u32 k = *it2++;
requests.emplace_back(w, x, y, z, k);
}
u32 trial = 0;
while (true) {
Rand rand = Rand::new_seed(trial);
vector<u32> music(n);
for (u32 i = 0; i < n; i++) {
music[i] = rand.rand_range(0, 3);
}
u32 cnt = 0;
for (const auto& req : requests) {
u32 w, x, y, z, k;
tie(w, x, y, z, k) = req;
if ((music[w] + music[x] + music[y] + music[z]) % 4 == k) {
cnt++;
}
}
if (m / 4 <= cnt) {
for (u32 a : music) {
cout << a << ' ';
}
break;
}
trial++;
}
return 0;
}