Submission #1279172

#TimeUsernameProblemLanguageResultExecution timeMemory
1279172asedreLjeto (COCI21_ljeto)C++20
25 / 50
2 ms580 KiB
// written by Asedre #include <iostream> #include <cmath> #include <climits> #include <set> #include <map> #include <iomanip> #include <vector> #include <string> #include <algorithm> #include <utility> #include <queue> #include <numeric> #include <stack> #include <assert.h> #include <unordered_set> #include <cstring> #include <unordered_map> #define pb push_back #define ll long long #define ld long double #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define ull unsigned long long using namespace std; const int maxv = 1e6 + 3, maxn = 1e6 + 12, LOG = 25; const ll inf = 1e18 + 5; const int MOD = 1e9 + 7, MOD2 = 1338519349; const double PI = 3.14159265359; //prime nums: 9059, 5419, 3571 void teztez( ) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); }/* ll binpow(ll x, ll p, ll mod) { if (!p) return 1; if (p % 2) return (x % mod * binpow(x, p - 1, mod)) % mod; ll xx = binpow(x, p / 2, mod); return (xx % mod * xx % mod) % mod; } */ ll binpow(ll x, ll p) { if (!p) return 1; if (p % 2) return (x % MOD * binpow(x, p - 1) % MOD) % MOD; ll xx = binpow(x, p / 2) % MOD; return (xx * xx) % MOD; } ll gcd(ll a,ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); } struct datta { int sec, p1, p2; }; int last[maxv]; void solve( ) { int n; cin >> n; int tm1 = 0, tm2 = 0; for (int i = 1; i <= n; i ++) { datta x; cin >> x.sec >> x.p1 >> x.p2; if (x.p1 <= 4) { tm1 += 100; if (x.sec - last[x.p1] <= 10) tm1 += 50; last[x.p1] = x.sec; } else { tm2 += 100; if (x.sec - last[x.p1] <= 10) tm2 += 50; last[x.p1] = x.sec; } } cout << tm1 << " " << tm2 << "\n"; } signed main( ) { teztez( ); //freopen("angle2.in", "r", stdin); freopen("angle2.out", "w", stdout); int testcases = 1; //cin >> testcases; while (testcases--) { solve( ); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...