結果
| 問題 | No.3260 岩井スターグラフ |
| コンテスト | |
| ユーザー |
tau1235
|
| 提出日時 | 2025-09-06 13:56:15 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 266 ms / 2,000 ms |
| + 180µs | |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 2,112 ms |
| コンパイル使用メモリ | 329,756 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-14 19:44:16 |
| 合計ジャッジ時間 | 11,608 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
using ll=long long;
ll x,y,n;
cin>>x>>y>>n;
while (n--){
ll ans=0;
ll u,v;
cin>>u>>v;
if (u>v) swap(u,v);
ll d1=(u-1)%y+1,d2=(v-1)%y+1;
if (u==0) ans=d2;
else{
if ((u-1)/y==(v-1)/y) ans=abs(d1-d2);
else ans=d1+d2;
}
cout<<ans<<endl;
}
}
tau1235