이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3")
#include "Anna.h"
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define pill pair<ll, ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pld pair<ld, ld>
using namespace std;
namespace {
}
int Declare() {
return 2000;
}
pair<vector<int>, vector<int> > Anna(long long A) {
vector<int> X;
vector<int> Y;
if(A > 4e6)return mp(X, Y);
A--;
for(int j = 2; j <= 4000; j += 2) {
if(A > j){
A -= (j + 1);
continue;
}
int k = A;
ll z = min(k, j/2);
ll ost = k - z;
while(z--)X.pb(1);
while(ost--)Y.pb(1);
while(X.size() < j/2)X.pb(0);
while(Y.size() < j/2)Y.pb(0);
break;
}
return make_pair(X, Y);
}
#include "Bruno.h"
#include <utility>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define pill pair<ll, ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pld pair<ld, ld>
using namespace std;
namespace {
int variable_example = 0;
}
long long Bruno(std::vector<int> u) {
int cnt = 0;
for(auto v : u)
cnt += v;
ll L = 0;
for(int j = 2; j < u.size(); j += 2) {
L += (j + 1);
}
return L + cnt + 1;
}
컴파일 시 표준 에러 (stderr) 메시지
Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:38:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
38 | while(X.size() < j/2)X.pb(0);
| ~~~~~~~~~^~~~~
Anna.cpp:39:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
39 | while(Y.size() < j/2)Y.pb(0);
| ~~~~~~~~~^~~~~
Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:26:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for(int j = 2; j < u.size(); j += 2) {
| ~~^~~~~~~~~~
Bruno.cpp: At global scope:
Bruno.cpp:17:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
17 | int variable_example = 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |