답안 #568677

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
568677 2022-05-26T03:38:25 Z almothana05 이상한 기계 (APIO19_strange_device) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#define mod 1000000007
#define inf 10000000000000000
using namespace std;
vector<pair<long long , long long> >num;
map<pair<long long , long long> , long long>trans;
int main(){
   
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   long long menge , numm , nummer , ed , cmp , comp , erg = 0;;
   cin >> menge >> cmp >> comp;
   for(long long i = 0 ; i < menge ; i++){
      cin >> numm >> nummer;
      num.push_back({numm , nummer});
   }
   for(long long i = 0 ; i < menge ; i++){
      for(long long j = num[i].first ; j <= num[i].second ; j++){
         numm = (j + (long long)(j/comp)) % cmp;
         nummer = (j) % comp;
         trans[{numm , nummer}]++;
         if(trans[{numm , nummer}] == 1){
            erg++;
         }
      }
   }
   cout << erg << "\n";
}


2 16 13
2 5
18 18

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:11:38: warning: unused variable 'ed' [-Wunused-variable]
   11 |    long long menge , numm , nummer , ed , cmp , comp , erg = 0;;
      |                                      ^~
strange_device.cpp: At global scope:
strange_device.cpp:31:1: error: expected unqualified-id before numeric constant
   31 | 2 16 13
      | ^