Submission #3043036
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define P pair<ll,ll> #define FOR(I,A,B) for(ll I = (A); I < (B); ++I) #define FORR(I,A,B) for(ll I = (B-1); I >= (A); --I) const ll INF=1e18+7; const ll MOD=1e9+7; int main(){ ios::sync_with_stdio(false); cin.tie(0); ll n,l,t; cin>>n>>l>>t; vector<ll> ans(n); ll pass0 = 0; FOR(i,0,n){ ll x,c; cin >> x >> c; if(c==2)c=-1; c *= t; x+=c; pass0 += x/l; if(x=<0)pass0--; x %= l; if(x<0)x+=l; ans[i] = x; } sort(ans.begin(),ans.end()); FOR(i,0,n){ cout<<ans[((i+pass0)%n+n)%n]<<endl; } }
Submission Info
Submission Time | |
---|---|
Task | C - Ants on a Circle |
User | kenta2997 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 620 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:25:8: error: expected primary-expression before ‘<’ token if(x=<0)pass0--; ^