답안 #781624

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
781624 2023-07-13T08:46:49 Z makanhulia 이상한 기계 (APIO19_strange_device) C++17
0 / 100
192 ms 524288 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;



int main(){
  ll n,a,b;cin>>n>>a>>b;
  bool vis[b][10000];
  pair<long long,long long> arr[10000];
  for(int i=1;i<=n;i++){
    cin>>arr[i].first>>arr[i].second;
  }
  ll ans=0;
  for(int j=1;j<=n;j++){
    ll x,y;
    x=arr[j].first;
    y=arr[j].second;
    for(ll i=x;i<=y;i++){
      ll c=(i+i/b)%a;
      ll d=i%b;
      if(!vis[d][c]){
        ans++;
        vis[d][c]=true;
      }
    }
  }
  cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 55 ms 61100 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 192 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 17 ms 1204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 10 ms 1100 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 10 ms 1100 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 10 ms 1100 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 159 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Runtime error 55 ms 61100 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -