제출 #1073663

#제출 시각아이디문제언어결과실행 시간메모리
1073663beaconmc철로 (IOI14_rail)C++14
컴파일 에러
0 ms0 KiB
• #include "rail.h" • #include <bits/stdc++.h> • typedef long long ll; • #define FOR(i,x,y) for(ll i=x; i<y; i++) • #define FORNEG(i,x,y) for(ll i=x; i>y; i--) • using namespace std; • const ll maxn = 5005; • ll distzero[5005]; • ll distone[5005]; • bool cmp(ll a, ll b){ • return distone[a]<distone[b]; • } • bool cmp2(ll a, ll b){ • return distzero[a]<distzero[b]; • } • void findLocation(int N, int first, int location[], int stype[]) • { • ll minval = 1000000000000; • ll one = -1; • location[0] = first; • stype[0] = 1; • FOR(i,1,N){ • ll dist = getDistance(i,0); • distzero[i] = dist; • if (dist < minval){ • minval = dist; • one = i; • } • } • location[one] = first+minval; • stype[one] = 2; • // cout << "FUCK" << endl; • // cout << minval << endl; • // cout << one << " " << location[one] << " " << endl; • ll fakemini = 1000000000; • FOR(i,1,N){ • if (i==one) continue; • distone[i] = getDistance(i,one); • fakemini = min(fakemini, distone[i]); • } •   • vector<ll> lefts, rights; • FOR(i,1,N){ • if (i==one) continue; • // cout << i << " " << distzero[i] << " " << distone[i] << "FUCK" << endl; • if (distzero[i] >= distone[i]+minval) lefts.push_back(i); • else rights.push_back(i); • } • // cout << "LMAO" << rights.size() << endl; • sort(lefts.begin(), lefts.end(), cmp); • reverse(lefts.begin(), lefts.end()); • while (lefts.size() && distone[lefts[lefts.size()-1]] < minval){ • ll temp = lefts[lefts.size()-1]; • location[temp] = location[one] - distone[temp]; • stype[temp] = 1; • lefts.pop_back(); • } • reverse(lefts.begin(), lefts.end()); • ll cur = -1; • if (lefts.size()){ • ll temp = lefts[0]; • location[temp] = location[one] - distone[temp]; • cur = lefts[0]; • stype[temp] = 1; • } • FOR(i,1,lefts.size()){ • ll temp = lefts[i]; • ll dist = getDistance(temp, cur); • // cout << "FUCK" << dist << " " << distone[cur] << " " << distone[temp] << endl; • if (dist + distone[cur] == distone[temp]){ • location[temp] = location[cur] + dist; • stype[temp] = 2; • }else{ • location[temp] = location[one] - distone[temp]; • stype[temp] = 1; • cur = temp; • } • } • sort(rights.begin(), rights.end(), cmp2); • if (rights.size()){ • ll temp = rights[0]; • location[temp] = location[0] + distzero[temp]; • cur = rights[0]; • stype[temp] = 2; • } • FOR(i,1,rights.size()){ • ll temp = rights[i]; • ll dist = getDistance(temp, cur); • if (dist + distzero[cur] == distzero[temp]){ • location[temp] = location[cur] - dist; • stype[temp] = 1; • }else{ • location[temp] = location[0] + distzero[temp]; • stype[temp] = 2; • cur = temp; • } • } • // FOR(i,0,N){ • // cout << location[i] << " "; • // } • // cout << endl; • }

컴파일 시 표준 에러 (stderr) 메시지

rail.cpp:2:1: error: extended character • is not valid in an identifier
    2 | • #include "rail.h"
      | ^
rail.cpp:2:5: error: stray '#' in program
    2 | • #include "rail.h"
      |   ^
rail.cpp:4:1: error: extended character • is not valid in an identifier
    4 | • #include <bits/stdc++.h>
      | ^
rail.cpp:4:5: error: stray '#' in program
    4 | • #include <bits/stdc++.h>
      |   ^
rail.cpp:6:1: error: extended character • is not valid in an identifier
    6 | • typedef long long ll;
      | ^
rail.cpp:8:1: error: extended character • is not valid in an identifier
    8 | • #define FOR(i,x,y) for(ll i=x; i<y; i++)
      | ^
rail.cpp:8:5: error: stray '#' in program
    8 | • #define FOR(i,x,y) for(ll i=x; i<y; i++)
      |   ^
rail.cpp:10:1: error: extended character • is not valid in an identifier
   10 | • #define FORNEG(i,x,y) for(ll i=x; i>y; i--)
      | ^
rail.cpp:10:5: error: stray '#' in program
   10 | • #define FORNEG(i,x,y) for(ll i=x; i>y; i--)
      |   ^
rail.cpp:12:1: error: extended character • is not valid in an identifier
   12 | • using namespace std;
      | ^
rail.cpp:14:1: error: extended character • is not valid in an identifier
   14 | • const ll maxn = 5005;
      | ^
rail.cpp:16:1: error: extended character • is not valid in an identifier
   16 | • ll distzero[5005];
      | ^
rail.cpp:18:1: error: extended character • is not valid in an identifier
   18 | • ll distone[5005];
      | ^
rail.cpp:20:1: error: extended character • is not valid in an identifier
   20 | • bool cmp(ll a, ll b){
      | ^
rail.cpp:22:1: error: extended character • is not valid in an identifier
   22 | • return distone[a]<distone[b];
      | ^
rail.cpp:24:1: error: extended character • is not valid in an identifier
   24 | • }
      | ^
rail.cpp:26:1: error: extended character • is not valid in an identifier
   26 | • bool cmp2(ll a, ll b){
      | ^
rail.cpp:28:1: error: extended character • is not valid in an identifier
   28 | • return distzero[a]<distzero[b];
      | ^
rail.cpp:30:1: error: extended character • is not valid in an identifier
   30 | • }
      | ^
rail.cpp:32:1: error: extended character • is not valid in an identifier
   32 | • void findLocation(int N, int first, int location[], int stype[])
      | ^
