Submission #502214

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5022142022-01-05 14:00:35vrohakXylophone (JOI18_xylophone)C++14
0 / 100
0 ms200 KiB
#include <bits/stdc++.h>
#include "xylophone.h"
using namespace std;
void solve (int n){
//ako je x pozitivan //ako je x pozitivan //ako je x pozitivan //ako je x pozitivan //ako je x pozitivan //ako je x pozitivan //ako je x pozitivan //ako je x pozitivan
int rj1[n + 65], l1, l2, l3, stg1 = 0; rj1[1]=0;
int odg1 = query(1, 2); l1=odg1;
int odg2 = query(2, 3); l2=odg2;
int odg3 = query(1, 3); l3=odg3;
rj1[2] = odg1;
if (odg3 == odg2 + odg1){
rj1[3] = odg1 + odg2;
}
else {
stg1 = 1;
rj1[3] = odg1 - odg2;
}
int od1[n + 65], od2[n + 56], od3[n + 99];
for (int i = 4; i < n + 1; i++){
odg1 = odg2; odg2 = query(i-1, i); odg3 = query(i-2, i);
od1[i]=odg1; od2[i]=odg2; od3[i]=odg3;
if (stg1 == 0){
if (odg3 == odg2 + odg1){
rj1[i] = rj1[i - 1] + odg2;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:102:16: warning: unused variable 'mp2' [-Wunused-variable]
  102 |   int mp1 = 0, mp2 = 0, pro = 0, niz[n + 55];
      |                ^~~
xylophone.cpp:102:34: warning: unused variable 'niz' [-Wunused-variable]
  102 |   int mp1 = 0, mp2 = 0, pro = 0, niz[n + 55];
      |                                  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...