add ucpc2026-B and ucpc2026-F and complete 1379.rs
This commit is contained in:
35
storage/contest/cpp/ucpc2026-B.cpp
Normal file
35
storage/contest/cpp/ucpc2026-B.cpp
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#define let auto
|
||||||
|
#define fn auto
|
||||||
|
typedef size_t us;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
fn fastio() {
|
||||||
|
ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Bread {
|
||||||
|
us p, t, f;
|
||||||
|
};
|
||||||
|
|
||||||
|
fn main() -> int {
|
||||||
|
fastio();
|
||||||
|
us n;
|
||||||
|
cin >> n;
|
||||||
|
let breads = vector<Bread>(n);
|
||||||
|
|
||||||
|
for (us i=0;i<n;i++){
|
||||||
|
us p, t, f;
|
||||||
|
cin >> p >> t >> f;
|
||||||
|
breads[i].p = p; // prepare
|
||||||
|
breads[i].t = t; // time to bake
|
||||||
|
breads[i].f = f; // fresh
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
50
storage/contest/cpp/ucpc2026-F.cpp
Normal file
50
storage/contest/cpp/ucpc2026-F.cpp
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#define let auto
|
||||||
|
#define fn auto
|
||||||
|
#define usize size_t
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
fn fastio() {
|
||||||
|
ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() -> int {
|
||||||
|
fastio();
|
||||||
|
usize n, q;
|
||||||
|
|
||||||
|
cin >> n >> q;
|
||||||
|
let a = vector<usize>(n);
|
||||||
|
let b = vector<usize>(n);
|
||||||
|
|
||||||
|
for (usize i = 0; i < n; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
}
|
||||||
|
for (usize i = 0; i < n; i++) {
|
||||||
|
cin >> b[i];
|
||||||
|
}
|
||||||
|
for (usize i = 0; i < q; i++) {
|
||||||
|
usize l, r, k;
|
||||||
|
cin >> l >> r >> k;
|
||||||
|
l -= 1;
|
||||||
|
k -= 1;
|
||||||
|
r -= 1;
|
||||||
|
let x = k - l;
|
||||||
|
|
||||||
|
let w1 = a[x + l];
|
||||||
|
let w2 = b[x + l];
|
||||||
|
let wo1 = a[r - x];
|
||||||
|
let wo2 = b[r - x];
|
||||||
|
|
||||||
|
if (x == 0) {
|
||||||
|
cout << "(" << "\n";
|
||||||
|
} else if (x == r - l) {
|
||||||
|
cout << ")" << "\n";
|
||||||
|
} else {
|
||||||
|
if (w1 + wo2 > w2 + wo2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
storage/jungol/rs/1379.rs
Normal file
14
storage/jungol/rs/1379.rs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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 n = iter.next().unwrap();
|
||||||
|
let m = iter.next().unwrap();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user