Submission #675411

#TimeUsernameProblemLanguageResultExecution timeMemory
675411Dan4Life이상한 기계 (APIO19_strange_device)C++17
0 / 100
3173 ms464448 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define int long long const int maxn = (int)1e6+10; int n, A, B; pair<int,int> a[maxn]; unordered_map<int,unordered_map<int,bool>> vis; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> A >> B; for(int i = 0; i < n; i++) cin >> a[i].fi >> a[i].se; int i; for(i = 0; i < 10000000; i++){ int x = (i+i/B)%A, y = i%B; //cout << x << " " << y << "\n"; if(vis[x][y]) break; vis[x][y]=1; } for(int j = 0; j < n; j++) cout << min(a[j].se-a[j].fi+1, i) << "\n"; }

Compilation message (stderr)

strange_device.cpp: In function 'int32_t main()':
strange_device.cpp:18:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   18 |   if(vis[x][y]) break; vis[x][y]=1;
      |   ^~
strange_device.cpp:18:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   18 |   if(vis[x][y]) break; vis[x][y]=1;
      |                        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...