昨天第一次开大小号打cf,发现原来小号提交之后大号在此提交同样的代码会被skipped掉,然后之后提交的代码都不记分,昨天a,b,c都是水题

A

题意:问一个物品最多能被分成多少份,分成的连续两份不能相同

分析:直接1,2这样份,所以除以3乘2,在对3取模

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
int n;
int main()
{
while(cin>>n)
{
int h=n/;
long long sum=h*;
if(n%)
cout<<sum+<<endl;
else
cout<<sum<<endl;
}
return ;
}

B

题意:在一定范围内跳,判断最后是否会跳出范围

分析:直接模拟

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
const int maxn=;
const int maxm=;
typedef struct p
{
char c;
int num;
}p;
p s[maxn];
int n;
int main()
{
while(cin>>n)
{
for(int i=;i<=n;i++)
cin>>s[i].c;
for(int i=;i<=n;i++)
cin>>s[i].num;
int cnt=;
int pos=;
while(cnt<=maxm){
if(s[pos].c=='>'){
pos+=s[pos].num;
if(pos>n) break;
cnt++;
}else if(s[pos].c=='<'){
pos-=s[pos].num;
if(pos<) break;
cnt++;
}
}
if(cnt<maxm) cout<<"FINITE"<<endl;
else cout<<"INFINITE"<<endl;
}
return ;
}

C

题意:给定一些操作,1表示指定行循环左移,2表示指定列循环上移,3表示对指定元素赋值

分析:直接模拟

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
const int maxn=;
const int maxm=;
int a[maxn][maxn];
int x[maxm],y[maxm],r[maxm],c[maxm],t[maxm];
int n,m,q;
int main()
{
while(cin>>n>>m>>q)
{
memset(a,,sizeof(a));
for(int i=;i<q;i++)
{
scanf("%d",&t[i]);
if(t[i]==)
{
scanf("%d",&y[i]);
}else if(t[i]==){
scanf("%d",&y[i]);
}else{
scanf("%d%d%d",&r[i],&c[i],&x[i]);
}
}
for(int i=q-;i>=;i--)
{
int k;
if(t[i]==){
a[r[i]][c[i]]=x[i];
}else if(t[i]==){
k=a[n][y[i]];
for(int j=n;j>;j--)
a[j][y[i]]=a[j-][y[i]];
a[][y[i]]=k;
}else{
k=a[y[i]][m];
for(int j=m;j>;j--)
a[y[i]][j]=a[y[i]][j-];
a[y[i]][]=k; }
}
for(int i=;i<=n;i++)
{
for(int j=;j<m;j++)
printf("%d ",a[i][j]);
printf("%d\n",a[i][m]);
}
} return ;
}

Codeforces#348DIV2/VK CUP 2016的更多相关文章

  1. Codeforces Round VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM 暴力出奇迹!

    VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM Time Lim ...

  2. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) D Bear and Two Paths

    题目链接: http://codeforces.com/contest/673/problem/D 题意: 给四个不同点a,b,c,d,求是否能构造出两条哈密顿通路,一条a到b,一条c到d. 题解: ...

  3. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) C - Bear and Colors

    题目链接: http://codeforces.com/contest/673/problem/C 题解: 枚举所有的区间,维护一下每种颜色出现的次数,记录一下出现最多且最小的就可以了. 暴力n*n. ...

  4. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D. Little Artem and Dance

    题目链接: http://codeforces.com/contest/669/problem/D 题意: 给你一个初始序列:1,2,3,...,n. 现在有两种操作: 1.循环左移,循环右移. 2. ...

  5. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) D. Bear and Two Paths 构造

    D. Bear and Two Paths 题目连接: http://www.codeforces.com/contest/673/problem/D Description Bearland has ...

  6. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) C. Bear and Colors 暴力

    C. Bear and Colors 题目连接: http://www.codeforces.com/contest/673/problem/C Description Bear Limak has ...

  7. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) B. Problems for Round 水题

    B. Problems for Round 题目连接: http://www.codeforces.com/contest/673/problem/B Description There are n ...

  8. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) A. Bear and Game 水题

    A. Bear and Game 题目连接: http://www.codeforces.com/contest/673/problem/A Description Bear Limak likes ...

  9. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 1 Edition) C. Little Artem and Random Variable 数学

    C. Little Artem and Random Variable 题目连接: http://www.codeforces.com/contest/668/problem/C Descriptio ...

随机推荐

  1. SwiftDate 浅析

    SwiftDate是Github上开源的,使用Swift语言编写的NSDate封装库,可以很方便的在Swift中处理日期,比如日期创建,比较,输出等. 特性 支持数学运算符进行日期计算(比如myDat ...

  2. cmd下载文件

    进入cmd 输入ftp 192.168.1.200 然后按照提示输入用户名和密码 cd 进入要下载的目录 dir 看操作权限 lcd查看本地要装下载文件的目录 prompt关闭交互模式 mget da ...

  3. [转]SSL协议与数字证书原理

    1 SSL(Secure Socket Lclientyer)是netscclientpe公司设计的主要用于weserver的安全传输协议.这种协议在WESERVER上获得了广泛的应用. SSL在TC ...

  4. C# Socket的TCP通讯 异步 (2015-11-07 10:07:19)转载▼

    异步 相对于同步,异步中的连接,接收和发送数据的方法都不一样,都有一个回调函数,就是即使不能连接或者接收不到数据,程序还是会一直执行下去,如果连接上了或者接到数据,程序会回到这个回调函数的地方重新往下 ...

  5. 两个byte[]拼接

    //两个byte[]拼接 public byte[] copybyte(byte[] a, byte[] b, byte[] c, byte[] d, byte[] e)///,byte[] f,by ...

  6. java 文件字节输入流

    Example10_4.java import java.io.*; public class Example10_4 { public static void main(String args[]) ...

  7. MySQL解决"is marked as crashed and should be repaired"故障

    具体报错如下: Table '.\Tablename\posts' is marked as crashed and should be repaired 提示说论坛的帖子表posts被标记有问题,需 ...

  8. AngularJS Front-End App with Cloud Storage Tutorial Part 1: Building a Minimal App in Seven Steps

    原文 : http://www.codeproject.com/Articles/1027709/AngularJS-Front-End-App-with-Cloud-Storage-Tutoria ...

  9. c语言字符串转OC字符串

    // 如果把c语言字符串转OC字符串,@(C字符串) char *c = "abc"; NSLog(@"%@", @(c));

  10. JSON & XML 简析

    转载自:http://my.oschina.net/aofe/blog/269260 JSON: XML: JSON格式说明: HTML & XML 的对比 HTML: XML: HTML5新 ...