結果
問題 |
No.3260 岩井スターグラフ
|
ユーザー |
![]() |
提出日時 | 2025-09-14 11:36:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 529 ms / 2,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 705 ms |
コンパイル使用メモリ | 84,920 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-14 11:36:36 |
合計ジャッジ時間 | 15,808 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 36 |
ソースコード
// ,,廿_廿,, #include<iostream> #include<vector> using namespace std; int main(){ long long x,y,n;cin>>x>>y>>n; for(int i=0;i<n;++i){ long long u,v;cin>>u>>v;--u,--v; long long ans; if(u==-1){ ans=v%y+1; }else{ if(u/y==v/y)ans=labs(u%y-v%y); else ans=u%y+v%y+2; } cout<<ans<<'\n'; } }