# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
859874 | 2023-10-11T00:54:33 Z | Boycl07 | 송금 (JOI19_remittance) | C++17 | 1000 ms | 2396 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 1; i <= n; ++i) #define forn(i, l, r) for(int i = l; i <= r; ++i) #define ford(i, r, l) for(int i = r; i >= l; --i) #define FOR(i, n) for(int i = 0; i < n; ++i) #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define task "MEETING" #define endl "\n" #define sz(a) int(a.size()) #define C(x, y) make_pair(x, y) #define all(a) (a).begin(), (a).end() #define bit(i, mask) (mask >> i & 1) template<typename T> bool maximize(T &res, const T &val) { if (res < val){ res = val; return true; }; return false; } template<typename T> bool minimize(T &res, const T &val) { if (res > val){ res = val; return true; }; return false; } const int N = 1e6 + 10; const int N1 = 2e3 + 10; const int K = 1e2 + 1; const int MOD = 1e9 + 7; const int INF = 1e9 + 1; const int block_size = 230; const int LOG = 13; const int offset = N; const int LIM = 2e5; const int AL = 26; const int M = 11; const int lim = (1 << 10) - 1; int n; int a[N], b[N]; void solve() { cin >> n; rep(i, n) cin >> a[i] >> b[i]; while(true) { bool flag = 0; rep(i, n) { if(a[i] > b[i]) { flag = 1; a[i % n + 1] += a[i] / 2; a[i] %= 2; } } if(!flag) break; } bool flag = 1; rep(i, n) flag &= a[i] == b[i]; if(flag) cout << "Yes"; else cout << "No"; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen("trie.inp", "r")) { freopen("trie.inp", "r", stdin); freopen("trie.out", "w", stdout); } int TC = 1; while(TC--) { solve(); cout << endl; } return 0; } //ha
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2396 KB | Output is correct |
2 | Correct | 0 ms | 2396 KB | Output is correct |
3 | Correct | 0 ms | 2396 KB | Output is correct |
4 | Correct | 1 ms | 2396 KB | Output is correct |
5 | Correct | 0 ms | 2396 KB | Output is correct |
6 | Correct | 0 ms | 2396 KB | Output is correct |
7 | Execution timed out | 1072 ms | 2396 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2396 KB | Output is correct |
2 | Correct | 0 ms | 2396 KB | Output is correct |
3 | Correct | 0 ms | 2396 KB | Output is correct |
4 | Correct | 1 ms | 2396 KB | Output is correct |
5 | Correct | 0 ms | 2396 KB | Output is correct |
6 | Correct | 0 ms | 2396 KB | Output is correct |
7 | Execution timed out | 1072 ms | 2396 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2396 KB | Output is correct |
2 | Correct | 0 ms | 2396 KB | Output is correct |
3 | Correct | 0 ms | 2396 KB | Output is correct |
4 | Correct | 1 ms | 2396 KB | Output is correct |
5 | Correct | 0 ms | 2396 KB | Output is correct |
6 | Correct | 0 ms | 2396 KB | Output is correct |
7 | Execution timed out | 1072 ms | 2396 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |