이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |