답안 #478712

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
478712 2021-10-08T07:37:46 Z andrey27_sm 게임 (IOI13_game) C++17
컴파일 오류
0 ms 0 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
map<pair<int,int>,long long> mp;
void init(int c,int r){}
void update(int x,int y,long long val){
  pair<int,int> t = {x,y};
  mp[t] = val;
}
long long calculate (int x1,int y1,int x2,int y2){
  long long ans=0;
  for(auto p:mp){
    int x= p.first.first;
    int y = p.first.second;
    long long val = p.second;
    if(x1 <= x and x<= x2 and y1<=y and y<=y2) ans = __gcd(ans,val);
  }
  return ans;
}

Compilation message

game.cpp:7:2: error: extended character   is not valid in an identifier
    7 |   pair<int,int> t = {x,y};
      |  ^
game.cpp:8:2: error: extended character   is not valid in an identifier
    8 |   mp[t] = val;
      |  ^
game.cpp:11:2: error: extended character   is not valid in an identifier
   11 |   long long ans=0;
      |  ^
game.cpp:12:2: error: extended character   is not valid in an identifier
   12 |   for(auto p:mp){
      |  ^
game.cpp:13:2: error: extended character   is not valid in an identifier
   13 |     int x= p.first.first;
      |  ^
game.cpp:13:5: error: extended character   is not valid in an identifier
   13 |     int x= p.first.first;
      |    ^
game.cpp:14:2: error: extended character   is not valid in an identifier
   14 |     int y = p.first.second;
      |  ^
game.cpp:14:5: error: extended character   is not valid in an identifier
   14 |     int y = p.first.second;
      |    ^
game.cpp:15:2: error: extended character   is not valid in an identifier
   15 |     long long val = p.second;
      |  ^
game.cpp:15:5: error: extended character   is not valid in an identifier
   15 |     long long val = p.second;
      |    ^
game.cpp:16:2: error: extended character   is not valid in an identifier
   16 |     if(x1 <= x and x<= x2 and y1<=y and y<=y2) ans = __gcd(ans,val);
      |  ^
game.cpp:16:5: error: extended character   is not valid in an identifier
   16 |     if(x1 <= x and x<= x2 and y1<=y and y<=y2) ans = __gcd(ans,val);
      |    ^
game.cpp:17:2: error: extended character   is not valid in an identifier
   17 |   }
      |  ^
game.cpp:18:2: error: extended character   is not valid in an identifier
   18 |   return ans;
      |  ^
game.cpp: In function 'void update(int, int, long long int)':
game.cpp:7:2: error: '\U000000a0pair' was not declared in this scope
    7 |   pair<int,int> t = {x,y};
      |  ^~~~~
game.cpp:7:9: error: expected primary-expression before 'int'
    7 |   pair<int,int> t = {x,y};
      |        ^~~
game.cpp:8:2: error: '\U000000a0mp' was not declared in this scope; did you mean 'mp'?
    8 |   mp[t] = val;
      |  ^~~
      |  mp
game.cpp:8:7: error: 't' was not declared in this scope
    8 |   mp[t] = val;
      |      ^
game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:11:2: error: '\U000000a0long' was not declared in this scope; did you mean 'ulong'?
   11 |   long long ans=0;
      |  ^~~~~
      |  ulong
game.cpp:12:8: error: expected primary-expression before 'auto'
   12 |   for(auto p:mp){
      |       ^~~~
game.cpp:12:2: error: '\U000000a0for' was not declared in this scope
   12 |   for(auto p:mp){
      |  ^~~~
game.cpp:18:2: error: '\U000000a0return' was not declared in this scope; did you mean 'sigreturn'?
   18 |   return ans;
      |  ^~~~~~~
      |  sigreturn
game.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^