rail.cpp:34:1: error: extended character • is not valid in an identifier
   34 | • {
      | ^
rail.cpp:36:1: error: extended character • is not valid in an identifier
   36 | • ll minval = 1000000000000;
      | ^
rail.cpp:38:1: error: extended character • is not valid in an identifier
   38 | • ll one = -1;
      | ^
rail.cpp:40:1: error: extended character • is not valid in an identifier
   40 | • location[0] = first;
      | ^
rail.cpp:42:1: error: extended character • is not valid in an identifier
   42 | • stype[0] = 1;
      | ^
rail.cpp:44:1: error: extended character • is not valid in an identifier
   44 | • FOR(i,1,N){
      | ^
rail.cpp:46:1: error: extended character • is not valid in an identifier
   46 | • ll dist = getDistance(i,0);
      | ^
rail.cpp:48:1: error: extended character • is not valid in an identifier
   48 | • distzero[i] = dist;
      | ^
rail.cpp:50:1: error: extended character • is not valid in an identifier
   50 | • if (dist < minval){
      | ^
rail.cpp:52:1: error: extended character • is not valid in an identifier
   52 | • minval = dist;
      | ^
rail.cpp:54:1: error: extended character • is not valid in an identifier
   54 | • one = i;
      | ^
rail.cpp:56:1: error: extended character • is not valid in an identifier
   56 | • }
      | ^
rail.cpp:58:1: error: extended character • is not valid in an identifier
   58 | • }
      | ^
rail.cpp:60:1: error: extended character • is not valid in an identifier
   60 | • location[one] = first+minval;
      | ^
rail.cpp:62:1: error: extended character • is not valid in an identifier
   62 | • stype[one] = 2;
      | ^
rail.cpp:64:1: error: extended character • is not valid in an identifier
   64 | • // cout << "FUCK" << endl;
      | ^
rail.cpp:66:1: error: extended character • is not valid in an identifier
   66 | • // cout << minval << endl;
      | ^
rail.cpp:68:1: error: extended character • is not valid in an identifier
   68 | • // cout << one << " " << location[one] << " " << endl;
      | ^
rail.cpp:70:1: error: extended character • is not valid in an identifier
   70 | • ll fakemini = 1000000000;
      | ^
rail.cpp:72:1: error: extended character • is not valid in an identifier
   72 | • FOR(i,1,N){
      | ^
rail.cpp:74:1: error: extended character • is not valid in an identifier
   74 | • if (i==one) continue;
      | ^
rail.cpp:76:1: error: extended character • is not valid in an identifier
   76 | • distone[i] = getDistance(i,one);
      | ^
rail.cpp:78:1: error: extended character • is not valid in an identifier
   78 | • fakemini = min(fakemini, distone[i]);
      | ^
rail.cpp:80:1: error: extended character • is not valid in an identifier
   80 | • }
      | ^
rail.cpp:82:1: error: extended character • is not valid in an identifier
   82 | •  
      | ^
rail.cpp:82:5: error: extended character   is not valid in an identifier
   82 | •  
      |   ^
rail.cpp:84:1: error: extended character • is not valid in an identifier
   84 | • vector<ll> lefts, rights;
      | ^
rail.cpp:86:1: error: extended character • is not valid in an identifier
   86 | • FOR(i,1,N){
      | ^
rail.cpp:88:1: error: extended character • is not valid in an identifier
   88 | • if (i==one) continue;
      | ^
rail.cpp:90:1: error: extended character • is not valid in an identifier
   90 | • // cout << i << " " << distzero[i] << " " << distone[i] << "FUCK" << endl;
      | ^
rail.cpp:92:1: error: extended character • is not valid in an identifier
   92 | • if (distzero[i] >= distone[i]+minval) lefts.push_back(i);
      | ^
rail.cpp:94:1: error: extended character • is not valid in an identifier
   94 | • else rights.push_back(i);
      | ^
rail.cpp:96:1: error: extended character • is not valid in an identifier
   96 | • }
      | ^
rail.cpp:98:1: error: extended character • is not valid in an identifier
   98 | • // cout << "LMAO" << rights.size() << endl;
      | ^
rail.cpp:100:1: error: extended character • is not valid in an identifier
  100 | • sort(lefts.begin(), lefts.end(), cmp);
      | ^
rail.cpp:102:1: error: extended character • is not valid in an identifier
  102 | • reverse(lefts.begin(), lefts.end());
      | ^
rail.cpp:104:1: error: extended character • is not valid in an identifier
  104 | • while (lefts.size() && distone[lefts[lefts.size()-1]] < minval){
      | ^
rail.cpp:106:1: error: extended character • is not valid in an identifier
  106 | • ll temp = lefts[lefts.size()-1];
      | ^
rail.cpp:108:1: error: extended character • is not valid in an identifier
  108 | • location[temp] = location[one] - distone[temp];
      | ^
rail.cpp:110:1: error: extended character • is not valid in an identifier
  110 | • stype[temp] = 1;
      | ^
rail.cpp:112:1: error: extended character • is not valid in an identifier
  112 | • lefts.pop_back();
      | ^
rail.cpp:114:1: error: extended character • is not valid in an identifier
  114 | • }
      | ^
rail.cpp:116:1: error: extended character • is not valid in an identifier
  116 | • reverse(lefts.begin(), lefts.end());
      | ^
rail.cpp:118:1: error: extended character • is not valid in an identifier
  118 | • ll cur = -1;
      | ^
rail.cpp:120:1: error: extended character • is not valid in an identifier
  120 | • if (lefts.size()){
      | ^
rail.cpp:122:1: error: extended character • is not valid in an identifier
  122 | • ll temp = lefts[0];
      | ^
rail.cpp:124:1: error: extended character • is not valid in an identifier
  124 | • location[temp] = location[one] - distone[temp];
      | ^
rail.cpp:126:1: error: extended character • is not valid in an identifier
  126 | • cur = lefts[0];
      | ^
rail.cpp:128:1: error: extended character • is not valid in an identifier
  128 | • stype[temp] = 1;
      | ^
rail.cpp:130:1: error: extended character • is not valid in an identifier
  130 | • }
      | ^
rail.cpp:132:1: error: extended character • is not valid in an identifier
  132 | • FOR(i,1,lefts.size()){
      | ^
rail.cpp:134:1: error: extended character • is not valid in an identifier
  134 | • ll temp = lefts[i];
      | ^
rail.cpp:136:1: error: extended character • is not valid in an identifier
  136 | • ll dist = getDistance(temp, cur);
      | ^
rail.cpp:138:1: error: extended character • is not valid in an identifier
  138 | • // cout << "FUCK" << dist << " " << distone[cur] << " " << distone[temp] << endl;
      | ^
rail.cpp:140:1: error: extended character • is not valid in an identifier
  140 | • if (dist + distone[cur] == distone[temp]){
      | ^
rail.cpp:142:1: error: extended character • is not valid in an identifier
  142 | • location[temp] = location[cur] + dist;
      | ^
rail.cpp:144:1: error: extended character • is not valid in an identifier
  144 | • stype[temp] = 2;
      | ^
rail.cpp:146:1: error: extended character • is not valid in an identifier
  146 | • }else{
      | ^
rail.cpp:148:1: error: extended character • is not valid in an identifier
  148 | • location[temp] = location[one] - distone[temp];
      | ^
rail.cpp:150:1: error: extended character • is not valid in an identifier
  150 | • stype[temp] = 1;
      | ^
rail.cpp:152:1: error: extended character • is not valid in an identifier
  152 | • cur = temp;
      | ^
rail.cpp:154:1: error: extended character • is not valid in an identifier
  154 | • }
      | ^
rail.cpp:156:1: error: extended character • is not valid in an identifier
  156 | • }
      | ^
rail.cpp:158:1: error: extended character • is not valid in an identifier
  158 | • sort(rights.begin(), rights.end(), cmp2);
      | ^
rail.cpp:160:1: error: extended character • is not valid in an identifier
  160 | • if (rights.size()){
      | ^
rail.cpp:162:1: error: extended character • is not valid in an identifier
  162 | • ll temp = rights[0];
      | ^
rail.cpp:164:1: error: extended character • is not valid in an identifier
  164 | • location[temp] = location[0] + distzero[temp];
      | ^
rail.cpp:166:1: error: extended character • is not valid in an identifier
  166 | • cur = rights[0];
      | ^
rail.cpp:168:1: error: extended character • is not valid in an identifier
  168 | • stype[temp] = 2;
      | ^
rail.cpp:170:1: error: extended character • is not valid in an identifier
  170 | • }
      | ^
rail.cpp:172:1: error: extended character • is not valid in an identifier
  172 | • FOR(i,1,rights.size()){
      | ^
rail.cpp:174:1: error: extended character • is not valid in an identifier
  174 | • ll temp = rights[i];
      | ^
rail.cpp:176:1: error: extended character • is not valid in an identifier
  176 | • ll dist = getDistance(temp, cur);
      | ^
rail.cpp:178:1: error: extended character • is not valid in an identifier
  178 | • if (dist + distzero[cur] == distzero[temp]){
      | ^
rail.cpp:180:1: error: extended character • is not valid in an identifier
  180 | • location[temp] = location[cur] - dist;
      | ^
rail.cpp:182:1: error: extended character • is not valid in an identifier
  182 | • stype[temp] = 1;
      | ^
rail.cpp:184:1: error: extended character • is not valid in an identifier
  184 | • }else{
      | ^
rail.cpp:186:1: error: extended character • is not valid in an identifier
  186 | • location[temp] = location[0] + distzero[temp];
      | ^
rail.cpp:188:1: error: extended character • is not valid in an identifier
  188 | • stype[temp] = 2;
      | ^
rail.cpp:190:1: error: extended character • is not valid in an identifier
  190 | • cur = temp;
      | ^
rail.cpp:192:1: error: extended character • is not valid in an identifier
  192 | • }
      | ^
rail.cpp:194:1: error: extended character • is not valid in an identifier
  194 | • }
      | ^
rail.cpp:196:1: error: extended character • is not valid in an identifier
  196 | • // FOR(i,0,N){
      | ^
rail.cpp:198:1: error: extended character • is not valid in an identifier
  198 | • // cout << location[i] << " ";
      | ^
rail.cpp:200:1: error: extended character • is not valid in an identifier
  200 | • // }
      | ^
rail.cpp:202:1: error: extended character • is not valid in an identifier
  202 | • // cout << endl;
      | ^
rail.cpp:204:1: error: extended character • is not valid in an identifier
  204 | • }
      | ^
