제출 #529134

#제출 시각아이디문제언어결과실행 시간메모리
529134alireza_kavianiNaan (JOI19_naan)C++11
5 / 100
1 ms448 KiB
#include <algorithm> #include <iostream> #include <numeric> #include <cstring> #include <iomanip> #include <vector> #include <bitset> #include <stack> #include <queue> #include <cmath> #include <set> #include <map> using namespace std; typedef long long ll; #define int ll typedef long double ld; typedef pair<int, int> pii; const int maxn = 2012; int vals[maxn][maxn]; int sum[maxn]; int32_t main() { ios::sync_with_stdio(false); cin.tie(0); int n, l; cin >> n >> l; for(int i = 0; i < n; i++) { for(int j = 0; j < l; j++) { cin >> vals[i][j]; sum[i] += vals[i][j]; } } int a = sum[0]; int b = sum[1]; pii x; int s = 0; int s2 = 0; for(int i = 0; i < l; i++) { int r = vals[0][i]; int u = vals[1][i]; if( 2*(s + r) < a ) { s += r; s2 += u; } else { x = {a-2*s + 2*i*r, 2*r}; cout << (a-2*s + 2*i*r) << " " << 2*r << endl; if( 2*s2 + u*(a-2*s) < b*r ) cout << "1 2" << endl; else cout << "2 1" << endl; return 0; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...