Submission #125190

# Submission time Handle Problem Language Result Execution time Memory
125190 2019-07-04T20:19:18 Z figter001 Highway design (CEOI12_highway) C++17
0 / 100
2 ms 632 KB
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=(j); i<=(k); i++)
#define FFOR(i, j, k) for(int i=(j); i<(k); i++)
#define DFOR(i, j, k) for(int i=(j); i>=(k); i--)
#define bug(x) cerr<<#x<<" = "<<(x)<<'\n'
#define pb push_back
#define mp make_pair
#define bit(s, i) (((s)>>(i))&1LL)
#define mask(i) ((1LL<<(i)))
#define builtin_popcount __builtin_popcountll
#define __builtin_popcount __builtin_popcountll
using ll=long long; using ld=long double;
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); const ld pi=acos(0)*2;
template <typename T> inline void read(T &x){char c; bool nega=0; while((!isdigit(c=getchar()))&&(c!='-')); if(c=='-'){nega=1; c=getchar();} x=c-48; while(isdigit(c=getchar())) x=x*10+c-48; if(nega) x=-x;}
template <typename T> inline void writep(T x){if(x>9) writep(x/10); putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){ putchar('-'); x=-x;} writep(x);}
template <typename T> inline void writeln(T x){write(x); putchar('\n');}
#define taskname "Highway"
#ifdef Aria
    void Answer(int a, int b, int c, int d){}
    bool isOnLine(int a, int b, int c){}
    int GetN(){};
#else
#include "office.h"
#endif
bool vis[11][11][11];
int n;
int a=1;
int x, y, z, t;
void answer(int a, int b, int c, int d){
//    assert(a);
//    assert(b);
//    assert(c);
//    assert(d);
//    assert(a!=b);
//    assert(a!=c);
//    assert(a!=d);
//    assert(b!=c);
//    assert(b!=d);
//    assert(c!=d);
    Answer(a, b, c, d);
    exit(0);
}
bool isonline(int a, int b, int c){
//    assert(a);
//    assert(b);
//    assert(c);
//    assert(a!=b);
//    assert(a!=c);
//    assert(b!=c);
    return isOnLine(a, b, c);
}
vector <int> all;
int main(){
   int n = GetN();
  vector<int> a = {1,2,3,4,5};
  do{
    vector<int> cur;
    cur.push_back(a[0]);
    cur.push_back(a[1]);
    cur.push_back(a[2]);
    sort(cur.begin(),cur.end());
    int x = cur[0],y = cur[1],z = cur[2];
    if(vis[x][y][z])continue;
    vis[x][y][z] = 1;
    int res = isOnLine(x,y,z);
    if(res == 1){
      Answer(x,y,cur[3],cur[4]);
      return 0;
    }
  }while(next_permutation(a.begin(),a.end()));
}

Compilation message

highway.cpp: In function 'int main()':
highway.cpp:56:8: warning: unused variable 'n' [-Wunused-variable]
    int n = GetN();
        ^
office.c: In function 'int isOnLine(int, int, int)':
office.c:85:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     _Fin(0, "Protocol error");
                             ^
office.c:88:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     _Fin(0, "Protocol error");
                             ^
office.c:92:37: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     _Fin(false, "Too many questions");
                                     ^
office.c:83:7: warning: unused variable 'i' [-Wunused-variable]
   int i;
       ^
office.c: In function 'void Answer(int, int, int, int)':
office.c:123:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     _Fin(0, "Protocol error");
                             ^
office.c:128:44: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
       if( (-_Apa[na1]==_N-3) && (na2!=na1) && (nb2!=na1) ||
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
office.c:130:30: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          _Fin(true, "Correct");
                              ^
office.c:132:36: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          _Fin(false, "Wrong answer");
                                    ^
office.c:134:44: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
       if( (-_Apa[na2]==_N-3) && (na1!=na2) && (nb1!=na2) ||
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
office.c:136:30: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          _Fin(true, "Correct");
                              ^
office.c:138:36: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          _Fin(false, "Wrong answer");
                                    ^
office.c:140:33: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
       _Fin(false, "Wrong answer");
                                 ^
office.c:142:23: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   _Fin(true, "Correct");
                       ^
office.c:120:27: warning: unused variable 'pont' [-Wunused-variable]
   int na1, nb1, na2, nb2, pont;
                           ^~~~
office.c: In function 'void _doInit()':
office.c:33:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &_N);
     ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct - Protocol error
2 Incorrect 2 ms 256 KB Output isn't correct - Protocol error
3 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
4 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
5 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
6 Incorrect 2 ms 256 KB Output isn't correct - Protocol error
7 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
8 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
9 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
10 Incorrect 2 ms 404 KB Output isn't correct - Protocol error
11 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
12 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
13 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
14 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
15 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
16 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
17 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
18 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
19 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
20 Incorrect 2 ms 376 KB Output isn't correct - Protocol error
21 Incorrect 2 ms 508 KB Output isn't correct - Protocol error
22 Incorrect 2 ms 504 KB Output isn't correct - Protocol error
23 Incorrect 2 ms 632 KB Output isn't correct - Protocol error
24 Incorrect 2 ms 632 KB Output isn't correct - Protocol error
25 Incorrect 2 ms 632 KB Output isn't correct - Protocol error