rail.cpp:2:1: error: '\U00002022' does not name a type
    2 | • #include "rail.h"
      | ^
rail.cpp:8:1: error: '\U00002022' does not name a type
    8 | • #define FOR(i,x,y) for(ll i=x; i<y; i++)
      | ^
rail.cpp:8:36: error: 'i' does not name a type
    8 | • #define FOR(i,x,y) for(ll i=x; i<y; i++)
      |                                  ^
rail.cpp:8:41: error: 'i' does not name a type
    8 | • #define FOR(i,x,y) for(ll i=x; i<y; i++)
      |                                       ^
rail.cpp:10:39: error: 'i' does not name a type
   10 | • #define FORNEG(i,x,y) for(ll i=x; i>y; i--)
      |                                     ^
rail.cpp:10:44: error: 'i' does not name a type
   10 | • #define FORNEG(i,x,y) for(ll i=x; i>y; i--)
      |                                          ^
rail.cpp:14:1: error: '\U00002022' does not name a type
   14 | • const ll maxn = 5005;
      | ^
rail.cpp:16:1: error: '\U00002022' does not name a type
   16 | • ll distzero[5005];
      | ^
rail.cpp:18:1: error: '\U00002022' does not name a type
   18 | • ll distone[5005];
      | ^
rail.cpp:20:1: error: '\U00002022' does not name a type
   20 | • bool cmp(ll a, ll b){
      | ^
rail.cpp:26:1: error: '\U00002022' does not name a type
   26 | • bool cmp2(ll a, ll b){
      | ^
rail.cpp:32:1: error: '\U00002022' does not name a type
   32 | • void findLocation(int N, int first, int location[], int stype[])
      | ^