답안 #260007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
260007 2020-08-08T22:42:11 Z s_avila_g 이상한 기계 (APIO19_strange_device) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
map<pair<ll,ll>, ll> mp;

int main(){
    ll n,a,b,x1,y1;
    cin>>n>>a>>b;
    cin>>x1>>y1;
    for(ll i = x1; i <= y1; i++){
        ll xi = ((i+(i/b)) % a), yi = i % b;
        mp[make_pair(xi,yi)]++;
    }
    cout<<mp.size()<<endl;
}

Compilation message

strange_device.cpp:5:10: error: 'll' was not declared in this scope
 map<pair<ll,ll>, ll> mp;
          ^~
strange_device.cpp:5:13: error: 'll' was not declared in this scope
 map<pair<ll,ll>, ll> mp;
             ^~
strange_device.cpp:5:15: error: template argument 1 is invalid
 map<pair<ll,ll>, ll> mp;
               ^
strange_device.cpp:5:15: error: template argument 2 is invalid
strange_device.cpp:5:18: error: 'll' was not declared in this scope
 map<pair<ll,ll>, ll> mp;
                  ^~
strange_device.cpp:5:20: error: template argument 1 is invalid
 map<pair<ll,ll>, ll> mp;
                    ^
strange_device.cpp:5:20: error: template argument 2 is invalid
strange_device.cpp:5:20: error: template argument 3 is invalid
strange_device.cpp:5:20: error: template argument 4 is invalid
strange_device.cpp: In function 'int main()':
strange_device.cpp:8:5: error: 'll' was not declared in this scope
     ll n,a,b,x1,y1;
     ^~
strange_device.cpp:9:10: error: 'n' was not declared in this scope
     cin>>n>>a>>b;
          ^
strange_device.cpp:9:10: note: suggested alternative: 'yn'
     cin>>n>>a>>b;
          ^
          yn
strange_device.cpp:9:13: error: 'a' was not declared in this scope
     cin>>n>>a>>b;
             ^
strange_device.cpp:9:16: error: 'b' was not declared in this scope
     cin>>n>>a>>b;
                ^
strange_device.cpp:10:10: error: 'x1' was not declared in this scope
     cin>>x1>>y1;
          ^~
strange_device.cpp:10:10: note: suggested alternative: 'y1'
     cin>>x1>>y1;
          ^~
          y1
strange_device.cpp:11:12: error: expected ';' before 'i'
     for(ll i = x1; i <= y1; i++){
            ^
strange_device.cpp:11:20: error: 'i' was not declared in this scope
     for(ll i = x1; i <= y1; i++){
                    ^
strange_device.cpp:12:12: error: expected ';' before 'xi'
         ll xi = ((i+(i/b)) % a), yi = i % b;
            ^~
strange_device.cpp:13:22: error: 'xi' was not declared in this scope
         mp[make_pair(xi,yi)]++;
                      ^~
strange_device.cpp:13:25: error: 'yi' was not declared in this scope
         mp[make_pair(xi,yi)]++;
                         ^~
strange_device.cpp:13:25: note: suggested alternative: 'yn'
         mp[make_pair(xi,yi)]++;
                         ^~
                         yn
strange_device.cpp:15:14: error: request for member 'size' in 'mp', which is of non-class type 'int'
     cout<<mp.size()<<endl;
              ^~~~